commit 77cc811: [Minor] Add cleanup on error path
Vsevolod Stakhov
vsevolod at highsecure.ru
Mon Sep 21 11:21:07 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-09-21 12:20:41 +0100
URL: https://github.com/rspamd/rspamd/commit/77cc81109229474ccb90fdcfa76569fd7611d921 (HEAD -> master)
[Minor] Add cleanup on error path
---
src/libutil/shingles.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/libutil/shingles.c b/src/libutil/shingles.c
index 4affb16c3..8816e6e3f 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;
}
More information about the Commits
mailing list