Fix: use zmalloc in lttng enable_events.c
[lttng-tools.git] / src / bin / lttng / commands / enable_events.c
index c4da3dfb67c50ea9cd00d6148a52192722a102d5..0b3443caa0d983a96f0f5276aa67aa5b25aef657 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define _GNU_SOURCE
+#define _LGPL_SOURCE
 #include <assert.h>
 #include <popt.h>
 #include <stdio.h>
@@ -561,7 +562,10 @@ char *print_exclusions(int count, char **names)
 
        /* add length of preamble + one for NUL - one for last (missing) comma */
        length += strlen(preamble);
-       ret = malloc(length);
+       ret = zmalloc(length);
+       if (!ret) {
+               return NULL;
+       }
        strncpy(ret, preamble, length);
        for (i = 0; i < count; i++) {
                strcat(ret, names[i]);
This page took 0.023357 seconds and 4 git commands to generate.