TT#183850 tm: try not to crash on unref

Change-Id: Ia0275a6a624ae748aece92ef538891b17c3e767f
mr11.0
Victor Seva 3 years ago
parent e50bf8b61a
commit 2bd85490c7

@ -59,6 +59,7 @@ sipwise/dialog-support-profile_get_size-for-all-profiles.patch
sipwise/pv_headers-rework-pvh_remove_header_param.patch
### active development
sipwise/presence-be-more-resilient-doing-clean-up.patch
sipwise/tm-check-again-T-just-in-case-before-UNREF.patch
#
### Don't just put stuff in any order
### use gbp pq import/export tooling to help maintain patches

@ -0,0 +1,21 @@
From: Victor Seva <vseva@sipwise.com>
Date: Mon, 4 Jul 2022 15:49:20 +0200
Subject: tm: check T just in case before UNREF
---
src/modules/tm/t_funcs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/tm/t_funcs.h b/src/modules/tm/t_funcs.h
index 6830b13..dbbdc19 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)); \
}\
Loading…
Cancel
Save