X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fenable_events.c;h=0b3443caa0d983a96f0f5276aa67aa5b25aef657;hp=c4da3dfb67c50ea9cd00d6148a52192722a102d5;hb=fd591b187a7f22e140acd258ba7ddb20d339d071;hpb=45d5d421f3464b541315509ecc2295be81b7139d diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index c4da3dfb6..0b3443caa 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -16,6 +16,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -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]);