commit ba285a1: [Minor] Plug leak on error path

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jan 6 16:35:08 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-01-06 16:28:34 +0000
URL: https://github.com/rspamd/rspamd/commit/ba285a1b84465d7de1bd55e27c9c74a665738416 (HEAD -> master)

[Minor] Plug leak on error path

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

diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c
index aac9e518b..ab863aa71 100644
--- a/src/libmime/mime_expressions.c
+++ b/src/libmime/mime_expressions.c
@@ -875,6 +875,7 @@ set:
 							200,
 							"no header name in header regexp: '%s'",
 							mime_atom->str);
+					rspamd_regexp_unref (mime_atom->d.re->regexp);
 					goto err;
 				}
 
@@ -892,12 +893,13 @@ set:
 					rspamd_regexp_unref (own_re);
 				}
 				else {
-					/* We have header regexp, but no header name is detected */
+					/* We have selector regexp, but no selector name is detected */
 					g_set_error (err,
 							rspamd_mime_expr_quark (),
 							200,
 							"no selector name in selector regexp: '%s'",
 							mime_atom->str);
+					rspamd_regexp_unref (mime_atom->d.re->regexp);
 					goto err;
 				}
 			}


More information about the Commits mailing list