{
struct callchain_node *new;
- new = malloc(sizeof(*new));
+ new = zalloc(sizeof(*new));
if (!new) {
perror("not enough memory to create child for code path tree");
return NULL;
for (i = start; i < chain->nr; i++) {
struct callchain_list *call;
- call = malloc(sizeof(*call));
+ call = zalloc(sizeof(*call));
if (!call) {
perror("not enough memory for the code path tree");
return;
if (!chain->nr)
return 0;
- filtered = malloc(sizeof(*filtered) +
+ filtered = zalloc(sizeof(*filtered) +
chain->nr * sizeof(struct resolved_ip));
if (!filtered)
return -ENOMEM;