X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Fdestroy.c;h=1eca989e6cdd6e826b28f452dd1bbdb1209073af;hp=f08a99fd76e73a9ca0fe9daad29153da223f9295;hb=82a3637f639486c07ff937ab03e1e9532379d26a;hpb=beb8c75afd91bc32f2e7a9c124c9a21ecffd1486 diff --git a/lttng/commands/destroy.c b/lttng/commands/destroy.c index f08a99fd7..1eca989e6 100644 --- a/lttng/commands/destroy.c +++ b/lttng/commands/destroy.c @@ -3,8 +3,8 @@ * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * as published by the Free Software Foundation; only version 2 + * of the License. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -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; }