Yet another round of redundand NULL checks before HeapFree (found by Smatch).

Michael Stefaniuc mstefani at redhat.com
Wed Jun 7 18:24:42 CDT 2006


Please disregard this patch as a false positive crept in.

Michael Stefaniuc wrote:
> hopefully this should be the last round of redundand NULL checks before
> HeapFree removals. I know, famous last words. But this time i have
> extended the redundant_null_check.pl Smatch script to find all non-null
> variables from arbitrary complex if-expressions and check that any of
> them dosn't get HeapFree'd on the truth path.

> diff --git a/dlls/msacm32/driver.c b/dlls/msacm32/driver.c
> index e537bc4..bec3526 100644
> --- a/dlls/msacm32/driver.c
> +++ b/dlls/msacm32/driver.c
> @@ -587,7 +587,7 @@ MMRESULT WINAPI acmDriverOpen(PHACMDRIVE
>      return MMSYSERR_NOERROR;
>   gotError:
>      WARN("failed: ret = %08x\n", ret);
> -    if (pad && !pad->hDrvr)
> +    if (!pad->hDrvr)
nice NULL pointer dereference.

>  	HeapFree(MSACM_hHeap, 0, pad);
>      return ret;
>  }

bye
	michael
-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart



More information about the wine-devel mailing list