From: Vsevolod Stakhov Date: Mon, 16 Jul 2018 14:10:29 +0000 (+0100) Subject: [Fix] Plug memory leak in fuzzy updates X-Git-Tag: 1.7.9~112 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ac022163eacc2b2cb6aa83ec7585523f80f301b9;p=rspamd.git [Fix] Plug memory leak in fuzzy updates --- diff --git a/src/libserver/fuzzy_backend_redis.c b/src/libserver/fuzzy_backend_redis.c index 22857cca5..14976a5d9 100644 --- a/src/libserver/fuzzy_backend_redis.c +++ b/src/libserver/fuzzy_backend_redis.c @@ -1279,7 +1279,6 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk, 64 + 1; for (i = 0; i < RSPAMD_SHINGLE_SIZE; i ++) { - guchar *hval; /* * For each command with shingles we additionally emit 32 commands: * EXPIRE __ @@ -1294,9 +1293,6 @@ rspamd_fuzzy_update_append_command (struct rspamd_fuzzy_backend *bk, value = g_string_sized_new (30); rspamd_printf_gstring (value, "%d", (gint)rspamd_fuzzy_backend_get_expire (bk)); - hval = g_malloc (sizeof (io_cmd->cmd.shingle.basic.digest)); - memcpy (hval, io_cmd->cmd.shingle.basic.digest, - sizeof (io_cmd->cmd.shingle.basic.digest)); session->argv[cur_shift] = g_strdup ("EXPIRE"); session->argv_lens[cur_shift++] = sizeof ("EXPIRE") - 1; session->argv[cur_shift] = key->str;