]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix memory in arc signing logic
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 May 2019 14:52:27 +0000 (15:52 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 3 May 2019 14:52:27 +0000 (15:52 +0100)
src/plugins/dkim_check.c

index 8964d99ba6336fab7ae457c746d73bc57d0eb1ca..1b822ccab482cf3a1bebf0d35987841bbd2ce01d 100644 (file)
@@ -902,6 +902,7 @@ lua_dkim_sign_handler (lua_State *L)
 
                if (!no_cache) {
                        sigs = rspamd_mempool_get_variable (task->task_pool, "dkim-signature");
+
                        if (sigs == NULL) {
                                sigs = g_list_append (sigs, hdr);
                                rspamd_mempool_set_variable (task->task_pool, "dkim-signature",
@@ -914,6 +915,10 @@ lua_dkim_sign_handler (lua_State *L)
                lua_pushboolean (L, TRUE);
                lua_pushlstring (L, hdr->str, hdr->len);
 
+               if (no_cache) {
+                       g_string_free (hdr, TRUE);
+               }
+
                return 2;
        }