From: Vsevolod Stakhov Date: Mon, 21 Sep 2020 11:20:41 +0000 (+0100) Subject: [Minor] Add cleanup on error path X-Git-Tag: 2.6~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77cc81109229474ccb90fdcfa76569fd7611d921;p=thirdparty%2Frspamd.git [Minor] Add cleanup on error path --- diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c index 4affb16c30..8816e6e3f0 100644 --- a/src/libutil/shingles.c +++ b/src/libutil/shingles.c @@ -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; }