Cleanup: Replace all perror() uses by the PERROR macro
[lttng-tools.git] / src / bin / lttng / commands / list.c
index 12499ee408f1e545b3afbe727f2b0c3659a23082..aaa8f47a9ec4b157e44ca68fe9b4e0a9d712f161 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <inttypes.h>
 #include <popt.h>
 #include <stdio.h>
@@ -128,14 +129,14 @@ static char *get_cmdline_by_pid(pid_t pid)
        }
 
        /* Caller must free() *cmdline */
-       cmdline = malloc(PATH_MAX);
+       cmdline = zmalloc(PATH_MAX);
        if (!cmdline) {
-               perror("malloc cmdline");
+               PERROR("malloc cmdline");
                goto end;
        }
        ret = fread(cmdline, 1, PATH_MAX, fp);
        if (ret < 0) {
-               perror("fread proc list");
+               PERROR("fread proc list");
        }
 
 end:
This page took 0.023728 seconds and 4 git commands to generate.