diff options
Diffstat (limited to '')
-rw-r--r-- | src/wg_noise.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wg_noise.c b/src/wg_noise.c index 7acf1b6..5e98fbe 100644 --- a/src/wg_noise.c +++ b/src/wg_noise.c @@ -1163,8 +1163,8 @@ noise_consume_response(struct noise_local *l, struct noise_remote **rp, r->r_index.i_local_index == r_idx) { r->r_handshake = hs; r->r_index.i_remote_index = s_idx; - ret = noise_begin_session(r); - *rp = noise_remote_ref(r); + if ((ret = noise_begin_session(r)) == 0) + *rp = noise_remote_ref(r); } rw_wunlock(&r->r_handshake_lock); error_zero: |