[PATCH 5/6] Add LSan annotation to ignore a memory leak

Werner Koch wk at gnupg.org
Wed Jul 22 15:06:53 CEST 2015

On Thu,  9 Jul 2015 17:11, peter at lekensteyn.nl said:

> I am not happy with the method to detect LSan availability, but here I
> hope to solicit for some feedback. Should the code really be added to

Adding a __GNUC__ condition would make it more portable.  I like this
style of annotations and they are useful for other code as well.
libgpg-error is used by all GnuPG code and thus it might be useful to
add this annotation macros to gpg-error.h.

> mpiutil? Or let the caller (tests/mpitests.c) handle leaks?

In GnuPG we have a register_mem_cleanup_func to run free with atexit but
that is not appropriate for a library.  I think such annotations are a
better way.



Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.

More information about the Gcrypt-devel mailing list