1
0
Fork 0

Minor bug fix in mmsbox: empty text body causes crash

This commit is contained in:
bagyenda 2007-06-14 09:10:11 +00:00
parent 26adfda0db
commit 71c19b6b30
1 changed files with 5 additions and 10 deletions

View File

@ -108,18 +108,13 @@ static Octstr *get_keyword(MIMEEntity *me)
MIMEEntity *t = find_textpart(me);
Octstr *txt = t ? mime_entity_body(t) : NULL;
List *l = t ? octstr_split_words(txt) : NULL;
Octstr *keyword = l ? gwlist_get(l, 0) : NULL;
if (keyword)
keyword = octstr_duplicate(keyword);
if (l)
gwlist_destroy(l, (gwlist_item_destructor_t *)octstr_destroy);
if (txt)
octstr_destroy(txt);
Octstr *keyword = l ? gwlist_extract_first(l) : NULL;
if (t)
mime_entity_destroy(t);
gwlist_destroy(l, (gwlist_item_destructor_t *)octstr_destroy);
octstr_destroy(txt);
return keyword;
}