]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: resolve possible null pointer dereference 2095/head
authorIlya Shipitsin <chipitsine@gmail.com>
Thu, 12 Apr 2018 18:23:21 +0000 (23:23 +0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 23 Apr 2018 23:24:52 +0000 (19:24 -0400)
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 <chipitsine@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
isisd/dict.c

index 2ea86d1b68bdb80655f4b450bd086cb0c831e74d..20a4c0ff7383fe31d7199482ff186d797b2bf2e1 100644 (file)
@@ -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('?');