From 79c09386549472ecea72c60850ee33f7a4e49e9c Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 25 Aug 2017 13:17:32 +0200 Subject: parser: Fix memleaks for STRING token (and derived ones) The common paradigm here is that all parser rules converting string tokens into symbols must free the string token if it's not used anymore. This is unrelated to the %destructor directive, since that will apply only if the parser discards the token, which is not the case then. While being at it, simplify error handling in parser rule for listing conntrack helpers (error() won't return NULL) and drop the unused extra parameter passed to error() in level_type rule. Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- src/rule.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 140855f5..44d36c16 100644 --- a/src/rule.c +++ b/src/rule.c @@ -926,6 +926,7 @@ struct monitor *monitor_alloc(uint32_t format, uint32_t type, const char *event) void monitor_free(struct monitor *m) { + xfree(m->event); xfree(m); } -- cgit v1.2.3