lttng command line UI: fix allocation/free
[lttng-tools.git] / lttng / commands / destroy.c
index f08a99fd76e73a9ca0fe9daad29153da223f9295..743d899786a637b58b7b773012832c4426708707 100644 (file)
@@ -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;
 }
This page took 0.024661 seconds and 5 git commands to generate.