commit 7fab241: [Minor] Cleanup memory on the error path

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Mar 20 13:00:05 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-03-20 12:55:09 +0000
URL: https://github.com/rspamd/rspamd/commit/7fab24199ed087a2680d1af59da3fdf51fc21239 (HEAD -> master)

[Minor] Cleanup memory on the error path

---
 src/libmime/mime_expressions.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index 9d1362e28..d3d40c870 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -827,6 +827,7 @@ set:
 						g_set_error (err, rspamd_mime_expr_quark (), 320,
 								"re_conditions is not a table for '%s'",
 								mime_atom->str);
+						rspamd_regexp_unref (mime_atom->d.re->regexp);
 						goto err;
 					}
 
@@ -838,6 +839,7 @@ set:
 							g_set_error (err, rspamd_mime_expr_quark (), 320,
 									"condition for '%s' is invalid, must be function",
 									mime_atom->str);
+							rspamd_regexp_unref (mime_atom->d.re->regexp);
 							goto err;
 						}
 


More information about the Commits mailing list