about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/process/posix_spawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/process/posix_spawn.c b/src/process/posix_spawn.c
index eb98f9f6..f675a13c 100644
--- a/src/process/posix_spawn.c
+++ b/src/process/posix_spawn.c
@@ -166,7 +166,7 @@ int __posix_spawnx(pid_t *restrict res, const char *restrict path,
 
 	close(args.p[0]);
 
-	if (!ec) *res = pid;
+	if (!ec && res) *res = pid;
 
 	pthread_sigmask(SIG_SETMASK, &args.oldmask, 0);
 	pthread_setcancelstate(cs, 0);