Commit ea2f6016 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

advpack: Plug a couple of memory leaks.

parent 2cb378d4
......@@ -710,6 +710,7 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved)
{
HINF hInf;
HRESULT hret = S_OK;
TRACE("(%s, %s, %s, %s, %p, %d, %p, %p)\n",
debugstr_w(pszInfFilename), debugstr_w(pszInstallSection),
......@@ -730,13 +731,13 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
pszBuffer, dwBufferSize, pdwRequiredSize))
{
if (dwBufferSize < *pdwRequiredSize)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
return SPAPI_E_LINE_NOT_FOUND;
hret = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
else
hret = SPAPI_E_LINE_NOT_FOUND;
}
SetupCloseInfFile(hInf);
return S_OK;
return hret;
}
/***********************************************************************
......
......@@ -573,7 +573,10 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
/* empty list */
if (!lstrlenA(szConvertedList))
{
HeapFree(GetProcessHeap(), 0, szConvertedList);
return NULL;
}
*dwNumFiles = 1;
......@@ -744,6 +747,19 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
extractDest.flags |= EXTRACT_EXTRACTFILES;
res = pExtract(&extractDest, CabName);
if (extractDest.filelist)
{
struct ExtractFileList* curr = extractDest.filelist;
struct ExtractFileList* next;
while (curr)
{
next = curr->next;
free_file_node(curr);
curr = next;
}
}
done:
FreeLibrary(hCabinet);
HeapFree(GetProcessHeap(), 0, szConvertedList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment