Browse code

tm: check T just in case before UNREF

Related #3156

Victor Seva authored on 04/07/2022 13:49:20 • Victor Seva committed on 06/07/2022 07:35:43
Showing 1 changed files
... ...
@@ -110,7 +110,7 @@ int send_pr_buffer( struct retr_buf *rb, void *buf, int len);
110 110
 
111 111
 #define UNREF_NOSTATS(_T_cell) \
112 112
 	do{\
113
-		if (atomic_dec_and_test(&(_T_cell)->ref_count)){ \
113
+		if (_T_cell && atomic_dec_and_test(&(_T_cell)->ref_count)){ \
114 114
 			unlink_timers((_T_cell)); \
115 115
 			free_cell((_T_cell)); \
116 116
 		}\