Avoid freeing certain things twice.
authorRichard Levitte <levitte@openssl.org>
Thu, 30 May 2002 12:51:16 +0000 (12:51 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 30 May 2002 12:51:16 +0000 (12:51 +0000)
PR: 43

crypto/asn1/d2i_dhp.c
crypto/asn1/d2i_dsap.c
crypto/asn1/d2i_r_pr.c
crypto/dsa/dsa_asn1.c

index 635ae829db3febf265f1d63b5e21885eb1f8ca82..223ebbbd46d1a6ae9116102b4600b745df0f8bde 100644 (file)
@@ -87,6 +87,7 @@ DH *d2i_DHparams(DH **a, unsigned char **pp, long length)
                }
 
        M_ASN1_BIT_STRING_free(bs);
+       bs = NULL;
 
        M_ASN1_D2I_Finish_2(a);
 
index 9d4dea6145aaef0c0d224b222a2f74efd67d9a1d..a68f35d852bd69bfa0dce68c17d32653ac46d034 100644 (file)
@@ -84,6 +84,7 @@ DSA *d2i_DSAparams(DSA **a, 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);
 
index 6c8a45f821faf2f2c2622a59f904515318e07c41..afd5adb1d871124471e48283daa04904c43594c1 100644 (file)
@@ -108,6 +108,7 @@ RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
                goto err_bn;
 
        M_ASN1_INTEGER_free(bs);
+       bs = NULL;
 
        M_ASN1_D2I_Finish_2(a);
 err_bn:
index a76c8f7c7eb389e3d34a3bfb67b83dceda456f1e..649d17ebe9cd6fd725dec5e30f1e4c98e52db60d 100644 (file)
@@ -84,6 +84,7 @@ DSA_SIG *d2i_DSA_SIG(DSA_SIG **a, 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: