From 38d78cba6ed4b42b0c1134bf05885d7e09537fde Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 31 Dec 2012 16:18:32 +0100 Subject: [PATCH] use calloc_a Signed-off-by: Felix Fietkau --- procd.h | 1 + service.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/procd.h b/procd.h index 6461be6..66a08e2 100644 --- a/procd.h +++ b/procd.h @@ -2,6 +2,7 @@ #define __PROCD_H #include +#include #include #include diff --git a/service.c b/service.c index 8dbb1e6..44b10be 100644 --- a/service.c +++ b/service.c @@ -54,9 +54,7 @@ service_alloc(const char *name) struct service *s; char *new_name; - s = calloc(1, sizeof(*s) + strlen(name) + 1); - - new_name = (char *) (s + 1); + s = calloc_a(sizeof(*s), &new_name, strlen(name) + 1); strcpy(new_name, name); vlist_init(&s->instances, avl_strcmp, service_instance_update); -- 2.25.1