From 1025878e27346ff68b3a07cdcd3cb5dc6df88c67 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 26 Nov 2014 12:32:13 -0500 Subject: [PATCH] Fix: use zmalloc() in lttng view.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/bin/lttng/commands/view.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng/commands/view.c b/src/bin/lttng/commands/view.c index 37fb4b8bc..c1a1323e5 100644 --- a/src/bin/lttng/commands/view.c +++ b/src/bin/lttng/commands/view.c @@ -152,7 +152,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; } @@ -199,7 +199,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; } -- 2.34.1