Skip to content

Commit

Permalink
tm: free new tm cell in case of error if it was not referenced
Browse files Browse the repository at this point in the history
- part of t_uac_prepare(), reported by GH #1554

(cherry picked from commit f947708)
  • Loading branch information
miconda committed Jun 7, 2018
1 parent 6bff7a4 commit 3da0bcb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/modules/tm/uac.c
Expand Up @@ -583,11 +583,18 @@ static inline int t_uac_prepare(uac_req_t *uac_r,

error2:
#ifdef TM_DEL_UNREF
if (!is_ack) {
UNREF_FREE(new_cell);
}else
#endif
if (is_ack) {
free_cell(new_cell);
} else {
if(atomic_get_int(&new_cell->ref_count)==0) {
free_cell(new_cell);
} else {
UNREF_FREE(new_cell);
}
}
#else
free_cell(new_cell);
#endif
error3:
return ret;
}
Expand Down

0 comments on commit 3da0bcb

Please sign in to comment.