diff options
-rw-r--r-- | mpi/mpiutil.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mpi/mpiutil.c b/mpi/mpiutil.c index 99402b82..142c74e0 100644 --- a/mpi/mpiutil.c +++ b/mpi/mpiutil.c @@ -61,7 +61,7 @@ _gcry_mpi_init (void) default: log_bug ("invalid mpi_const selector %d\n", idx); } constants[idx] = mpi_alloc_set_ui (value); - constants[idx]->flags = (16|32); + _gcry_mpi_set_flag(constants[idx], GCRYMPI_FLAG_CONST); } return 0; @@ -665,7 +665,12 @@ _gcry_mpi_set_flag (gcry_mpi_t a, enum gcry_mpi_flag flag) switch (flag) { case GCRYMPI_FLAG_SECURE: mpi_set_secure(a); break; - case GCRYMPI_FLAG_CONST: a->flags |= (16|32); break; + case GCRYMPI_FLAG_CONST: + a->flags |= (16|32); +#if GPGRT_VERSION_NUMBER >= 0x011600 /* 1.22 */ + gpgrt_annotate_leaked_object(a); +#endif + break; case GCRYMPI_FLAG_IMMUTABLE: a->flags |= 16; break; case GCRYMPI_FLAG_USER1: |