commit c0ac131: [Fix] Fix memory in arc signing logic

Vsevolod Stakhov vsevolod at highsecure.ru
Fri May 3 15:00:04 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-05-03 15:52:27 +0100
URL: https://github.com/rspamd/rspamd/commit/c0ac131bcffc8ab6268ef64c7defe1877099fd17

[Fix] Fix memory in arc signing logic

---
 src/plugins/dkim_check.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/plugins/dkim_check.c b/src/plugins/dkim_check.c
index 8964d99ba..1b822ccab 100644
--- a/src/plugins/dkim_check.c
+++ b/src/plugins/dkim_check.c
@@ -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;
 	}
 


More information about the Commits mailing list