From 0cc1115643e690c0c18eb709d34910bc2e980bd8 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Sun, 19 Nov 2000 14:14:52 +0000 Subject: [PATCH] Make sure bs is assigned NULL when it's free'd, or there will be an (incorrect) attempt to free it once more... --- crypto/asn1/d2i_dsap.c | 1 + crypto/asn1/d2i_r_pr.c | 1 + crypto/dsa/dsa_asn1.c | 1 + 3 files changed, 3 insertions(+) diff --git a/crypto/asn1/d2i_dsap.c b/crypto/asn1/d2i_dsap.c index d97330791c..1b6b7cd5bf 100644 --- a/crypto/asn1/d2i_dsap.c +++ b/crypto/asn1/d2i_dsap.c @@ -84,6 +84,7 @@ DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length) if ((ret->g=BN_bin2bn(bs->data,bs->length,ret->g)) == NULL) goto err_bn; M_ASN1_BIT_STRING_free(bs); + bs = NULL; M_ASN1_D2I_Finish_2(a); diff --git a/crypto/asn1/d2i_r_pr.c b/crypto/asn1/d2i_r_pr.c index 3d2dd65637..46037a04e6 100644 --- a/crypto/asn1/d2i_r_pr.c +++ b/crypto/asn1/d2i_r_pr.c @@ -108,6 +108,7 @@ RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **pp, long length) goto err_bn; M_ASN1_INTEGER_free(bs); + bs = NULL; M_ASN1_D2I_Finish_2(a); err_bn: diff --git a/crypto/dsa/dsa_asn1.c b/crypto/dsa/dsa_asn1.c index 81c9c863b4..134fbeebf8 100644 --- a/crypto/dsa/dsa_asn1.c +++ b/crypto/dsa/dsa_asn1.c @@ -84,6 +84,7 @@ DSA_SIG *d2i_DSA_SIG(DSA_SIG **a, const unsigned char **pp, long length) if ((ret->s=BN_bin2bn(bs->data,bs->length,ret->s)) == NULL) goto err_bn; M_ASN1_BIT_STRING_free(bs); + bs = NULL; M_ASN1_D2I_Finish_2(a); err_bn: -- 2.34.1