Willy,

Am 25.11.19 um 17:57 schrieb Willy Tarreau:
> I agree that it's cleaner this way, however it then uncovers another
> issue which is that *if* ever called with a NULL err then it will leak
> memory. William said in the issue discussion that the functions are not

Will it actually leak memory? `memprintf` is a no-op if the given `char
**out` is NULL. That is: It won't allocate anything.

Unless my C foo totally leaves me right now only if the functions are
being passed a valid pointer to a null pointer (*err = NULL) there will
be a leak if the caller does not free the memory at *err after it has
possibly been re-allocated by `memprintf`.

Best regards
Tim Düsterhus

Reply via email to