summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2016-03-24 11:06:23 +0100
committerWerner Koch <wk@gnupg.org>2016-03-24 12:50:24 +0100
commit470a30db241a2d567739ef2adb2a2ee64992d8b4 (patch)
tree8a9747377f234ba27560f5872d2593dd5a6bf879
parentfea5971488e049f902d7912df22a945bc755ad6d (diff)
downloadlibgcrypt-470a30db241a2d567739ef2adb2a2ee64992d8b4.tar.gz
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 <peter@lekensteyn.nl>
-rw-r--r--mpi/mpiutil.c5
1 files changed, 5 insertions, 0 deletions
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