Skip to content

Commit

Permalink
[HH] Check LoadLibrary and GetProcAddress return value (reactos#6082)
Browse files Browse the repository at this point in the history
Handle failure cases.
  • Loading branch information
TAN-Gaming authored Dec 3, 2023
1 parent d795021 commit 9ea2222
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions base/applications/hh/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ WinMain(HINSTANCE hInst,
int ret = -1;

hModule = LoadLibraryA("hhctrl.ocx");
doWinMain = (DOWINMAIN*) GetProcAddress(hModule, "doWinMain");
if (hModule)
{
doWinMain = (DOWINMAIN*)GetProcAddress(hModule, "doWinMain");
if (doWinMain)
ret = doWinMain(hInst, cmdline);

ret = doWinMain(hInst, cmdline);

FreeLibrary(hModule);
FreeLibrary(hModule);
}

return ret;
}

0 comments on commit 9ea2222

Please sign in to comment.