summaryrefslogtreecommitdiffstats
path: root/crypto/bn/bn_lib.c
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2003-12-02 03:16:56 +0000
committerGeoff Thorpe <geoff@openssl.org>2003-12-02 03:16:56 +0000
commit2ae1ea3788206c8f79bc9f4d29eac56352bf3ff6 (patch)
treed05422b3acd639ff7cb1c132ea9000e51e991d39 /crypto/bn/bn_lib.c
parent34066d741a7d24bb73931197d72a7264827325f4 (diff)
BN_FLG_FREE is of extremely dubious usefulness, and is only referred to
once in the source (where it is set for the benefit of no other code whatsoever). I've deprecated the declaration in the header and likewise made the use of the flag conditional in bn_lib.c. Note, this change also NULLs the 'd' pointer in a BIGNUM when it is reset but not deallocated.
Diffstat (limited to 'crypto/bn/bn_lib.c')
-rw-r--r--crypto/bn/bn_lib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index 3ecf83ddf2..3bc67f9de2 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -278,9 +278,15 @@ void BN_free(BIGNUM *a)
if (a == NULL) return;
if ((a->d != NULL) && !(BN_get_flags(a,BN_FLG_STATIC_DATA)))
OPENSSL_free(a->d);
- a->flags|=BN_FLG_FREE; /* REMOVE? */
if (a->flags & BN_FLG_MALLOCED)
OPENSSL_free(a);
+ else
+ {
+#ifndef OPENSSL_NO_DEPRECATED
+ a->flags|=BN_FLG_FREE;
+#endif
+ a->d = NULL;
+ }
}
void BN_init(BIGNUM *a)