Skip to content

Commit

Permalink
Use calloc for safety
Browse files Browse the repository at this point in the history
Co-authored-by: Christiano Haesbaert <haesbaert@haesbaert.org>
  • Loading branch information
talex5 and haesbaert authored Mar 15, 2023
1 parent 0bec10c commit 9a74b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib_eio/unix/fork_action.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9a74b34

Please sign in to comment.