diff options
author | Rich Felker <dalias@aerifal.cx> | 2022-12-17 16:00:19 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2022-12-17 16:00:19 -0500 |
commit | 9532ae1318201d66b235a618df16aac0b3386630 (patch) | |
tree | dea07b4ce3c15d9e0280a3d96726cd0af77c8d08 | |
parent | 7d358599d4c8f793cfb42ee49ff5e1d107de6ee4 (diff) | |
download | musl-9532ae1318201d66b235a618df16aac0b3386630.tar.gz musl-9532ae1318201d66b235a618df16aac0b3386630.tar.bz2 musl-9532ae1318201d66b235a618df16aac0b3386630.tar.xz musl-9532ae1318201d66b235a618df16aac0b3386630.zip |
use libc-internal malloc for pthread_atfork
while no lock is held here making it a lock-order issue, replacement
malloc is likely to want to use pthread_atfork, possibly making the
call to malloc infinitely recursive.
even if not, there is no reason to prefer an application-provided
malloc here.
-rw-r--r-- | src/thread/pthread_atfork.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/thread/pthread_atfork.c b/src/thread/pthread_atfork.c index 6d348ac8..26d32543 100644 --- a/src/thread/pthread_atfork.c +++ b/src/thread/pthread_atfork.c @@ -3,6 +3,11 @@ #include "libc.h" #include "lock.h" +#define malloc __libc_malloc +#define calloc undef +#define realloc undef +#define free undef + static struct atfork_funcs { void (*prepare)(void); void (*parent)(void); |