X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_channels.cpp;h=a7fffbff1b155409f1f613bd2e29bdf47cda29fd;hb=aafac6e102f9a2a44318743e521a3270a580051d;hp=d62aa8656c51a84b395bda2f461e3b98b632a8ea;hpb=21cf9b6b1843774306a76f4dccddddd706b64f79;p=lttng-tools.git diff --git a/src/bin/lttng/commands/enable_channels.cpp b/src/bin/lttng/commands/enable_channels.cpp index d62aa8656..a7fffbff1 100644 --- a/src/bin/lttng/commands/enable_channels.cpp +++ b/src/bin/lttng/commands/enable_channels.cpp @@ -16,14 +16,14 @@ #include #include -#include -#include -#include +#include +#include +#include -#include +#include -#include "../command.h" -#include "../utils.h" +#include "../command.hpp" +#include "../utils.hpp" static struct lttng_channel chan_opts; @@ -644,6 +644,11 @@ int cmd_enable_channels(int argc, const char **argv) ret = CMD_UNDEFINED; goto end; } + + if (opt_arg) { + free(opt_arg); + opt_arg = nullptr; + } } ret = print_missing_or_multiple_domains( @@ -755,5 +760,6 @@ end: /* Overwrite ret if an error occurred when enable_channel */ ret = command_ret ? command_ret : ret; poptFreeContext(pc); + free(opt_arg); return ret; }