Fix: lttng: enable-channel: leak of popt arguments
[lttng-tools.git] / src / bin / lttng / commands / enable_channels.c
index 8ba5db1edeaf66fa93179187bf64dbed3e4181f8..9bfce348b9d038148b565cd01d7a9c8f8f809f87 100644 (file)
@@ -645,6 +645,11 @@ int cmd_enable_channels(int argc, const char **argv)
                        ret = CMD_UNDEFINED;
                        goto end;
                }
+
+               if (opt_arg) {
+                       free(opt_arg);
+                       opt_arg = NULL;
+               }
        }
 
        ret = print_missing_or_multiple_domains(
@@ -756,5 +761,6 @@ end:
        /* Overwrite ret if an error occurred when enable_channel */
        ret = command_ret ? command_ret : ret;
        poptFreeContext(pc);
+       free(opt_arg);
        return ret;
 }
This page took 0.022905 seconds and 4 git commands to generate.