]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Plug potential memory leak with ISO-8859-16 converter
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 1 Feb 2019 12:15:14 +0000 (12:15 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 1 Feb 2019 12:15:14 +0000 (12:15 +0000)
src/libmime/mime_encoding.c

index 213817747beb45bbdecb35b1d558f209d182538b..7b897929ead3de7ffaa0e30406f2e9f0311f1626 100644 (file)
@@ -180,6 +180,9 @@ rspamd_mime_get_converter_cached (const gchar *enc, UErrorCode *err)
                        conv = g_malloc0 (sizeof (*conv));
                        conv->is_internal = TRUE;
                        conv->d.cnv_table = iso_8859_16_map;
+                       conv->canon_name = g_strdup (canon_name);
+
+                       rspamd_lru_hash_insert (cache, conv->canon_name, conv, 0, 0);
                }
        }