summary refs log tree commit diff
path: root/service.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-26 17:51:03 -0400
committerJune McEnroe <june@causal.agency>2021-09-26 17:51:03 -0400
commit55c4755943e16a84b4bb7a6b1d9e4d70ac35728a (patch)
tree8de509bf4c8ac31b3dd7ec7ea9e1a3440b8909a4 /service.c
parentDon't parse config until after daemonization (diff)
downloadcatsit-55c4755943e16a84b4bb7a6b1d9e4d70ac35728a.tar.gz
catsit-55c4755943e16a84b4bb7a6b1d9e4d70ac35728a.zip
Use reallocarray(3)
Diffstat (limited to '')
-rw-r--r--service.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/service.c b/service.c
index c7103f0..5b1d620 100644
--- a/service.c
+++ b/service.c
@@ -82,7 +82,7 @@ int serviceAdd(const char *name, const char *command) {
 
 	if (services.len == services.cap) {
 		size_t cap = (services.cap ? services.cap * 2 : 8);
-		void *ptr = realloc(services.ptr, sizeof(*services.ptr) * cap);
+		void *ptr = reallocarray(services.ptr, cap, sizeof(*services.ptr));
 		if (!ptr) return -1;
 		services.cap = cap;
 		services.ptr = ptr;