X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lttng%2Fcommands%2Fdestroy.c;h=743d899786a637b58b7b773012832c4426708707;hb=eb9cb8b758bc88e9117fd0726646a7c9ae4f7984;hp=f08a99fd76e73a9ca0fe9daad29153da223f9295;hpb=beb8c75afd91bc32f2e7a9c124c9a21ecffd1486;p=lttng-tools.git diff --git a/lttng/commands/destroy.c b/lttng/commands/destroy.c index f08a99fd7..743d89978 100644 --- a/lttng/commands/destroy.c +++ b/lttng/commands/destroy.c @@ -81,7 +81,7 @@ static int destroy_session() goto free_name; } - path = get_config_file_path(); + path = config_get_default_path(); if (path == NULL) { ret = CMD_FATAL; goto free_name; @@ -94,11 +94,12 @@ static int destroy_session() MSG("Session %s destroyed", session_name); } - free(path); ret = CMD_SUCCESS; free_name: - free(session_name); + if (opt_session_name == NULL) { + free(session_name); + } error: return ret; }