From fd6d7293979a52c464bff8e76f36a156fe680daf Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 4 Mar 2014 13:45:17 -0500 Subject: [PATCH] Fix: Unchecked session pointer when destroying a connection in relayd MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit An unknown command currently crashes the relay daemon since destroy_connection calls destroy_session without checking whether or not a session is associated with the connection. Signed-off-by: Jérémie Galarneau Signed-off-by: David Goulet --- src/bin/lttng-relayd/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 53eaca2cb..a93151ac4 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2389,7 +2389,7 @@ static void destroy_connection(struct lttng_ht *relay_connections_ht, connection_delete(relay_connections_ht, conn); /* For the control socket, we try to destroy the session. */ - if (conn->type == RELAY_CONTROL) { + if (conn->type == RELAY_CONTROL && conn->session) { destroy_session(conn->session, conn->sessions_ht); } -- 2.34.1