netapi32: Set the buffer to NULL in NetApiBufferFree

Juan Lang juan.lang at
Thu Jun 26 10:50:54 CDT 2008

> The fix should be
>    *Buffer = NULL;
> not
>    Buffer = NULL;
> since p (in the tests) would still be valid after the NetApiBufferFree call.

That's also not correct, as you'd be dereferencing an invalid pointer.
 NetApiBufferFree takes a void *, not a void ** (unlike

My question remains:  why does setting a local variable to NULL
silence a Valgrind warning?  That sounds like a Valgrind bug to me.

More information about the wine-devel mailing list