From 0a22ddfbb16a61c3e068ea1164e885104366112a Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Mon, 25 Feb 2019 20:18:13 +0000 Subject: *: remove null check before XFREE Signed-off-by: Quentin Young --- ripd/rip_interface.c | 6 ++---- ripd/rip_northbound.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'ripd') diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 9575f6b8a..8bad6b8b1 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -510,11 +510,9 @@ static void rip_interface_reset(struct rip_interface *ri) ri->ri_receive = yang_get_default_enum("%s/version-receive", RIP_IFACE); ri->v2_broadcast = yang_get_default_bool("%s/v2-broadcast", RIP_IFACE); - if (ri->auth_str) - XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str); + XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str); - if (ri->key_chain) - XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain); + XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain); ri->list[RIP_FILTER_IN] = NULL; ri->list[RIP_FILTER_OUT] = NULL; diff --git a/ripd/rip_northbound.c b/ripd/rip_northbound.c index 1e5f86eff..f3b5dc2dc 100644 --- a/ripd/rip_northbound.c +++ b/ripd/rip_northbound.c @@ -937,8 +937,7 @@ lib_interface_rip_authentication_password_modify(enum nb_event event, ifp = yang_dnode_get_entry(dnode, true); ri = ifp->info; - if (ri->auth_str) - XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str); + XFREE(MTYPE_RIP_INTERFACE_STRING, ri->auth_str); ri->auth_str = XSTRDUP(MTYPE_RIP_INTERFACE_STRING, yang_dnode_get_string(dnode, NULL)); @@ -978,8 +977,7 @@ lib_interface_rip_authentication_key_chain_modify(enum nb_event event, ifp = yang_dnode_get_entry(dnode, true); ri = ifp->info; - if (ri->key_chain) - XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain); + XFREE(MTYPE_RIP_INTERFACE_STRING, ri->key_chain); ri->key_chain = XSTRDUP(MTYPE_RIP_INTERFACE_STRING, yang_dnode_get_string(dnode, NULL)); -- cgit v1.2.3