From a84b874a027fd8007efc10e0602396c4b5da170c Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 27 Sep 2024 16:29:03 -0400 Subject: Fix leak * When strdup fails and the temporary file handle is open, close the handle and die. * reported by @kmacdonald-stsci --- src/multiprocessing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/multiprocessing.c') diff --git a/src/multiprocessing.c b/src/multiprocessing.c index 1320a2a..74ba981 100644 --- a/src/multiprocessing.c +++ b/src/multiprocessing.c @@ -117,7 +117,7 @@ struct MultiProcessingTask *mp_pool_task(struct MultiProcessingPool *pool, const // Create a temporary file to act as our intermediate command script FILE *tp = NULL; - char *t_name; + char *t_name = NULL; t_name = xmkstemp(&tp, "w"); if (!t_name || !tp) { return NULL; -- cgit