path: root/src/rule.c
diff options
authorPhil Sutter <>2017-08-25 13:17:32 +0200
committerPablo Neira Ayuso <>2017-08-28 17:18:50 +0200
commit79c09386549472ecea72c60850ee33f7a4e49e9c (patch)
tree1ce54452c107bfbeb971f4f33384ea7063112357 /src/rule.c
parentd3d56d0fe1856b7fe27584eb90e8349e883cd56b (diff)
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 <>
Diffstat (limited to 'src/rule.c')
1 files changed, 1 insertions, 0 deletions
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);