diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-31 16:18:32 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-31 16:18:32 +0100 |
commit | 38d78cba6ed4b42b0c1134bf05885d7e09537fde (patch) | |
tree | c404c99f025326cd7aad0d7177319067281e10f2 | |
parent | d343dd9e9a64d4ae7d225ea29169e97fa8d116a1 (diff) | |
download | unitd-38d78cba6ed4b42b0c1134bf05885d7e09537fde.tar unitd-38d78cba6ed4b42b0c1134bf05885d7e09537fde.zip |
use calloc_a
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r-- | procd.h | 1 | ||||
-rw-r--r-- | service.c | 4 |
2 files changed, 2 insertions, 3 deletions
@@ -2,6 +2,7 @@ #define __PROCD_H #include <libubox/uloop.h> +#include <libubox/utils.h> #include <libubus.h> #include <stdio.h> @@ -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); |