From 9a74b34c6a37457dcb7f415d8dea9a2a24139c2e Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Wed, 15 Mar 2023 15:59:59 +0000 Subject: [PATCH] Use calloc for safety Co-authored-by: Christiano Haesbaert --- lib_eio/unix/fork_action.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib_eio/unix/fork_action.c b/lib_eio/unix/fork_action.c index 41520b89a..89669727d 100644 --- a/lib_eio/unix/fork_action.c +++ b/lib_eio/unix/fork_action.c @@ -44,7 +44,7 @@ void eio_unix_fork_error(int fd, char *fn, char *buf) { static char **make_string_array(int errors, value v_array) { int n = Wosize_val(v_array); - char **c = malloc(sizeof(char *) * (n + 1)); + char **c = calloc(sizeof(char *), (n + 1)); if (!c) { eio_unix_fork_error(errors, "make_string_array", "out of memory"); _exit(1);