Просмотр исходного кода

core: dns cache - test for null pointers before debug checks after removing from list

- next/prev are set to null after remove from list by commit
  0fbcca38574139f1cd8ba7506ee5e204be5f2da7
Daniel-Constantin Mierla 9 лет назад
Родитель
Сommit
70699ae8b9
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      dns_cache.c

+ 3 - 3
dns_cache.c

@@ -459,15 +459,15 @@ int init_dns_cache_stats(int iproc_num)
 
 #define debug_lu_lst( txt, l) \
 	do{ \
-		if (check_lu_lst((l))){  \
+		if ((l) && check_lu_lst((l))){  \
 			dbg_lu_lst(txt  " crt:", (l)); \
 			abort(); \
 		} \
-		if (check_lu_lst((l)->next)){ \
+		if (((l)->next) && check_lu_lst((l)->next)){ \
 			dbg_lu_lst(txt  " next:",  (l)); \
 			abort(); \
 		} \
-		if (check_lu_lst((l)->prev)){ \
+		if (((l)->prev) && check_lu_lst((l)->prev)){ \
 			dbg_lu_lst(txt  " prev:", (l)); \
 			abort(); \
 		} \