From: wwp Date: Wed, 29 Sep 2021 10:59:53 +0000 (+0200) Subject: Fix CID 1491296, 1491368, 1491288 and 1491322: dereference before null check. X-Git-Tag: 3.19.0~162 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=b29415ca69ac2e3036bb0b20c0155309107d9b1e Fix CID 1491296, 1491368, 1491288 and 1491322: dereference before null check. --- diff --git a/src/plugins/notification/notification_popup.c b/src/plugins/notification/notification_popup.c index baa082642..d8abfbd8f 100644 --- a/src/plugins/notification/notification_popup.c +++ b/src/plugins/notification/notification_popup.c @@ -286,9 +286,9 @@ static gboolean notification_libnotify_create(MsgInfo *msginfo, NotificationPopup *ppopup; gchar *summary = NULL; gchar *text = NULL; - gchar *utf8_str = NULL; - gchar *subj = NULL; - gchar *from = NULL; + gchar *utf8_str; + gchar *subj; + gchar *from; gchar *foldname = NULL; GList *caps = NULL; gboolean support_actions = FALSE; @@ -322,10 +322,10 @@ static gboolean notification_libnotify_create(MsgInfo *msginfo, /* Make sure text is valid UTF8 */ utf8_str = notification_validate_utf8_str(text); - g_free(text); - if(from) g_free(from); - if(subj) g_free(subj); + g_free(text); + g_free(from); + g_free(subj); if(foldname) g_free(foldname); break; case F_TYPE_NEWS: diff --git a/src/plugins/notification/notification_trayicon.c b/src/plugins/notification/notification_trayicon.c index f67d81d47..c35781f77 100644 --- a/src/plugins/notification/notification_trayicon.c +++ b/src/plugins/notification/notification_trayicon.c @@ -897,10 +897,10 @@ static gchar* notification_trayicon_popup_assemble_body(MsgInfo *msginfo) /* Make sure text is valid UTF8 */ utf8_str = notification_validate_utf8_str(text); - g_free(text); - if(from) g_free(from); - if(subj) g_free(subj); + g_free(text); + g_free(from); + g_free(subj); if(foldname) g_free(foldname); } else if(popup.num_calendar) {