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 ...@@ -710,6 +710,7 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved) DWORD dwBufferSize, PDWORD pdwRequiredSize, PVOID pvReserved)
{ {
HINF hInf; HINF hInf;
HRESULT hret = S_OK;
TRACE("(%s, %s, %s, %s, %p, %d, %p, %p)\n", TRACE("(%s, %s, %s, %s, %p, %d, %p, %p)\n",
debugstr_w(pszInfFilename), debugstr_w(pszInstallSection), debugstr_w(pszInfFilename), debugstr_w(pszInstallSection),
...@@ -730,13 +731,13 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec ...@@ -730,13 +731,13 @@ HRESULT WINAPI TranslateInfStringW(LPCWSTR pszInfFilename, LPCWSTR pszInstallSec
pszBuffer, dwBufferSize, pdwRequiredSize)) pszBuffer, dwBufferSize, pdwRequiredSize))
{ {
if (dwBufferSize < *pdwRequiredSize) if (dwBufferSize < *pdwRequiredSize)
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER); hret = HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
else
return SPAPI_E_LINE_NOT_FOUND; hret = SPAPI_E_LINE_NOT_FOUND;
} }
SetupCloseInfFile(hInf); SetupCloseInfFile(hInf);
return S_OK; return hret;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -573,7 +573,10 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles) ...@@ -573,7 +573,10 @@ static LPSTR convert_file_list(LPCSTR FileList, DWORD *dwNumFiles)
/* empty list */ /* empty list */
if (!lstrlenA(szConvertedList)) if (!lstrlenA(szConvertedList))
{
HeapFree(GetProcessHeap(), 0, szConvertedList);
return NULL; return NULL;
}
*dwNumFiles = 1; *dwNumFiles = 1;
...@@ -744,6 +747,19 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags, ...@@ -744,6 +747,19 @@ HRESULT WINAPI ExtractFilesA(LPCSTR CabName, LPCSTR ExpandDir, DWORD Flags,
extractDest.flags |= EXTRACT_EXTRACTFILES; extractDest.flags |= EXTRACT_EXTRACTFILES;
res = pExtract(&extractDest, CabName); 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: done:
FreeLibrary(hCabinet); FreeLibrary(hCabinet);
HeapFree(GetProcessHeap(), 0, szConvertedList); 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