X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdisable_events.c;h=c0b8bf9d012d53ed908a8bea019d7ba64955a851;hb=9bd578f50a1e2438c40ca10789ca90d63c8f8829;hp=f447676f312073987a75f1e2ee15ad6a6ab70181;hpb=2722170124d7942f34b991237874a6d6c17fc421;p=lttng-tools.git diff --git a/src/bin/lttng/commands/disable_events.c b/src/bin/lttng/commands/disable_events.c index f447676f3..c0b8bf9d0 100644 --- a/src/bin/lttng/commands/disable_events.c +++ b/src/bin/lttng/commands/disable_events.c @@ -1,19 +1,18 @@ /* * Copyright (C) 2011 - David Goulet * - * 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; only version 2 - * of the License. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License, version 2 only, + * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #define _GNU_SOURCE @@ -100,6 +99,8 @@ static int disable_events(char *session_name) char *event_name, *channel_name = NULL; struct lttng_domain dom; + memset(&dom, 0, sizeof(dom)); + /* Create lttng domain */ if (opt_kernel) { dom.type = LTTNG_DOMAIN_KERNEL; @@ -228,6 +229,9 @@ int cmd_disable_events(int argc, const char **argv) ret = disable_events(session_name); end: + if (!opt_session_name && session_name) { + free(session_name); + } poptFreeContext(pc); return ret; }