NE_LoadFileModule: Free module when NE_LoadDLLs fails.

This commit is contained in:
Uwe Bonnes 1999-06-26 10:19:14 +00:00 committed by Alexandre Julliard
parent a319df3405
commit f1e1c3994c
1 changed files with 5 additions and 2 deletions

View File

@ -43,7 +43,7 @@ static NE_MODULE *pCachedModule = 0; /* Module cached by NE_OpenFile */
static HMODULE16 NE_LoadBuiltin(LPCSTR name,BOOL force) { return 0; }
HMODULE16 (*fnBUILTIN_LoadModule)(LPCSTR name,BOOL force) = NE_LoadBuiltin;
static BOOL16 NE_FreeModule( HMODULE16 hModule, BOOL call_wep );
/***********************************************************************
* NE_GetPtr
@ -814,7 +814,10 @@ static HINSTANCE16 NE_LoadFileModule( HFILE16 hFile, OFSTRUCT *ofs,
/* Load the referenced DLLs */
if (!NE_LoadDLLs( pModule ))
return 2; /* File not found (FIXME: free everything) */
{
NE_FreeModule(hModule,0);
return 2;
}
/* Load the segments */