From 47e5a60f296d6d8f1fd656c98bf48525a7a7dfc1 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Thu, 5 Apr 2018 20:09:56 +0000 Subject: [PATCH] ripd: rip_snmp.c - Remove not needed check 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 --- ripd/rip_snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c index 917e532e0a..19367638cc 100644 --- a/ripd/rip_snmp.c +++ b/ripd/rip_snmp.c @@ -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); -- 2.39.5