Fix: Unchecked session pointer when destroying a connection in relayd
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 4 Mar 2014 18:45:17 +0000 (13:45 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Tue, 4 Mar 2014 19:01:40 +0000 (14:01 -0500)
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 <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-relayd/main.c

index 53eaca2cbf944327b95aa0fced58bb564bb8013f..a93151ac47f560875f07c9cbf113225f9dd892cc 100644 (file)
@@ -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);
        }
 
This page took 0.027403 seconds and 5 git commands to generate.