doscalls: Fixed a memory leak.

This commit is contained in:
Ryan C. Gordon committed 2022-01-29 16:33:54 -05:00
1 parent e993edf411
commit 908587878a
1 file changed
+3 -1
+3 -1
View File
@@ -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;