From 0217a5a18d2213f801a6b15ba72c99acb57d296e Mon Sep 17 00:00:00 2001 From: Antoine Busque Date: Sat, 12 Sep 2015 23:48:11 -0400 Subject: [PATCH] Fix: double free on enable-event MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Antoine Busque Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 7b36ae252..cebe00169 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -1619,9 +1619,10 @@ static int _cmd_enable_event(struct ltt_session *session, event->type = LTTNG_EVENT_SYSCALL; /* Hack */ ret = event_kernel_enable_event(kchan, event, filter_expression_a, filter_a); + /* We have passed ownership */ + filter_expression_a = NULL; + filter_a = NULL; if (ret != LTTNG_OK) { - free(filter_expression_a); - free(filter_a); goto error; } break; -- 2.34.1