]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add cleanup on error path
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Sep 2020 11:20:41 +0000 (12:20 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 21 Sep 2020 11:20:41 +0000 (12:20 +0100)
src/libutil/shingles.c

index 4affb16c30308a302bb45f8edec0ab69dac6810e..8816e6e3f0c5d6db7843f15661ba90cc6fbdf932 100644 (file)
@@ -188,6 +188,8 @@ rspamd_shingles_from_text (GArray *input,
                                                        g_free (res);
                                                }
 
+                                               rspamd_fstring_free (row);
+
                                                return NULL;
                                        }
 
@@ -256,7 +258,12 @@ rspamd_shingles_from_text (GArray *input,
                                                        g_free (hashes[i]);
                                                }
 
+                                               if (pool != NULL) {
+                                                       g_free (res);
+                                               }
+
                                                g_free (hashes);
+                                               rspamd_fstring_free (row);
 
                                                return NULL;
                                        }