mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 10:20:03 +00:00
[WINESYNC] setupapi: Fix memory leak.
Found by Valgrind. wine commit id 63231be8044441218fb82899e748900e1ace3d0d by Huw Davies <huw@codeweavers.com> NOTE: Some of the code was already present as part of ReactOS-specific changes. It has been slightly adapted to suit Wine changes. Co-authored-by: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
parent
3a9df253a1
commit
dda601fc43
|
@ -775,7 +775,7 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf,
|
|||
INFCONTEXT security_context;
|
||||
#endif
|
||||
INFCONTEXT context;
|
||||
WCHAR dest[MAX_PATH], src[MAX_PATH];
|
||||
WCHAR dest[MAX_PATH], src[MAX_PATH], *dest_dir;
|
||||
INT flags;
|
||||
BOOL ret;
|
||||
|
||||
|
@ -828,19 +828,20 @@ BOOL WINAPI SetupQueueCopySectionW( HSPFILEQ queue, PCWSTR src_root, HINF hinf,
|
|||
if (!hlist) hlist = hinf;
|
||||
if (!hinf) hinf = hlist;
|
||||
if (!SetupFindFirstLineW( hlist, section, NULL, &context )) goto done;
|
||||
if (!(params.TargetDirectory = get_destination_dir( hinf, section ))) goto done;
|
||||
if (!(params.TargetDirectory = dest_dir = get_destination_dir( hinf, section ))) goto done;
|
||||
do
|
||||
{
|
||||
if (!SetupGetStringFieldW( &context, 1, dest, sizeof(dest)/sizeof(WCHAR), NULL ))
|
||||
goto done;
|
||||
goto end;
|
||||
if (!SetupGetStringFieldW( &context, 2, src, sizeof(src)/sizeof(WCHAR), NULL )) *src = 0;
|
||||
if (!SetupGetIntField( &context, 4, &flags )) flags = 0; /* FIXME */
|
||||
|
||||
params.SourceFilename = *src ? src : NULL;
|
||||
if (!SetupQueueCopyIndirectW( ¶ms )) goto done;
|
||||
if (!SetupQueueCopyIndirectW( ¶ms )) goto end;
|
||||
} while (SetupFindNextLine( &context, &context ));
|
||||
ret = TRUE;
|
||||
|
||||
end:
|
||||
HeapFree(GetProcessHeap(), 0, dest_dir);
|
||||
done:
|
||||
#ifdef __REACTOS__
|
||||
if (security_descriptor)
|
||||
|
|
|
@ -3,4 +3,4 @@ files:
|
|||
dlls/setupapi/queue.c: dll/win32/setupapi/queue.c
|
||||
dlls/setupapi/stringtable.c: dll/win32/setupapi/stringtable.c
|
||||
tags:
|
||||
wine: ffae0123ac46ba6dfac74d7c84422073fd53b580
|
||||
wine: 63231be8044441218fb82899e748900e1ace3d0d
|
||||
|
|
Loading…
Reference in a new issue