Fix CID 1491146: resource leak.
authorwwp <subscript@free.fr>
Tue, 28 Sep 2021 15:16:57 +0000 (17:16 +0200)
committerwwp <subscript@free.fr>
Tue, 28 Sep 2021 15:16:57 +0000 (17:16 +0200)
src/plugins/attachwarner/attachwarner.c

index 8454ae9a849a12583e52fab83e5b28d31bf4a007..4c019dfd2067bde773bf4b658f5dfaee0579cccb 100644 (file)
@@ -190,6 +190,7 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
 {
        Compose *compose = (Compose *)source;
        AttachWarnerMention *mention = NULL;
+       gboolean ret = FALSE; /* continue sending if FALSE */
 
        debug_print("AttachWarner invoked\n");
        if (compose->batch)
@@ -221,7 +222,7 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
                g_free(message);
                g_free(bold_text);
                if (aval != G_ALERTALTERNATE)
-                       return TRUE;
+                       ret = TRUE;     
        }
        if (mention != NULL) {
                if (mention->context != NULL)
@@ -229,7 +230,7 @@ static gboolean attwarn_before_send_hook(gpointer source, gpointer data)
                g_free(mention);
        }
 
-       return FALSE;   /* continue sending */
+       return ret;
 }
 
 /**