ustctl: do not free object on release_object
[lttng-ust.git] / liblttng-ust-ctl / ustctl.c
index 83c60034edd713fca7e048b40e572987993353b8..7cd01771a507c093a34cf9be82e3f07ee98a44f3 100644 (file)
 #include <string.h>
 #include <lttng/ust-ctl.h>
 #include <lttng/ust-abi.h>
-#include <lttng/usterr-signal-safe.h>
 #include <lttng/ust-events.h>
 #include <sys/mman.h>
+
+#include <usterr-signal-safe.h>
 #include <ust-comm.h>
 
 #include "../libringbuffer/backend.h"
@@ -60,7 +61,6 @@ void ustctl_release_object(int sock, struct lttng_ust_object_data *data)
                ret = ustcomm_send_app_cmd(sock, &lum, &lur);
                assert(!ret);
        }
-       free(data);
 }
 
 /*
@@ -161,6 +161,7 @@ int ustctl_open_metadata(int sock, int session_handle,
 
 error:
        ustctl_release_object(sock, metadata_data);
+       free(metadata_data);
        return -EINVAL;
 }
 
@@ -214,6 +215,7 @@ int ustctl_create_channel(int sock, int session_handle,
 
 error:
        ustctl_release_object(sock, channel_data);
+       free(channel_data);
        return -EINVAL;
 }
 
@@ -265,6 +267,7 @@ int ustctl_create_stream(int sock, struct lttng_ust_object_data *channel_data,
 
 error:
        ustctl_release_object(sock, stream_data);
+       free(stream_data);
        return -EINVAL;
 }
 
This page took 0.024707 seconds and 4 git commands to generate.