talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit b29415ca69ac2e3036bb0b20c0155309107d9b1e
parent 286e63ec8361b7f195925ab1854c2227416d3a56
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:
Msrc/plugins/notification/notification_popup.c | 12++++++------
Msrc/plugins/notification/notification_trayicon.c | 6+++---
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 @@ -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) {