Fix: typo when closing the consumer client socket
[lttng-tools.git] / src / common / consumer.c
index 5ca2e7bad68187f7b61b628a28ae0932658a3ccb..a856f030efe63c3553c820d96012b065e9817e8b 100644 (file)
@@ -102,6 +102,7 @@ static void notify_channel_pipe(struct lttng_consumer_local_data *ctx,
 
        msg.action = action;
        msg.chan = chan;
+       msg.key = key;
        do {
                ret = write(ctx->consumer_channel_pipe[1], &msg, sizeof(msg));
        } while (ret < 0 && errno == EINTR);
@@ -1959,6 +1960,13 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
        }
 
 end:
+       /*
+        * Nullify the stream reference so it is not used after deletion. The
+        * consumer data lock MUST be acquired before being able to check for a
+        * NULL pointer value.
+        */
+       stream->chan->metadata_stream = NULL;
+
        pthread_mutex_unlock(&stream->lock);
        pthread_mutex_unlock(&consumer_data.lock);
 
@@ -2968,7 +2976,7 @@ end:
                }
        }
        if (client_socket >= 0) {
-               ret = close(sock);
+               ret = close(client_socket);
                if (ret < 0) {
                        PERROR("close client_socket sessiond poll");
                }
This page took 0.024435 seconds and 4 git commands to generate.