From 2229472d944795dcb6246480c7dbc3acf0c5c12a Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Thu, 3 Apr 2003 18:04:40 +0000 Subject: [PATCH] Add some missing HeapFree's and one missing free. --- dlls/cabinet/cabextract.c | 4 +++- dlls/dplayx/dplobby.c | 1 + dlls/kernel/console.c | 1 + dlls/psapi/psapi_main.c | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dlls/cabinet/cabextract.c b/dlls/cabinet/cabextract.c index 7c2a5d4242a..ac4a908b8c6 100644 --- a/dlls/cabinet/cabextract.c +++ b/dlls/cabinet/cabextract.c @@ -505,8 +505,10 @@ BOOL cabinet_read_entries(struct cabinet *cab) file->attribs = EndGetI16(buf+cffile_Attribs); file->filename = cabinet_read_string(cab); - if (!file->filename) + if (!file->filename) { + free(file); return FALSE; + } if (!linkfile) cab->files = file; diff --git a/dlls/dplayx/dplobby.c b/dlls/dplayx/dplobby.c index ac7de303fcf..8c04a0f38d7 100644 --- a/dlls/dplayx/dplobby.c +++ b/dlls/dplayx/dplobby.c @@ -529,6 +529,7 @@ static HRESULT WINAPI DPL_ConnectEx 0, lpConn, &dwConnSize ); if( FAILED( hr ) ) { + HeapFree( GetProcessHeap(), 0, lpConn ); return hr; } diff --git a/dlls/kernel/console.c b/dlls/kernel/console.c index a611d28bec4..28e7fbe1b65 100644 --- a/dlls/kernel/console.c +++ b/dlls/kernel/console.c @@ -749,6 +749,7 @@ DWORD WINAPI GetConsoleTitleA(LPSTR title, DWORD size) WideCharToMultiByte( GetConsoleOutputCP(), 0, ptr, ret + 1, title, size, NULL, NULL); ret = strlen(title); } + HeapFree(GetProcessHeap(), 0, ptr); return ret; } diff --git a/dlls/psapi/psapi_main.c b/dlls/psapi/psapi_main.c index edda90aab6d..0f301e6a302 100644 --- a/dlls/psapi/psapi_main.c +++ b/dlls/psapi/psapi_main.c @@ -330,6 +330,7 @@ DWORD WINAPI GetModuleBaseNameW(HANDLE hProcess, HMODULE hModule, lpBaseName[nSize / 2 - 1] = 0; } + HeapFree(GetProcessHeap(), 0, ptr); return len; } @@ -400,6 +401,7 @@ DWORD WINAPI GetModuleFileNameExW(HANDLE hProcess, HMODULE hModule, lpFileName[nSize / 2 - 1] = 0; } + HeapFree(GetProcessHeap(), 0, ptr); return len; }