/*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
* Copyright (C) 2019 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
* SPDX-License-Identifier: GPL-2.0-only
#include <common/utils.h>
#include <lttng/snapshot.h>
#include <lttng/session-descriptor.h>
+#include <common/path.h>
+#include <lttng/lttng.h>
static char *opt_output_path;
static char *opt_session_name;
*
* Spawn a session daemon by forking and execv.
*/
-static int spawn_sessiond(char *pathname)
+static int spawn_sessiond(const char *pathname)
{
int ret = 0;
pid_t pid;
static int launch_sessiond(void)
{
int ret;
- char *pathname = NULL;
+ const char *pathname = NULL;
ret = lttng_session_daemon_alive();
if (ret) {
uint64_t v;
errno = 0;
+ if (opt_arg) {
+ free(opt_arg);
+ opt_arg = NULL;
+ }
+
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;
}