Browse code

tm: check T just in case before UNREF

Related #3156

(cherry picked from commit dedd7ee2ddcb92b020ea40a074008a317a9553f5)
(cherry picked from commit d97c59a15bf6634d28998b3a0fa4acc845b70fa2)
(cherry picked from commit 0967462dd6010e7015743688e5d3442d2124787a)

Victor Seva authored on 04/07/2022 13:49:20 • Daniel-Constantin Mierla committed on 15/09/2022 11:29:15
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
 		}\