Module: kamailio
Branch: master
Commit: dedd7ee2ddcb92b020ea40a074008a317a9553f5
URL:
https://github.com/kamailio/kamailio/commit/dedd7ee2ddcb92b020ea40a074008a3…
Author: Victor Seva <vseva(a)sipwise.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2022-07-06T09:35:43+02:00
tm: check T just in case before UNREF
Related #3156
---
Modified: src/modules/tm/t_funcs.h
---
Diff:
https://github.com/kamailio/kamailio/commit/dedd7ee2ddcb92b020ea40a074008a3…
Patch:
https://github.com/kamailio/kamailio/commit/dedd7ee2ddcb92b020ea40a074008a3…
---
diff --git a/src/modules/tm/t_funcs.h b/src/modules/tm/t_funcs.h
index 6830b13208..dbbdc1960a 100644
--- a/src/modules/tm/t_funcs.h
+++ b/src/modules/tm/t_funcs.h
@@ -110,7 +110,7 @@ int send_pr_buffer( struct retr_buf *rb, void *buf, int len);
#define UNREF_NOSTATS(_T_cell) \
do{\
- if (atomic_dec_and_test(&(_T_cell)->ref_count)){ \
+ if (_T_cell && atomic_dec_and_test(&(_T_cell)->ref_count)){ \
unlink_timers((_T_cell)); \
free_cell((_T_cell)); \
}\