Fix: lttng_trace_archive_location_serialize is called on freed memory
[lttng-tools.git] / src / bin / lttng-sessiond / rotation-thread.c
index f07672c220158d285325db3c57207edfed525f08..fa6808005c2a9b1cb00ab47f402feac2f6834a43 100644 (file)
@@ -25,6 +25,7 @@
 #include <common/kernel-ctl/kernel-ctl.h>
 #include <lttng/notification/channel-internal.h>
 #include <lttng/rotate-internal.h>
+#include <lttng/location-internal.h>
 
 #include "rotation-thread.h"
 #include "lttng-sessiond.h"
@@ -478,7 +479,6 @@ int check_session_rotation_pending(struct ltt_session *session,
 
        if (!session->quiet_rotation) {
                location = session_get_trace_archive_location(session);
-               /* Ownership of location is transferred. */
                ret = notification_thread_command_session_rotation_completed(
                                notification_thread_handle,
                                session->name,
@@ -486,6 +486,7 @@ int check_session_rotation_pending(struct ltt_session *session,
                                session->gid,
                                session->last_archived_chunk_id.value,
                                location);
+               lttng_trace_archive_location_put(location);
                if (ret != LTTNG_OK) {
                        ERR("[rotation-thread] Failed to notify notification thread of completed rotation for session %s",
                                        session->name);
This page took 0.024155 seconds and 5 git commands to generate.