From 470a30db241a2d567739ef2adb2a2ee64992d8b4 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Thu, 24 Mar 2016 11:06:23 +0100 Subject: Mark constant MPIs as non-leaked * mpi/mpiutil.c: Mark "constant" MPIs as explicitly leaked. -- Requires libgpg-error 1.22 (unreleased) for the macros, but since it is a minor debugging aid, do not bump the minimum required version. Signed-off-by: Peter Wu --- mpi/mpiutil.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index 99402b82..6dee0b90 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -211,7 +211,12 @@ _gcry_mpi_free( gcry_mpi_t a ) if (!a ) return; if ((a->flags & 32)) + { +#if GPGRT_VERSION_NUMBER >= 0x011600 /* 1.22 */ + gpgrt_annotate_leaked_object(a); +#endif return; /* Never release a constant. */ + } if ((a->flags & 4)) xfree( a->d ); else -- cgit v1.2.1