Free keys if DSA pairwise error.
[openssl.git] / crypto / dsa / dsa_key.c
index a90b3c460b7a9a250f2c18c2385e08393d8685f7..acc34a586513473aa847503c8497edad40f81ef0 100644 (file)
@@ -162,8 +162,12 @@ static int dsa_builtin_keygen(DSA *dsa)
        if (fips_dsa_pairwise_fail)
                BN_add_word(dsa->pub_key, 1);
        if(!fips_check_dsa(dsa))
+               {
+               dsa->pub_key = NULL;
+               dsa->priv_key = NULL;
+               goto err;
+               }
 #endif
-           goto err;
        ok=1;
 
 err: