[PATCH] advapi32: avoid memory leaks (Coverity)

Alexandre Julliard julliard at winehq.org
Wed Oct 3 11:16:13 CDT 2012


Marcus Meissner <marcus at jet.franken.de> writes:

> @@ -530,8 +530,10 @@ static void test_enum_providers(void)
>  	/* alloc provider to half the size required
>  	 * cbName holds the size required */
>  	providerLen = cbName / 2;
> -	if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen)))
> +	if (!(provider = LocalAlloc(LMEM_ZEROINIT, providerLen))) {
> +	        LocalFree(pszProvName);
>  		return;
> +        }

Actually, checking for allocation failures in tests is not useful, it's
not going to happen.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list