Fix: lttng: enable-channel: leak of popt arguments
[lttng-tools.git] / src / bin / lttng / commands / enable_channels.c
index dd79926f81d6c80b3ef70d56cb8a188d4b491a9c..9bfce348b9d038148b565cd01d7a9c8f8f809f87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  *
  * SPDX-License-Identifier: GPL-2.0-only
  *
@@ -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.02356 seconds and 4 git commands to generate.