Hi,

Florian Obser wrote on Mon, Jun 18, 2018 at 06:54:49PM +0200:
> On Mon, Jun 18, 2018 at 04:37:32PM +0200, Jan Schreiber wrote:

>> this patch closes potential memory leaks in the mandoc memory
>> wrapper functions and follows the examples in the manpages.

> These are not leaks since mandoc exits via err(3) immediately after an
> allocation failure. Which is the whole point of these wrappers I
> imagine.

Exactly, so please don't commit these changes, they make the code
less readable for no benefit.

Where these functions are used, the calling code typically already
holds hundreds of pointers to allocated memory for the syntax tree
that is in the process of being built.  These functions save us from
having to call functions that recursively free the syntax tree 
from each and every place where memory allocation can fail.

Yours,
  Ingo

Reply via email to