]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Plug memory leak in fuzzy updates
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Jul 2018 14:10:29 +0000 (15:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 16 Jul 2018 14:10:29 +0000 (15:10 +0100)
src/libserver/fuzzy_backend_redis.c

index 22857cca533ba8bbd2951a7e369cc9482d6139a8..14976a5d92620ec6cea91164024cbb9ecfcd1665 100644 (file)
@@ -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 <prefix>_<number>_<value> <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;