Fix CID 1402307: use after free, and do a proper freeing of struct.
authorwwp <subscript@free.fr>
Fri, 1 Oct 2021 06:35:29 +0000 (08:35 +0200)
committerwwp <subscript@free.fr>
Fri, 1 Oct 2021 06:35:29 +0000 (08:35 +0200)
src/compose.c

index bd5319b20045cc23c4930d05df4c4548e1527b87..e3d55fe578933b5ba913d82a4ac60da30690311f 100644 (file)
@@ -2389,8 +2389,6 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
        }
        if (!account) {
                account = cur_account;
-               if (manual_headers)
-                       g_free(manual_headers);
        }
        cm_return_val_if_fail(account != NULL, NULL);
 
@@ -2450,7 +2448,7 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
                compose->updating = FALSE;
                compose_destroy(compose);
                if (manual_headers)
-                       g_free(manual_headers);
+                       procheader_entries_free(manual_headers);
                return NULL;
        }
        compose_reedit_set_entry(compose, msginfo);