[PATCH libgpg-error] build: Be more consistent with memory management.

Werner Koch wk at gnupg.org
Tue Apr 27 20:34:35 CEST 2021


On Tue, 27 Apr 2021 12:02, Érico Nogueira said:

> * src/mkheader.c: remove xfree wrapper (free(NULL) is well-defined),

It is weel defined but there SunOS bails out on it.  Further on Windows
you need to use a matching free from the same CRT; in particular for
inter-DLL use malloc and free.  Thuis having a warpper is a good idea.

>   use xmalloc instead of malloc+check return value, use macros to block
>   malloc and strdup from being used in the program.

Nope.  xmalloc is a shortcut to make things easier for short living
programs; replacing existing code by its inferior variant is a Bad
Thing.

If you have a need for changes in libgpg-error, it is best to
communicate your reasons and not just to toss some patches.


Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20210427/df721fe0/attachment-0001.sig>


More information about the Gnupg-devel mailing list