check correct pointer before freeing it (Coverity CID 79,86)
authorNils Larsch <nils@openssl.org>
Mon, 2 Apr 2007 20:29:40 +0000 (20:29 +0000)
committerNils Larsch <nils@openssl.org>
Mon, 2 Apr 2007 20:29:40 +0000 (20:29 +0000)
crypto/dh/dh_ameth.c
crypto/dsa/dsa_ameth.c

index 0ff0fe7f3bc4d5100d4497808f94285d74733d43..420cfcda34b83987e5c2d499458d95c4b226422e 100644 (file)
@@ -117,7 +117,7 @@ static int dh_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
        return 1;
 
        err:
-       if (pubkey)
+       if (public_key)
                ASN1_INTEGER_free(public_key);
        if (dh)
                DH_free(dh);
index fab5d55f76470669af5f32e08e87c16a8dd6367d..be91821dda13068bb35390ffe320fb81cab6f933 100644 (file)
@@ -123,7 +123,7 @@ static int dsa_pub_decode(EVP_PKEY *pkey, X509_PUBKEY *pubkey)
        return 1;
 
        err:
-       if (pubkey)
+       if (public_key)
                ASN1_INTEGER_free(public_key);
        if (dsa)
                DSA_free(dsa);