mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Fix (safe) duplicate free in last 'Free Fix' patch.
This commit is contained in:
parent
023b7bd4cb
commit
7e7a3881c4
@ -1,14 +1,14 @@
|
||||
From 921d9d1c4f4a140ae8d0057079b62a0b8adb6205 Mon Sep 17 00:00:00 2001
|
||||
From 608a327fb5ee53f6c2b5fd0a937bd7e67df98820 Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Thu, 21 Aug 2014 22:54:09 -0600
|
||||
Subject: kernel32: Fix leak on STATUS_NO_SUCH_FILE in QueryDosDeviceW.
|
||||
|
||||
---
|
||||
dlls/kernel32/volume.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
dlls/kernel32/volume.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
|
||||
index d396764..d580f1d 100644
|
||||
index d396764..d7d3ea0 100644
|
||||
--- a/dlls/kernel32/volume.c
|
||||
+++ b/dlls/kernel32/volume.c
|
||||
@@ -1354,10 +1354,8 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
@ -23,6 +23,17 @@ index d396764..d580f1d 100644
|
||||
}
|
||||
done:
|
||||
if (ret)
|
||||
@@ -1398,9 +1396,9 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
nt_buffer[7] = '0' + i;
|
||||
if (!wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, TRUE ))
|
||||
{
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
if (p + 5 >= target + bufsize)
|
||||
{
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||
return 0;
|
||||
}
|
||||
@@ -1409,6 +1407,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
p[4] = 0;
|
||||
p += 5;
|
||||
@ -31,6 +42,17 @@ index d396764..d580f1d 100644
|
||||
}
|
||||
strcpyW( nt_buffer + 4, lptW );
|
||||
for (i = 1; i <= 9; i++)
|
||||
@@ -1416,9 +1415,9 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
nt_buffer[7] = '0' + i;
|
||||
if (!wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, TRUE ))
|
||||
{
|
||||
- RtlFreeAnsiString( &unix_name );
|
||||
if (p + 5 >= target + bufsize)
|
||||
{
|
||||
+ RtlFreeAnsiString( &unix_name );
|
||||
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||
return 0;
|
||||
}
|
||||
@@ -1427,6 +1426,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize )
|
||||
p[4] = 0;
|
||||
p += 5;
|
||||
|
Loading…
x
Reference in New Issue
Block a user