lttng command line UI: fix allocation/free
[lttng-tools.git] / lttng / commands / enable_events.c
index d4af4b3d3a1e647ae9b42dcb2738279ddcfbd830..718e4b3c30b3894d47d20026f4103552c3f0988c 100644 (file)
@@ -152,7 +152,7 @@ error:
 static int enable_events(void)
 {
        int err, ret = CMD_SUCCESS;
-       char *event_name, *channel_name;
+       char *event_name, *channel_name = NULL;
        struct lttng_event ev;
 
        if (set_session_name(opt_session_name) < 0) {
@@ -235,6 +235,9 @@ static int enable_events(void)
        }
 
 error:
+       if (opt_channel_name == NULL) {
+               free(channel_name);
+       }
        return ret;
 }
 
This page took 0.026396 seconds and 5 git commands to generate.