#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <common/compat/time.h>
+#include <common/compat/time.hpp>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
-#include <common/mi-lttng.h>
+#include <common/mi-lttng.hpp>
-#include "../command.h"
-#include "../utils.h"
+#include "../command.hpp"
+#include "../utils.hpp"
-#include <common/defaults.h>
-#include <common/sessiond-comm/sessiond-comm.h>
-#include <common/uri.h>
-#include <common/utils.h>
+#include <common/defaults.hpp>
+#include <common/sessiond-comm/sessiond-comm.hpp>
+#include <common/uri.hpp>
+#include <common/utils.hpp>
+#include <common/path.hpp>
#include <lttng/lttng.h>
static char *opt_output_path;
uint64_t v;
errno = 0;
+ if (opt_arg) {
+ free(opt_arg);
+ opt_arg = nullptr;
+ }
+
opt_arg = poptGetOptArg(pc);
if (!opt_arg) {
/* Set up default values. */
/* Overwrite ret if an error occurred in create_session() */
ret = command_ret ? command_ret : ret;
+ free(opt_arg);
poptFreeContext(pc);
return ret;
}