From d5d63bf12b65741e64735103b0a36a0ebb52b09b Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 18 Dec 2012 14:50:51 -0500 Subject: [PATCH] Fix: possible invalid free in kernel thread Signed-off-by: David Goulet --- src/bin/lttng-sessiond/main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c index 6f8f1486c..6e548f3c1 100644 --- a/src/bin/lttng-sessiond/main.c +++ b/src/bin/lttng-sessiond/main.c @@ -691,6 +691,12 @@ static void *thread_manage_kernel(void *data) DBG("[thread] Thread manage kernel started"); + /* + * This first step of the while is to clean this structure which could free + * non NULL pointers so zero it before the loop. + */ + memset(&events, 0, sizeof(events)); + if (testpoint(thread_manage_kernel)) { goto error_testpoint; } -- 2.34.1