X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fmain.c;h=bdc27475eeaf3c89552ca3cd507ff8b5235c96c8;hb=be7f9dfc77b9541a1ecbbc4c44c80d4aefc66b31;hp=9f094f542f29b1ea97e01858ad9799b1b94254d2;hpb=3e6e0df2f8f9f23d252c2508b6d741916dfcc4b3;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 9f094f542..bdc27475e 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -520,7 +520,7 @@ static int set_options(int argc, char **argv) int c, ret = 0, option_index = 0, retval = 0; int orig_optopt = optopt, orig_optind = optind; char *default_address, *optstring; - const char *config_path = NULL; + char *config_path = NULL; optstring = utils_generate_optstring(long_options, sizeof(long_options) / sizeof(struct option)); @@ -544,6 +544,7 @@ static int set_options(int argc, char **argv) WARN("Getting '%s' argument from setuid/setgid binary refused for security reasons.", "-f, --config"); } else { + free(config_path); config_path = utils_expand_path(optarg); if (!config_path) { ERR("Failed to resolve path: %s", optarg); @@ -656,6 +657,7 @@ static int set_options(int argc, char **argv) } exit: + free(config_path); free(optstring); return retval; }