Minor fix for ERR() call in lttng
[lttng-tools.git] / lttng / lttng.c
index 188b13dd65ae974aff8c6c528b4c0e86bf3bde66..62585528808125dbc3a65eb925448809ad5542fe 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c)  2011 David Goulet <david.goulet@polymtl.ca>
+/*
+ * Copyright (c)  2011 David Goulet <david.goulet@polymtl.ca>
  *
  * 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
@@ -13,7 +14,6 @@
  * 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
@@ -56,14 +56,12 @@ static int process_client_opt(void)
        /* Connect to the session daemon */
        ret = lttng_connect_sessiond();
        if (ret < 0) {
-               ERR("%s", lttng_get_readable_code(ret));
                goto end;
        }
 
        if (opt_list_apps) {
                ret = process_opt_list_apps();
                if (ret < 0) {
-                       ERR("%s", lttng_get_readable_code(ret));
                        goto end;
                }
        }
@@ -71,6 +69,7 @@ static int process_client_opt(void)
        return 0;
 
 end:
+       ERR("%s", lttng_get_readable_code(ret));
        return ret;
 }
 
@@ -105,6 +104,9 @@ static int process_opt_list_apps(void)
                fclose(fp);
        }
 
+       /* Allocated by lttng_ust_list_apps() */
+       free(pids);
+
        return 0;
 
 error:
This page took 0.023688 seconds and 4 git commands to generate.