Fix: sessiond: snapshot: leak of trace chunk
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.cpp
index 4ddff45b4160e711391501fd67d02165aa0c0b32..b4bd6b43fca8826850a83d4f0fd6b0ec4579b735 100644 (file)
@@ -2782,7 +2782,7 @@ int cmd_stop_trace(struct ltt_session *session)
        ksession = session->kernel_session;
        usess = session->ust_session;
 
-       /* Session is not active. Skip everythong and inform the client. */
+       /* Session is not active. Skip everything and inform the client. */
        if (!session->active) {
                ret = LTTNG_ERR_TRACE_ALREADY_STOPPED;
                goto error;
@@ -5176,6 +5176,9 @@ error_close_trace_chunk:
                                session->name);
                ret_code = LTTNG_ERR_CLOSE_TRACE_CHUNK_FAIL_CONSUMER;
        }
+
+       lttng_trace_chunk_put(snapshot_trace_chunk);
+       snapshot_trace_chunk = NULL;
 error:
        if (original_ust_consumer_output) {
                session->ust_session->consumer = original_ust_consumer_output;
This page took 0.023786 seconds and 4 git commands to generate.