From: Jérémie Galarneau Date: Tue, 4 Mar 2014 18:45:17 +0000 (-0500) Subject: Fix: Unchecked session pointer when destroying a connection in relayd X-Git-Tag: v2.4.1~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=23c1fab9b8c518358433f10e15390503654b24fe;p=lttng-tools.git Fix: Unchecked session pointer when destroying a connection in relayd 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 --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index ac3035152..aeb061330 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2253,7 +2253,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); }