summaryrefslogtreecommitdiff
path: root/mpi/mpiutil.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2015-07-07 21:44:19 +0200
committerPeter Wu <peter@lekensteyn.nl>2015-07-07 21:46:49 +0200
commitb7da5beda46b52a8016900bc8078eaff60844b54 (patch)
tree59f60b28fdee9e416b04605587ba15198516c751 /mpi/mpiutil.c
parentb3fc17453bf586a99879a7bba03122a4f0b7aa6d (diff)
downloadlibgcrypt-b7da5beda46b52a8016900bc8078eaff60844b54.tar.gz
Add LSan annotation to ignore a memory leak
* src/g10lib.h: Add annotate_leaked_object macro that ignores leaked objects. This avoids LSan from reporting deliberately leaked memory. * mpi/mpiutil.c: Mark "constant" MPIs as leaked. Signed-off-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'mpi/mpiutil.c')
-rw-r--r--mpi/mpiutil.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c
index 71b3f1c3..9a796c68 100644
--- a/mpi/mpiutil.c
+++ b/mpi/mpiutil.c
@@ -211,7 +211,10 @@ _gcry_mpi_free( gcry_mpi_t a )
if (!a )
return;
if ((a->flags & 32))
- return; /* Never release a constant. */
+ {
+ annotate_leaked_object(a);
+ return; /* Never release a constant. */
+ }
if ((a->flags & 4))
xfree( a->d );
else