Fix: use zmalloc() in lttng view.c
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 26 Nov 2014 17:32:13 +0000 (12:32 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 26 Nov 2014 20:55:21 +0000 (15:55 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/view.c

index 37fb4b8bc3a867ee06ff3e52b3c9155a7069e1a6..c1a1323e5790732a198ca7b77b59c4dabf33df3c 100644 (file)
@@ -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;
        }
This page took 0.025409 seconds and 4 git commands to generate.