From 908587878a0209733376bec563ec06e0516a01ec Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 29 Jan 2022 16:33:54 -0500 Subject: [PATCH] doscalls: Fixed a memory leak. --- native/doscalls.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/native/doscalls.c b/native/doscalls.c index a109124..d0889a1 100644 --- a/native/doscalls.c +++ b/native/doscalls.c @@ -1941,7 +1941,9 @@ static APIRET DosDelete_implementation(PSZ pszFile) if (!unixpath) return err; - if (unlink(unixpath) == -1) { + const int rc = unlink(unixpath); + free(unixpath); + if (rc == -1) { switch (errno) { case EACCES: return ERROR_ACCESS_DENIED; case EBUSY: return ERROR_ACCESS_DENIED;