commit 753698d5eb36b9ce7311b6753111cfb613a4bf4d
parent e3048e92f12db05a9e18328f72acd14094e3f97f
Author: wwp <subscript@free.fr>
Date: Wed, 29 Sep 2021 12:59:53 +0200
Fix CID 1491296, 1491368, 1491288 and 1491322: dereference before null check.
Diffstat:
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git 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
@@ -896,10 +896,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) {