Fix mapping "leak" in newly introduced win32_globallookup.
authorAndy Polyakov <appro@openssl.org>
Sun, 1 Jan 2006 18:38:59 +0000 (18:38 +0000)
committerAndy Polyakov <appro@openssl.org>
Sun, 1 Jan 2006 18:38:59 +0000 (18:38 +0000)
crypto/dso/dso_win32.c

index 73ffe36..94fe473 100644 (file)
@@ -809,7 +809,12 @@ static DSO_FUNC_TYPE win32_globallookup(const char *name)
        module_next  = (MODULE32)GetProcAddress(dll,"Module32Next");
 
        hModuleSnap = (*create_snap)(TH32CS_SNAPMODULE,0);
-       if( hModuleSnap == INVALID_HANDLE_VALUE ) return NULL;
+       if( hModuleSnap == INVALID_HANDLE_VALUE )
+               {
+               FreeLibrary(dll);
+               DSOerr(DSO_F_PATHBYADDR,DSO_R_UNSUPPORTED);
+               return NULL;
+               }
 
        me32.dwSize = sizeof(me32);