Fix: use zmalloc() in lttng view.c
[lttng-tools.git] / src / bin / lttng / commands / view.c
index dcd4d66245fb5049fa241c00feb771fdf52d93ba..de7211718dcd21b7c1eea9b093da26aa4dbd23f1 100644 (file)
@@ -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;
        }
This page took 0.02395 seconds and 4 git commands to generate.