diff --git a/src/wp_dh_exch.c b/src/wp_dh_exch.c index bf6392af..b32a53be 100644 --- a/src/wp_dh_exch.c +++ b/src/wp_dh_exch.c @@ -131,11 +131,13 @@ static wp_DhCtx* wp_dh_dupctx(wp_DhCtx* src) dst->key = src->key; } /* Copy peer's key by up referencing and copying pointer. */ - if (ok && (src->peer != NULL) && (!wp_dh_up_ref(src->peer))) { - ok = 0; - } - else { - dst->peer = src->peer; + if (ok) { + if ((src->peer != NULL) && (!wp_dh_up_ref(src->peer))) { + ok = 0; + } + else { + dst->peer = src->peer; + } } /* Copy User Keying Material. */ if (ok && (src->ukm != NULL) && (src->ukmLen > 0)) { diff --git a/src/wp_ecdh_exch.c b/src/wp_ecdh_exch.c index 871349e0..17f78c0e 100644 --- a/src/wp_ecdh_exch.c +++ b/src/wp_ecdh_exch.c @@ -133,11 +133,13 @@ static wp_EcdhCtx* wp_ecdh_dup(wp_EcdhCtx* src) dst->key = src->key; } /* Copy peer's key by up referencing and copying pointer. */ - if (ok && (src->peer != NULL) && (!wp_ecc_up_ref(src->peer))) { - ok = 0; - } - else { - dst->peer = src->peer; + if (ok) { + if ((src->peer != NULL) && (!wp_ecc_up_ref(src->peer))) { + ok = 0; + } + else { + dst->peer = src->peer; + } } /* Copy User Keying Material. */ if (ok && (src->ukm != NULL) && (src->ukmLen > 0)) { diff --git a/src/wp_ecx_exch.c b/src/wp_ecx_exch.c index 697db656..1a3dae8f 100644 --- a/src/wp_ecx_exch.c +++ b/src/wp_ecx_exch.c @@ -108,11 +108,13 @@ static wp_EcxCtx* wp_ecx_dupctx(wp_EcxCtx* src) else { dst->key = src->key; } - if (ok && (src->peer != NULL) && (!wp_ecx_up_ref(src->peer))) { - ok = 0; - } - else { - dst->peer = src->peer; + if (ok) { + if ((src->peer != NULL) && (!wp_ecx_up_ref(src->peer))) { + ok = 0; + } + else { + dst->peer = src->peer; + } } if (!ok) { wp_ecx_free(dst->key);