summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-15 11:43:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-15 11:43:15 (GMT)
commitdb43c8cbed9e1d40d644e2ecb9112606d4a528bd (patch)
tree9b8af7e7ed03c253b6db378c174598ba9d10fc87
parent062f4d052949b2cd7d7a912c8c4980913a8d6f5b (diff)
downloadtcl-db43c8cbed9e1d40d644e2ecb9112606d4a528bd.zip
tcl-db43c8cbed9e1d40d644e2ecb9112606d4a528bd.tar.gz
tcl-db43c8cbed9e1d40d644e2ecb9112606d4a528bd.tar.bz2
One more ckalloc -> attemptckalloc (in compat/waitpid.c), since we can handle the error.
-rw-r--r--compat/waitpid.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/compat/waitpid.c b/compat/waitpid.c
index 6f43934..e41361b 100644
--- a/compat/waitpid.c
+++ b/compat/waitpid.c
@@ -156,7 +156,11 @@ waitpid(
goto waitAgain;
}
}
- waitPtr = (WaitInfo *) ckalloc(sizeof(WaitInfo));
+ waitPtr = (WaitInfo *) attemptckalloc(sizeof(WaitInfo));
+ if (!waitPtr) {
+ errno = ENOMEM;
+ return -1;
+ }
waitPtr->pid = result;
waitPtr->status = status;
waitPtr->nextPtr = deadList;