perf tools: Introduce zalloc() for the common calloc(1, N) case
[deliverable/linux.git] / tools / perf / builtin-help.c
index 768f9c826312f8e8437e4ecedf5795d7edd674e1..9f810b17c25c58bfb1af1522dc6ec3d4eee85362 100644 (file)
@@ -179,7 +179,7 @@ static void add_man_viewer(const char *name)
 
        while (*p)
                p = &((*p)->next);
-       *p = calloc(1, (sizeof(**p) + len + 1));
+       *p = zalloc(sizeof(**p) + len + 1);
        strncpy((*p)->name, name, len);
 }
 
@@ -194,7 +194,7 @@ static void do_add_man_viewer_info(const char *name,
                                   size_t len,
                                   const char *value)
 {
-       struct man_viewer_info_list *new = calloc(1, sizeof(*new) + len + 1);
+       struct man_viewer_info_list *new = zalloc(sizeof(*new) + len + 1);
 
        strncpy(new->name, name, len);
        new->info = strdup(value);
This page took 0.042451 seconds and 5 git commands to generate.