Minor bug fix in mmsbox: empty text body causes crash
This commit is contained in:
parent
26adfda0db
commit
71c19b6b30
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue