diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 381b5f7b83..e9e1f74bb2 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -1386,7 +1386,8 @@ void sofia_reg_handle_sip_r_register(int status, nua_handle_destroy(sofia_private->gateway->nh); sofia_private->gateway->nh = NULL; sofia_private->gateway->state = REG_STATE_UNREGED; - + } else { + nua_handle_destroy(nh); } return; }