Make sure bs is assigned NULL when it's free'd, or there will be an
[openssl.git] / crypto / asn1 / d2i_r_pr.c
index 6c8a45f..46037a0 100644 (file)
@@ -75,7 +75,7 @@ ASN1_METHOD *RSAPrivateKey_asn1_meth(void)
        return(&method);
        }
 
-RSA *d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length)
+RSA *d2i_RSAPrivateKey(RSA **a, const unsigned char **pp, long length)
        {
        int i=ASN1_R_PARSING;
        ASN1_INTEGER *bs=NULL;
@@ -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: