From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:29:43 +0000 (-0500) Subject: Fix: use zmalloc in lttng enable_events.c X-Git-Tag: v2.5.3~22 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=880e5397bf7966caba19ddb1dc0e0de2a982569c;p=lttng-tools.git Fix: use zmalloc in lttng enable_events.c Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/enable_events.c b/src/bin/lttng/commands/enable_events.c index 11eebc022..c15edf5fd 100644 --- a/src/bin/lttng/commands/enable_events.c +++ b/src/bin/lttng/commands/enable_events.c @@ -422,7 +422,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]);