diff options
Diffstat (limited to 'crypto/dh')
-rw-r--r-- | crypto/dh/dh_lib.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index 2e0393e475..962f864dee 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -83,12 +83,14 @@ DH *DH_new_method(ENGINE *engine) if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { DHerr(DH_F_DH_NEW_METHOD, ERR_R_INIT_FAIL); -err: - DH_free(ret); - ret = NULL; + goto err; } return ret; + + err: + DH_free(ret); + return NULL; } void DH_free(DH *r) |