Browse code

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 authored on 10/11/2015 08:30:30
Showing 1 changed files
... ...
@@ -459,15 +459,15 @@ int init_dns_cache_stats(int iproc_num)
459 459
 
460 460
 #define debug_lu_lst( txt, l) \
461 461
 	do{ \
462
-		if (check_lu_lst((l))){  \
462
+		if ((l) && check_lu_lst((l))){  \
463 463
 			dbg_lu_lst(txt  " crt:", (l)); \
464 464
 			abort(); \
465 465
 		} \
466
-		if (check_lu_lst((l)->next)){ \
466
+		if (((l)->next) && check_lu_lst((l)->next)){ \
467 467
 			dbg_lu_lst(txt  " next:",  (l)); \
468 468
 			abort(); \
469 469
 		} \
470
-		if (check_lu_lst((l)->prev)){ \
470
+		if (((l)->prev) && check_lu_lst((l)->prev)){ \
471 471
 			dbg_lu_lst(txt  " prev:", (l)); \
472 472
 			abort(); \
473 473
 		} \