[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: hh: Avoid handle leak (coverity)
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2012-10-31 10:12:48
Message-ID: 87lienar1b.fsf () wine ! dyndns ! org
[Download RAW message or body]

Frédéric Delanoy <frederic.delanoy@gmail.com> writes:

> @@ -27,9 +27,13 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdline, int cmds
>  
>      HMODULE hModule;
>      DOWINMAIN *doWinMain;
> +    int res;
>  
>      hModule = LoadLibraryA("hhctrl.ocx");
>      doWinMain = (DOWINMAIN*) GetProcAddress(hModule, "doWinMain");
>  
> -    return doWinMain(hInst, cmdline); 
> +    res = doWinMain(hInst, cmdline);
> +    FreeLibrary(hModule);
> +
> +    return res;

Freeing things on process exit is not useful.

-- 
Alexandre Julliard
julliard@winehq.org



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic