From 71c19b6b309839237d1abae420f4c2f90ebc8c5b Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Thu, 14 Jun 2007 09:10:11 +0000 Subject: [PATCH] Minor bug fix in mmsbox: empty text body causes crash --- mbuni/mmsbox/mmsbox.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/mbuni/mmsbox/mmsbox.c b/mbuni/mmsbox/mmsbox.c index e0c0077..23648e5 100644 --- a/mbuni/mmsbox/mmsbox.c +++ b/mbuni/mmsbox/mmsbox.c @@ -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; }