msi 2: Remove redundant NULL checks before x_Release

Mike McCormack mike at codeweavers.com
Fri Dec 1 20:36:50 CST 2006


James Hawkins wrote:

> Changelog:
> * Remove redundant NULL checks before x_Release.

obj->Release() will read the vtable pointer from the object, and that 
will crash if obj is NULL, so these checks are needed.  The following 
code will crash:

IUnknown *obj = NULL;
IUnknown_Release(obj);

You can see this looking at the definition of the IUnknown_Release macro:

include/unknwn.h:#define IUnknown_Release(p) (p)->lpVtbl->Release(p)

Mike



More information about the wine-devel mailing list