From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 17:32:13 +0000 (-0500) Subject: Fix: use zmalloc() in lttng view.c X-Git-Tag: v2.6.0-rc4~25 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=bb70fcdaecc46dc7f7fcdb2233f2671a2e5e9430;p=lttng-tools.git Fix: use zmalloc() in lttng view.c Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng/commands/view.c b/src/bin/lttng/commands/view.c index dcd4d6624..de7211718 100644 --- a/src/bin/lttng/commands/view.c +++ b/src/bin/lttng/commands/view.c @@ -151,7 +151,7 @@ static char **alloc_argv_from_user_opts(char *opts, const char *trace_path) } while (*token != '\0'); /* Add two here for the NULL terminating element and trace path */ - argv = malloc(sizeof(char *) * (num_opts + 2)); + argv = zmalloc(sizeof(char *) * (num_opts + 2)); if (argv == NULL) { goto error; } @@ -198,7 +198,7 @@ static char **alloc_argv_from_local_opts(const char **opts, size_t opts_len, size = sizeof(char *) * mem_len; /* Add two here for the trace_path and the NULL terminating element. */ - argv = malloc(size); + argv = zmalloc(size); if (argv == NULL) { goto error; }