From 4241b8ec2ddc5e78a2e5bf2a4ad9ffdfba8b2312 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Thu, 12 Apr 2018 23:23:21 +0500 Subject: [PATCH] isisd: resolve possible null pointer dereference issue found by cppcheck [isisd/dict.c:1320] -> [isisd/dict.c:1065]: (warning) Either the condition '!dn' is redundant or there is possible null pointer dereference: newnode. [isisd/dict.c:1320] -> [isisd/dict.c:1068]: (warning) Either the condition '!dn' is redundant or there is possible null pointer dereference: newnode. Signed-off-by: Ilya Shipitsin Signed-off-by: Donald Sharp --- isisd/dict.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/isisd/dict.c b/isisd/dict.c index 2ea86d1b68..20a4c0ff73 100644 --- a/isisd/dict.c +++ b/isisd/dict.c @@ -1323,9 +1323,8 @@ static void construct(dict_t *d) free(val); if (dn) dnode_destroy(dn); - } - - dict_load_next(&dl, dn, key); + } else + dict_load_next(&dl, dn, key); break; default: putchar('?'); -- 2.39.5