X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_rotation.cpp;h=1b79da148065b6f0ace1d3d9eaebb8676f8239b7;hb=504021487aa32ab2808d8a483acca552159f5f52;hp=1719f3ac243dd166f3a347399afefcbeea08539a;hpb=4e9db781daa52072d9b0d235691bfad79538e791;p=lttng-tools.git diff --git a/src/bin/lttng/commands/enable_rotation.cpp b/src/bin/lttng/commands/enable_rotation.cpp index 1719f3ac2..1b79da148 100644 --- a/src/bin/lttng/commands/enable_rotation.cpp +++ b/src/bin/lttng/commands/enable_rotation.cpp @@ -16,11 +16,11 @@ #include #include -#include -#include -#include +#include +#include +#include -#include "../command.h" +#include "../command.hpp" #include static char *opt_session_name; @@ -179,6 +179,10 @@ int cmd_enable_rotation(int argc, const char **argv) } while ((opt = poptGetNextOpt(pc)) != -1) { + if (opt_arg) { + free(opt_arg); + opt_arg = nullptr; + } switch (opt) { case OPT_HELP: SHOW_HELP(); @@ -333,6 +337,7 @@ end: if (free_session_name) { free(session_name); } + free(opt_arg); return cmd_ret; error: