summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-15 11:52:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-05-15 11:52:39 (GMT)
commitf6f92fd671de0e358ea37d1745600a106c78b6c0 (patch)
tree0335cdde4ca23b25b41490ff68882bfadc1df9ea
parent48d6b3d84c72484ce405d0c3f3c3c301b2222331 (diff)
parentf2f41b4b85e855ef94dbfcd86d4e9d6cc7ae14b1 (diff)
downloadtcl-f6f92fd671de0e358ea37d1745600a106c78b6c0.zip
tcl-f6f92fd671de0e358ea37d1745600a106c78b6c0.tar.gz
tcl-f6f92fd671de0e358ea37d1745600a106c78b6c0.tar.bz2
Merge 8.7
-rw-r--r--compat/opendir.c3
-rw-r--r--compat/waitpid.c6
-rw-r--r--unix/dltest/pkgooa.c6
3 files changed, 9 insertions, 6 deletions
diff --git a/compat/opendir.c b/compat/opendir.c
index 13eb974..23803ff 100644
--- a/compat/opendir.c
+++ b/compat/opendir.c
@@ -28,9 +28,8 @@ opendir(
if ((fd = open(myname, 0, 0)) == -1) {
return NULL;
}
- dirp = (DIR *) Tcl_Alloc(sizeof(DIR));
+ dirp = (DIR *) Tcl_AttemptAlloc(sizeof(DIR));
if (dirp == NULL) {
- /* unreachable? */
close(fd);
return NULL;
}
diff --git a/compat/waitpid.c b/compat/waitpid.c
index cf025b0..cd04d8b 100644
--- a/compat/waitpid.c
+++ b/compat/waitpid.c
@@ -156,7 +156,11 @@ waitpid(
goto waitAgain;
}
}
- waitPtr = (WaitInfo *) Tcl_Alloc(sizeof(WaitInfo));
+ waitPtr = (WaitInfo *) Tcl_AttemptAlloc(sizeof(WaitInfo));
+ if (!waitPtr) {
+ errno = ENOMEM;
+ return -1;
+ }
waitPtr->pid = result;
waitPtr->status = status;
waitPtr->nextPtr = deadList;
diff --git a/unix/dltest/pkgooa.c b/unix/dltest/pkgooa.c
index 444bb81..e75a2c3 100644
--- a/unix/dltest/pkgooa.c
+++ b/unix/dltest/pkgooa.c
@@ -125,18 +125,18 @@ Pkgooa_Init(
}
if (tclStubsPtr == NULL) {
Tcl_AppendResult(interp, "Tcl stubs are not initialized, "
- "did you compile using -DUSE_TCL_STUBS? ");
+ "did you compile using -DUSE_TCL_STUBS? ", NULL);
return TCL_ERROR;
}
if (Tcl_OOInitStubs(interp) == NULL) {
return TCL_ERROR;
}
if (tclOOStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO stubs are not initialized");
+ Tcl_AppendResult(interp, "TclOO stubs are not initialized", NULL);
return TCL_ERROR;
}
if (tclOOIntStubsPtr == NULL) {
- Tcl_AppendResult(interp, "TclOO internal stubs are not initialized");
+ Tcl_AppendResult(interp, "TclOO internal stubs are not initialized", NULL);
return TCL_ERROR;
}