Fix double free bug in error path
authorMatt Caswell <matt@openssl.org>
Thu, 7 Apr 2016 13:08:52 +0000 (14:08 +0100)
committerMatt Caswell <matt@openssl.org>
Sat, 9 Apr 2016 09:10:55 +0000 (10:10 +0100)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/dsa/dsa_lib.c

index 0fe455703f9f85404ba6efeb83cb2965501f45ad..facb97fb5ebb64571ba8dd7e20f209b5cea66f8c 100644 (file)
@@ -271,6 +271,7 @@ DH *DSA_dup_DH(const DSA *r)
         q = BN_dup(r->q);
         if (p == NULL || g == NULL || q == NULL || !DH_set0_pqg(ret, p, q, g))
             goto err;
+        p = g = q = NULL;
     }
 
     if (r->pub_key != NULL) {