diff options
Diffstat (limited to 'tools/perf/util/callchain.c')
-rw-r--r-- | tools/perf/util/callchain.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c index ac148613afe8..21a52e0a4435 100644 --- a/tools/perf/util/callchain.c +++ b/tools/perf/util/callchain.c | |||
@@ -167,7 +167,7 @@ create_child(struct callchain_node *parent, bool inherit_children) | |||
167 | { | 167 | { |
168 | struct callchain_node *new; | 168 | struct callchain_node *new; |
169 | 169 | ||
170 | new = malloc(sizeof(*new)); | 170 | new = zalloc(sizeof(*new)); |
171 | if (!new) { | 171 | if (!new) { |
172 | perror("not enough memory to create child for code path tree"); | 172 | perror("not enough memory to create child for code path tree"); |
173 | return NULL; | 173 | return NULL; |
@@ -213,7 +213,7 @@ fill_node(struct callchain_node *node, struct resolved_chain *chain, int start) | |||
213 | for (i = start; i < chain->nr; i++) { | 213 | for (i = start; i < chain->nr; i++) { |
214 | struct callchain_list *call; | 214 | struct callchain_list *call; |
215 | 215 | ||
216 | call = malloc(sizeof(*call)); | 216 | call = zalloc(sizeof(*call)); |
217 | if (!call) { | 217 | if (!call) { |
218 | perror("not enough memory for the code path tree"); | 218 | perror("not enough memory for the code path tree"); |
219 | return; | 219 | return; |
@@ -386,7 +386,7 @@ int append_chain(struct callchain_node *root, struct ip_callchain *chain, | |||
386 | if (!chain->nr) | 386 | if (!chain->nr) |
387 | return 0; | 387 | return 0; |
388 | 388 | ||
389 | filtered = malloc(sizeof(*filtered) + | 389 | filtered = zalloc(sizeof(*filtered) + |
390 | chain->nr * sizeof(struct resolved_ip)); | 390 | chain->nr * sizeof(struct resolved_ip)); |
391 | if (!filtered) | 391 | if (!filtered) |
392 | return -ENOMEM; | 392 | return -ENOMEM; |