Fix: lttng_trace_archive_location_serialize is called on freed memory
[lttng-tools.git] / src / lib / lttng-ctl / destruction-handle.c
index c6bb388ebcab793a97badf56e283c832f84b5378..8c832969b176be931c9acd101c6106b0d1502373 100644 (file)
@@ -59,7 +59,7 @@ void lttng_destruction_handle_destroy(struct lttng_destruction_handle *handle)
         }
         lttng_poll_clean(&handle->communication.events);
        lttng_dynamic_buffer_reset(&handle->communication.buffer);
-       lttng_trace_archive_location_destroy(handle->location);
+       lttng_trace_archive_location_put(handle->location);
        free(handle);
 }
 
@@ -173,6 +173,7 @@ int handle_state_transition(struct lttng_destruction_handle *handle)
                        ret = -1;
                        break;
                } else {
+                       /* Ownership is transferred to the destruction handle. */
                        handle->location = location;
                        handle->communication.state = COMMUNICATION_STATE_END;
                }
@@ -394,7 +395,7 @@ enum lttng_error_code lttng_destroy_session_ext(const char *session_name,
        int sessiond_socket = -1;
        struct lttng_destruction_handle *handle = NULL;
 
-       if (!session_name || !_handle) {
+       if (!session_name) {
                ret_code = LTTNG_ERR_INVALID;
                goto error;
        }
This page took 0.024572 seconds and 5 git commands to generate.