From 19c46d16f13e2ac1218d3f61a2d2e8382b462280 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 28 Aug 2018 21:31:20 -0400 Subject: [PATCH] check pthread_atfork return value --- malloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/malloc.c b/malloc.c index 1f86a47..c6f7d85 100644 --- a/malloc.c +++ b/malloc.c @@ -602,7 +602,9 @@ COLD static void init_slow_path(void) { return; } - pthread_atfork(pre_fork, post_fork_parent, post_fork_child); + if (pthread_atfork(pre_fork, post_fork_parent, post_fork_child)) { + fatal_error("pthread_atfork failed"); + } struct random_state rng; random_state_init(&rng);