aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:26:19 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2026-04-23 12:26:19 -0400
commit7ad35beeb67a00dda252c57e4a3f3fc04cbb3318 (patch)
treea9c008c2d08bd621ae5a09b20d9c73244516ffea
parent71c98089bc7cddaae2eab41ab09e250c7a0a43ca (diff)
downloadstasis-7ad35beeb67a00dda252c57e4a3f3fc04cbb3318.tar.gz
Check t_name and tp independently for errors
-rw-r--r--src/lib/core/multiprocessing.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/core/multiprocessing.c b/src/lib/core/multiprocessing.c
index 06815a1..7b16af3 100644
--- a/src/lib/core/multiprocessing.c
+++ b/src/lib/core/multiprocessing.c
@@ -195,7 +195,16 @@ struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const
char *t_name = NULL;
t_name = xmkstemp(&tp, "w");
- if (!t_name || !tp) {
+ if (!t_name) {
+ SYSERROR("%s", "Failed to create temporary file name");
+ if (tp) {
+ fclose(tp);
+ }
+ return NULL;
+ }
+ if (!tp) {
+ SYSERROR("%s", "Failed to create temporary file");
+ guard_free(t_name);
return NULL;
}