diff --git a/reactos/dll/cpl/sysdm/hardprof.c b/reactos/dll/cpl/sysdm/hardprof.c index dec9b53c21d..98876fe72da 100644 --- a/reactos/dll/cpl/sysdm/hardprof.c +++ b/reactos/dll/cpl/sysdm/hardprof.c @@ -207,7 +207,10 @@ GetProfiles(HWND hwndDlg) return FALSE; if (!GetProfileCount(&pProfileData->dwProfileCount)) + { + HeapFree(pProfileData, 0, GetProcessHeap()); return FALSE; + } pProfileData->pProfiles = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, pProfileData->dwProfileCount * sizeof(PROFILE));