]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: rip_snmp.c - Remove not needed check
authorIlya Shipitsin <chipitsine@gmail.com>
Thu, 5 Apr 2018 20:09:56 +0000 (20:09 +0000)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 11 Apr 2018 11:35:20 +0000 (07:35 -0400)
rn cannot be null here

issue detected by cppcheck:

[ripd/rip_snmp.c:208] -> [ripd/rip_snmp.c:207]: (warning) Either the condition
'if(rn&&!strncmp(i->name,ifp->name,INTERFACE_NAMSIZ))' is redundant or there is
possible null pointer dereference: rn.

Signed-off-by: Ilya Shipitsin <chipitsine@gmail.com>
ripd/rip_snmp.c

index 917e532e0a95b79e8f28b05701428edfe4d0a12d..19367638cc36e9cb9e70b1304b4ec8028b93f90b 100644 (file)
@@ -207,7 +207,7 @@ static int rip_snmp_ifaddr_del(struct connected *ifc)
        if (!rn)
                return 0;
        i = rn->info;
-       if (rn && !strncmp(i->name, ifp->name, INTERFACE_NAMSIZ)) {
+       if (!strncmp(i->name, ifp->name, INTERFACE_NAMSIZ)) {
                rn->info = NULL;
                route_unlock_node(rn);
                route_unlock_node(rn);