Darshit Shah <dar...@gmail.com> writes:

>     Should we xfree_null (qop) before setting it to NULL?
>     
>     
> qop will ALWAYS be xfree'd if it is explicitly set to NULL. The if
> statement on the next line takes care of that.

sorry, I still don't understand it.  Won't "xfree_null (qop)" be a NOP
when qop is NULL?

AFAICS, we can access the memory pointed by qop only trough the qop
pointer itself, if we set qop to NULL then we have lost access to the
memory.

Please note that xfree_null is defined in utils.h as:

#define xfree_null(p) if (!(p)) ; else xfree (p)



> In the original code, we set user to NULL while it was xfree'd only at
> termination time.

The original code was leaking memory, so please don't take it as an
example :-)  digest_authentication_encode doesn't allocate "user", so in
any case digest_authentication_encode is not the right place to free it.

Thanks,
Giuseppe

Reply via email to