summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2020-02-03 17:22:13 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2020-02-03 17:22:13 +0100
commitb3ba5dc7fe769f3719b2812e4fdb9f8f8271032d (patch)
tree326b49289dd6b1e83c4ff98899983dd4972afff8
parentMerge pull request #5669 from donaldsharp/nhg_ip (diff)
downloadfrr-b3ba5dc7fe769f3719b2812e4fdb9f8f8271032d.tar.xz
frr-b3ba5dc7fe769f3719b2812e4fdb9f8f8271032d.zip
*: don't null after XFREE; XFREE does this itself
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
-rw-r--r--babeld/babeld.c2
-rw-r--r--bfdd/control.c1
-rw-r--r--bgpd/bgp_advertise.c1
-rw-r--r--bgpd/bgp_community.c1
-rw-r--r--bgpd/bgp_dump.c2
-rw-r--r--bgpd/bgp_filter.c1
-rw-r--r--bgpd/bgp_lcommunity.c1
-rw-r--r--bgpd/bgp_main.c1
-rw-r--r--bgpd/bgp_mpath.c1
-rw-r--r--bgpd/bgp_open.c3
-rw-r--r--bgpd/bgp_packet.c3
-rw-r--r--bgpd/bgp_pbr.c1
-rw-r--r--bgpd/bgp_route.c6
-rw-r--r--bgpd/bgp_updgrp.c3
-rw-r--r--bgpd/bgp_zebra.c1
-rw-r--r--bgpd/bgpd.c20
-rw-r--r--bgpd/rfapi/rfapi.c1
-rw-r--r--bgpd/rfapi/rfapi_encap_tlv.c1
-rw-r--r--eigrpd/eigrp_interface.c1
-rw-r--r--isisd/isis_bfd.c1
-rw-r--r--lib/bfd.c1
-rw-r--r--lib/command.c2
-rw-r--r--lib/distribute.c2
-rw-r--r--lib/filter.c1
-rw-r--r--lib/if.c1
-rw-r--r--lib/if_rmap.c2
-rw-r--r--lib/log.c1
-rw-r--r--lib/plist.c2
-rw-r--r--lib/prefix.c1
-rw-r--r--lib/routemap.c1
-rw-r--r--lib/vty.c2
-rw-r--r--nhrpd/nhrp_route.c1
-rw-r--r--nhrpd/nhrp_shortcut.c1
-rw-r--r--ospf6d/ospf6_message.c2
-rw-r--r--ospfd/ospf_asbr.c1
-rw-r--r--ospfd/ospf_interface.c1
-rw-r--r--ripd/rip_interface.c1
-rw-r--r--ripngd/ripng_interface.c1
-rw-r--r--tests/lib/test_heavy_wq.c1
-rw-r--r--vtysh/vtysh.c1
-rw-r--r--zebra/zebra_dplane.c1
-rw-r--r--zebra/zebra_nhg.c1
-rw-r--r--zebra/zebra_rib.c2
43 files changed, 0 insertions, 82 deletions
diff --git a/babeld/babeld.c b/babeld/babeld.c
index 6ad004a4a..71bab2fcb 100644
--- a/babeld/babeld.c
+++ b/babeld/babeld.c
@@ -165,7 +165,6 @@ babel_create_routing_process (void)
return 0;
fail:
XFREE(MTYPE_BABEL, babel_routing_process);
- babel_routing_process = NULL;
return -1;
}
@@ -324,7 +323,6 @@ babel_clean_routing_process(void)
distribute_list_delete(&babel_routing_process->distribute_ctx);
XFREE(MTYPE_BABEL, babel_routing_process);
- babel_routing_process = NULL;
}
/* Function used with timeout. */
diff --git a/bfdd/control.c b/bfdd/control.c
index cf821f45b..ae6f5a3e7 100644
--- a/bfdd/control.c
+++ b/bfdd/control.c
@@ -407,7 +407,6 @@ static void control_reset_buf(struct bfd_control_buffer *bcb)
{
/* Get ride of old data. */
XFREE(MTYPE_BFDD_NOTIFICATION, bcb->bcb_buf);
- bcb->bcb_buf = NULL;
bcb->bcb_pos = 0;
bcb->bcb_left = 0;
}
diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c
index 76a65f7f0..8d1c83cf5 100644
--- a/bgpd/bgp_advertise.c
+++ b/bgpd/bgp_advertise.c
@@ -256,6 +256,5 @@ void bgp_sync_delete(struct peer *peer)
FOREACH_AFI_SAFI (afi, safi) {
XFREE(MTYPE_BGP_SYNCHRONISE, peer->sync[afi][safi]);
- peer->sync[afi][safi] = NULL;
}
}
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c
index 432c922ea..496d7ed2b 100644
--- a/bgpd/bgp_community.c
+++ b/bgpd/bgp_community.c
@@ -89,7 +89,6 @@ void community_del_val(struct community *com, uint32_t *val)
com->val, com_length(com));
else {
XFREE(MTYPE_COMMUNITY_VAL, com->val);
- com->val = NULL;
}
return;
}
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c
index f850cb49c..e9711f5b9 100644
--- a/bgpd/bgp_dump.c
+++ b/bgpd/bgp_dump.c
@@ -669,7 +669,6 @@ static int bgp_dump_unset(struct bgp_dump *bgp_dump)
/* Removing file name. */
if (bgp_dump->filename) {
XFREE(MTYPE_BGP_DUMP_STR, bgp_dump->filename);
- bgp_dump->filename = NULL;
}
/* Closing file. */
@@ -689,7 +688,6 @@ static int bgp_dump_unset(struct bgp_dump *bgp_dump)
/* Removing interval string. */
if (bgp_dump->interval_str) {
XFREE(MTYPE_BGP_DUMP_STR, bgp_dump->interval_str);
- bgp_dump->interval_str = NULL;
}
return CMD_SUCCESS;
diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c
index f08f9b2fb..a3c86c7ea 100644
--- a/bgpd/bgp_filter.c
+++ b/bgpd/bgp_filter.c
@@ -170,7 +170,6 @@ static void as_list_free(struct as_list *aslist)
{
if (aslist->name) {
XFREE(MTYPE_AS_STR, aslist->name);
- aslist->name = NULL;
}
XFREE(MTYPE_AS_LIST, aslist);
}
diff --git a/bgpd/bgp_lcommunity.c b/bgpd/bgp_lcommunity.c
index 674686b3c..f88969300 100644
--- a/bgpd/bgp_lcommunity.c
+++ b/bgpd/bgp_lcommunity.c
@@ -527,7 +527,6 @@ void lcommunity_del_val(struct lcommunity *lcom, uint8_t *ptr)
lcom->val, lcom_length(lcom));
else {
XFREE(MTYPE_LCOMMUNITY_VAL, lcom->val);
- lcom->val = NULL;
}
return;
}
diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c
index fab2a584c..898c35e4e 100644
--- a/bgpd/bgp_main.c
+++ b/bgpd/bgp_main.c
@@ -272,7 +272,6 @@ static int bgp_vrf_enable(struct vrf *vrf)
if (bgp && bgp->vrf_id != vrf->vrf_id) {
if (bgp->name && strmatch(vrf->name, VRF_DEFAULT_NAME)) {
XFREE(MTYPE_BGP, bgp->name);
- bgp->name = NULL;
XFREE(MTYPE_BGP, bgp->name_pretty);
bgp->name_pretty = XSTRDUP(MTYPE_BGP, "VRF default");
bgp->inst_type = BGP_INSTANCE_TYPE_DEFAULT;
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 77448ec15..cc7bd6e7c 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -280,7 +280,6 @@ void bgp_path_info_mpath_free(struct bgp_path_info_mpath **mpath)
if ((*mpath)->mp_attr)
bgp_attr_unintern(&(*mpath)->mp_attr);
XFREE(MTYPE_BGP_MPATH_INFO, *mpath);
- *mpath = NULL;
}
}
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c
index e743fdda8..f97827931 100644
--- a/bgpd/bgp_open.c
+++ b/bgpd/bgp_open.c
@@ -712,12 +712,10 @@ static int bgp_capability_hostname(struct peer *peer,
if (peer->hostname != NULL) {
XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
- peer->hostname = NULL;
}
if (peer->domainname != NULL) {
XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- peer->domainname = NULL;
}
peer->hostname = XSTRDUP(MTYPE_BGP_PEER_HOST, str);
@@ -752,7 +750,6 @@ static int bgp_capability_hostname(struct peer *peer,
if (peer->domainname != NULL) {
XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- peer->domainname = NULL;
}
peer->domainname = XSTRDUP(MTYPE_BGP_PEER_HOST, str);
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index e77194a62..02f0ecf2f 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -752,7 +752,6 @@ void bgp_notify_send_with_data(struct peer *peer, uint8_t code,
if (bgp_notify.data) {
XFREE(MTYPE_TMP, bgp_notify.data);
- bgp_notify.data = NULL;
bgp_notify.length = 0;
}
}
@@ -1745,7 +1744,6 @@ static int bgp_notify_receive(struct peer *peer, bgp_size_t size)
if (peer->notify.data) {
XFREE(MTYPE_TMP, peer->notify.data);
- peer->notify.data = NULL;
peer->notify.length = 0;
}
@@ -1796,7 +1794,6 @@ static int bgp_notify_receive(struct peer *peer, bgp_size_t size)
bgp_notify_print(peer, &bgp_notify, "received");
if (bgp_notify.data) {
XFREE(MTYPE_TMP, bgp_notify.data);
- bgp_notify.data = NULL;
bgp_notify.length = 0;
}
}
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c
index 14f5fefb2..9ced99616 100644
--- a/bgpd/bgp_pbr.c
+++ b/bgpd/bgp_pbr.c
@@ -1260,7 +1260,6 @@ void bgp_pbr_cleanup(struct bgp *bgp)
return;
bgp_pbr_reset(bgp, AFI_IP);
XFREE(MTYPE_PBR, bgp->bgp_pbr_cfg);
- bgp->bgp_pbr_cfg = NULL;
}
void bgp_pbr_init(struct bgp *bgp)
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index f7ace6aed..4b2db0514 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -234,8 +234,6 @@ void bgp_path_info_extra_free(struct bgp_path_info_extra **extra)
if ((*extra)->bgp_fs_pbr)
list_delete(&((*extra)->bgp_fs_pbr));
XFREE(MTYPE_BGP_ROUTE_EXTRA, *extra);
-
- *extra = NULL;
}
/* Get bgp_path_info extra information for the given bgp_path_info, lazy
@@ -5453,7 +5451,6 @@ static int bgp_static_set(struct vty *vty, const char *negate,
bgp_static->rmap.name);
route_map_counter_decrement(
bgp_static->rmap.map);
- bgp_static->rmap.name = NULL;
bgp_static->rmap.map = NULL;
bgp_static->valid = 0;
}
@@ -5875,7 +5872,6 @@ static int bgp_table_map_set(struct vty *vty, afi_t afi, safi_t safi,
} else {
XFREE(MTYPE_ROUTE_MAP_NAME, rmap->name);
route_map_counter_decrement(rmap->map);
- rmap->name = NULL;
rmap->map = NULL;
}
@@ -5894,7 +5890,6 @@ static int bgp_table_map_unset(struct vty *vty, afi_t afi, safi_t safi,
rmap = &bgp->table_map[afi][safi];
XFREE(MTYPE_ROUTE_MAP_NAME, rmap->name);
route_map_counter_decrement(rmap->map);
- rmap->name = NULL;
rmap->map = NULL;
if (bgp_fibupd_safi(safi))
@@ -12167,7 +12162,6 @@ static int bgp_distance_set(struct vty *vty, const char *distance_str,
/* Reset access-list configuration. */
if (bdistance->access_list) {
XFREE(MTYPE_AS_LIST, bdistance->access_list);
- bdistance->access_list = NULL;
}
if (access_list_str)
bdistance->access_list =
diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c
index 5b3eb2c71..3dbc67521 100644
--- a/bgpd/bgp_updgrp.c
+++ b/bgpd/bgp_updgrp.c
@@ -111,7 +111,6 @@ static void sync_init(struct update_subgroup *subgrp)
static void sync_delete(struct update_subgroup *subgrp)
{
XFREE(MTYPE_BGP_SYNCHRONISE, subgrp->sync);
- subgrp->sync = NULL;
if (subgrp->hash)
hash_free(subgrp->hash);
subgrp->hash = NULL;
@@ -220,7 +219,6 @@ static void conf_release(struct peer *src, afi_t afi, safi_t safi)
XFREE(MTYPE_BGP_FILTER_NAME, srcfilter->usmap.name);
XFREE(MTYPE_BGP_PEER_HOST, src->host);
- src->host = NULL;
}
static void peer2_updgrp_copy(struct update_group *updgrp, struct peer_af *paf)
@@ -735,7 +733,6 @@ static void update_group_delete(struct update_group *updgrp)
conf_release(updgrp->conf, updgrp->afi, updgrp->safi);
XFREE(MTYPE_BGP_PEER_HOST, updgrp->conf->host);
- updgrp->conf->host = NULL;
XFREE(MTYPE_BGP_PEER_IFNAME, updgrp->conf->ifname);
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index 03d5cd984..d2b8f5d79 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -1779,7 +1779,6 @@ int bgp_redistribute_unset(struct bgp *bgp, afi_t afi, int type,
/* Unset route-map. */
XFREE(MTYPE_ROUTE_MAP_NAME, red->rmap.name);
route_map_counter_decrement(red->rmap.map);
- red->rmap.name = NULL;
red->rmap.map = NULL;
/* Unset metric. */
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index d866ba7f5..0e2bbbe7c 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -1009,23 +1009,19 @@ static void peer_free(struct peer *peer)
if (peer->desc) {
XFREE(MTYPE_PEER_DESC, peer->desc);
- peer->desc = NULL;
}
/* Free allocated host character. */
if (peer->host) {
XFREE(MTYPE_BGP_PEER_HOST, peer->host);
- peer->host = NULL;
}
if (peer->domainname) {
XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- peer->domainname = NULL;
}
if (peer->ifname) {
XFREE(MTYPE_BGP_PEER_IFNAME, peer->ifname);
- peer->ifname = NULL;
}
/* Update source configuration. */
@@ -1036,7 +1032,6 @@ static void peer_free(struct peer *peer)
if (peer->update_if) {
XFREE(MTYPE_PEER_UPDATE_SOURCE, peer->update_if);
- peer->update_if = NULL;
}
XFREE(MTYPE_TMP, peer->notify.data);
@@ -1049,7 +1044,6 @@ static void peer_free(struct peer *peer)
if (peer->conf_if) {
XFREE(MTYPE_PEER_CONF_IF, peer->conf_if);
- peer->conf_if = NULL;
}
bfd_info_free(&(peer->bfd_info));
@@ -1372,7 +1366,6 @@ void peer_xfer_config(struct peer *peer_dst, struct peer *peer_src)
sockunion_free(peer_dst->update_source);
if (peer_dst->update_if) {
XFREE(MTYPE_PEER_UPDATE_SOURCE, peer_dst->update_if);
- peer_dst->update_if = NULL;
}
peer_dst->update_source =
sockunion_dup(peer_src->update_source);
@@ -2388,19 +2381,16 @@ int peer_delete(struct peer *peer)
if (filter->dlist[i].name) {
XFREE(MTYPE_BGP_FILTER_NAME,
filter->dlist[i].name);
- filter->dlist[i].name = NULL;
}
if (filter->plist[i].name) {
XFREE(MTYPE_BGP_FILTER_NAME,
filter->plist[i].name);
- filter->plist[i].name = NULL;
}
if (filter->aslist[i].name) {
XFREE(MTYPE_BGP_FILTER_NAME,
filter->aslist[i].name);
- filter->aslist[i].name = NULL;
}
}
@@ -2408,19 +2398,16 @@ int peer_delete(struct peer *peer)
if (filter->map[i].name) {
XFREE(MTYPE_BGP_FILTER_NAME,
filter->map[i].name);
- filter->map[i].name = NULL;
}
}
if (filter->usmap.name) {
XFREE(MTYPE_BGP_FILTER_NAME, filter->usmap.name);
- filter->usmap.name = NULL;
}
if (peer->default_rmap[afi][safi].name) {
XFREE(MTYPE_ROUTE_MAP_NAME,
peer->default_rmap[afi][safi].name);
- peer->default_rmap[afi][safi].name = NULL;
}
}
@@ -2429,12 +2416,10 @@ int peer_delete(struct peer *peer)
if (peer->hostname) {
XFREE(MTYPE_BGP_PEER_HOST, peer->hostname);
- peer->hostname = NULL;
}
if (peer->domainname) {
XFREE(MTYPE_BGP_PEER_HOST, peer->domainname);
- peer->domainname = NULL;
}
peer_unlock(peer); /* initial reference */
@@ -2994,7 +2979,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
XSTRDUP(MTYPE_BGP_PEER_HOST, "Static announcement");
if (bgp->peer_self->hostname != NULL) {
XFREE(MTYPE_BGP_PEER_HOST, bgp->peer_self->hostname);
- bgp->peer_self->hostname = NULL;
}
if (cmd_hostname_get())
bgp->peer_self->hostname =
@@ -3002,7 +2986,6 @@ static struct bgp *bgp_create(as_t *as, const char *name,
if (bgp->peer_self->domainname != NULL) {
XFREE(MTYPE_BGP_PEER_HOST, bgp->peer_self->domainname);
- bgp->peer_self->domainname = NULL;
}
if (cmd_domainname_get())
bgp->peer_self->domainname =
@@ -4507,8 +4490,6 @@ int peer_description_unset(struct peer *peer)
{
XFREE(MTYPE_PEER_DESC, peer->desc);
- peer->desc = NULL;
-
return 0;
}
@@ -5258,7 +5239,6 @@ void peer_interface_set(struct peer *peer, const char *str)
void peer_interface_unset(struct peer *peer)
{
XFREE(MTYPE_BGP_PEER_IFNAME, peer->ifname);
- peer->ifname = NULL;
}
/* Allow-as in. */
diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c
index 7c4f8eaa0..a9e60436c 100644
--- a/bgpd/rfapi/rfapi.c
+++ b/bgpd/rfapi/rfapi.c
@@ -1491,7 +1491,6 @@ void rfapiFreeBgpTeaOptionChain(struct bgp_tea_options *p)
if (p->value) {
XFREE(MTYPE_BGP_TEA_OPTIONS_VALUE, p->value);
- p->value = NULL;
}
XFREE(MTYPE_BGP_TEA_OPTIONS, p);
diff --git a/bgpd/rfapi/rfapi_encap_tlv.c b/bgpd/rfapi/rfapi_encap_tlv.c
index f31342e19..a7bc909c5 100644
--- a/bgpd/rfapi/rfapi_encap_tlv.c
+++ b/bgpd/rfapi/rfapi_encap_tlv.c
@@ -248,7 +248,6 @@ struct rfapi_un_option *rfapi_encap_tlv_to_un_option(struct attr *attr)
}
if (rc) {
XFREE(MTYPE_RFAPI_UN_OPTION, uo);
- uo = NULL;
}
return uo;
}
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index ece0b4b0c..9ef4e8623 100644
--- a/eigrpd/eigrp_interface.c
+++ b/eigrpd/eigrp_interface.c
@@ -121,7 +121,6 @@ int eigrp_if_delete_hook(struct interface *ifp)
eigrp_fifo_free(ei->obuf);
XFREE(MTYPE_EIGRP_IF_INFO, ifp->info);
- ifp->info = NULL;
return 0;
}
diff --git a/isisd/isis_bfd.c b/isisd/isis_bfd.c
index cf4b84179..68be9c1a9 100644
--- a/isisd/isis_bfd.c
+++ b/isisd/isis_bfd.c
@@ -59,7 +59,6 @@ static void bfd_session_free(struct bfd_session **session)
return;
XFREE(MTYPE_BFD_SESSION, *session);
- *session = NULL;
}
static bool bfd_session_same(const struct bfd_session *session, int family,
diff --git a/lib/bfd.c b/lib/bfd.c
index ffb3cbc1f..48d8914f6 100644
--- a/lib/bfd.c
+++ b/lib/bfd.c
@@ -76,7 +76,6 @@ void bfd_info_free(struct bfd_info **bfd_info)
{
if (*bfd_info) {
XFREE(MTYPE_BFD_INFO, *bfd_info);
- *bfd_info = NULL;
}
}
diff --git a/lib/command.c b/lib/command.c
index d2145d9f5..05bb66565 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -2503,8 +2503,6 @@ static void disable_log_file(void)
zlog_reset_file();
XFREE(MTYPE_HOST, host.logfile);
-
- host.logfile = NULL;
}
DEFUN (no_config_log_file,
diff --git a/lib/distribute.c b/lib/distribute.c
index 2aa6b927f..3ea60c877 100644
--- a/lib/distribute.c
+++ b/lib/distribute.c
@@ -186,7 +186,6 @@ static int distribute_list_unset(struct distribute_ctx *ctx,
return 0;
XFREE(MTYPE_DISTRIBUTE_NAME, dist->list[type]);
- dist->list[type] = NULL;
/* Apply this distribute-list to the interface. */
(ctx->distribute_delete_hook)(ctx, dist);
@@ -232,7 +231,6 @@ static int distribute_list_prefix_unset(struct distribute_ctx *ctx,
return 0;
XFREE(MTYPE_DISTRIBUTE_NAME, dist->prefix[type]);
- dist->prefix[type] = NULL;
/* Apply this distribute-list to the interface. */
(ctx->distribute_delete_hook)(ctx, dist);
diff --git a/lib/filter.c b/lib/filter.c
index 31e25d600..e7a225961 100644
--- a/lib/filter.c
+++ b/lib/filter.c
@@ -610,7 +610,6 @@ static int vty_access_list_remark_unset(struct vty *vty, afi_t afi,
if (access->remark) {
XFREE(MTYPE_TMP, access->remark);
- access->remark = NULL;
}
if (access->head == NULL && access->tail == NULL)
diff --git a/lib/if.c b/lib/if.c
index 7332dceb4..0e9471923 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -1281,7 +1281,6 @@ void if_link_params_free(struct interface *ifp)
if (ifp->link_params == NULL)
return;
XFREE(MTYPE_IF_LINK_PARAMS, ifp->link_params);
- ifp->link_params = NULL;
}
/* ----------- CLI commands ----------- */
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
index ca6f512ec..1973d40be 100644
--- a/lib/if_rmap.c
+++ b/lib/if_rmap.c
@@ -164,7 +164,6 @@ static int if_rmap_unset(struct if_rmap_ctx *ctx,
return 0;
XFREE(MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_IN]);
- if_rmap->routemap[IF_RMAP_IN] = NULL;
}
if (type == IF_RMAP_OUT) {
@@ -174,7 +173,6 @@ static int if_rmap_unset(struct if_rmap_ctx *ctx,
return 0;
XFREE(MTYPE_IF_RMAP_NAME, if_rmap->routemap[IF_RMAP_OUT]);
- if_rmap->routemap[IF_RMAP_OUT] = NULL;
}
if (ctx->if_rmap_delete_hook)
diff --git a/lib/log.c b/lib/log.c
index 798b776d0..3bb01a3f6 100644
--- a/lib/log.c
+++ b/lib/log.c
@@ -934,7 +934,6 @@ int zlog_reset_file(void)
zl->maxlvl[ZLOG_DEST_FILE] = ZLOG_DISABLED;
XFREE(MTYPE_ZLOG, zl->filename);
- zl->filename = NULL;
return 1;
}
diff --git a/lib/plist.c b/lib/plist.c
index a0976cd6b..971fc6216 100644
--- a/lib/plist.c
+++ b/lib/plist.c
@@ -496,7 +496,6 @@ static void prefix_list_trie_del(struct prefix_list *plist,
for (; depth > 0; depth--)
if (trie_table_empty(*tables[depth])) {
XFREE(MTYPE_PREFIX_LIST_TRIE, *tables[depth]);
- *tables[depth] = NULL;
}
}
@@ -1095,7 +1094,6 @@ static int vty_prefix_list_desc_unset(struct vty *vty, afi_t afi,
if (plist->desc) {
XFREE(MTYPE_TMP, plist->desc);
- plist->desc = NULL;
}
if (plist->head == NULL && plist->tail == NULL && plist->desc == NULL)
diff --git a/lib/prefix.c b/lib/prefix.c
index 806df0b4c..cb6e53b30 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -1081,7 +1081,6 @@ void prefix_free_lists(void *arg)
void prefix_free(struct prefix **p)
{
XFREE(MTYPE_PREFIX, *p);
- *p = NULL;
}
/* Utility function to convert ipv4 prefixes to Classful prefixes */
diff --git a/lib/routemap.c b/lib/routemap.c
index 14fec0283..9771288a6 100644
--- a/lib/routemap.c
+++ b/lib/routemap.c
@@ -2063,7 +2063,6 @@ static int route_map_dep_update(struct hash *dephash, const char *dep_name,
hash_free(dep->dep_rmap_hash);
XFREE(MTYPE_ROUTE_MAP_NAME, dep->dep_name);
XFREE(MTYPE_ROUTE_MAP_DEP, dep);
- dep = NULL;
}
break;
case RMAP_EVENT_SET_ADDED:
diff --git a/lib/vty.c b/lib/vty.c
index 40da8abcd..75e68c033 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -3013,12 +3013,10 @@ void vty_reset(void)
if (vty_accesslist_name) {
XFREE(MTYPE_VTY, vty_accesslist_name);
- vty_accesslist_name = NULL;
}
if (vty_ipv6_accesslist_name) {
XFREE(MTYPE_VTY, vty_ipv6_accesslist_name);
- vty_ipv6_accesslist_name = NULL;
}
}
diff --git a/nhrpd/nhrp_route.c b/nhrpd/nhrp_route.c
index cfca86a9b..a23ac3474 100644
--- a/nhrpd/nhrp_route.c
+++ b/nhrpd/nhrp_route.c
@@ -58,7 +58,6 @@ static void nhrp_route_update_put(struct route_node *rn)
if (!ri->ifp && !ri->nhrp_ifp
&& sockunion_family(&ri->via) == AF_UNSPEC) {
XFREE(MTYPE_NHRP_ROUTE, rn->info);
- rn->info = NULL;
route_unlock_node(rn);
}
route_unlock_node(rn);
diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c
index 84053b4b5..b3fdecf0e 100644
--- a/nhrpd/nhrp_shortcut.c
+++ b/nhrpd/nhrp_shortcut.c
@@ -141,7 +141,6 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s)
rn = route_node_lookup(shortcut_rib[afi], s->p);
if (rn) {
XFREE(MTYPE_NHRP_SHORTCUT, rn->info);
- rn->info = NULL;
route_unlock_node(rn);
route_unlock_node(rn);
}
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index da42a2425..40a21b37b 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -1518,12 +1518,10 @@ void ospf6_message_terminate(void)
{
if (recvbuf) {
XFREE(MTYPE_OSPF6_MESSAGE, recvbuf);
- recvbuf = NULL;
}
if (sendbuf) {
XFREE(MTYPE_OSPF6_MESSAGE, sendbuf);
- sendbuf = NULL;
}
iobuflen = 0;
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index a60af3656..6d0093534 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -141,7 +141,6 @@ ospf_external_info_add(struct ospf *ospf, uint8_t type, unsigned short instance,
ospf->vrf_id, inet_ntoa(p.prefix),
p.prefixlen, inetbuf);
XFREE(MTYPE_OSPF_EXTERNAL_INFO, rn->info);
- rn->info = NULL;
}
/* Create new External info instance. */
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 8efb32af3..3eb03f53c 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -694,7 +694,6 @@ static int ospf_if_delete_hook(struct interface *ifp)
ospf_del_if_params((struct ospf_if_params *)IF_DEF_PARAMS(ifp));
XFREE(MTYPE_OSPF_IF_INFO, ifp->info);
- ifp->info = NULL;
return rc;
}
diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c
index 4d4874060..d07cc894a 100644
--- a/ripd/rip_interface.c
+++ b/ripd/rip_interface.c
@@ -1210,7 +1210,6 @@ static int rip_interface_delete_hook(struct interface *ifp)
{
rip_interface_reset(ifp->info);
XFREE(MTYPE_RIP_INTERFACE, ifp->info);
- ifp->info = NULL;
return 0;
}
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
index 97113a180..250c7803f 100644
--- a/ripngd/ripng_interface.c
+++ b/ripngd/ripng_interface.c
@@ -913,7 +913,6 @@ static int ripng_if_new_hook(struct interface *ifp)
static int ripng_if_delete_hook(struct interface *ifp)
{
XFREE(MTYPE_RIPNG_IF, ifp->info);
- ifp->info = NULL;
return 0;
}
diff --git a/tests/lib/test_heavy_wq.c b/tests/lib/test_heavy_wq.c
index 442b8c838..cffd52ee0 100644
--- a/tests/lib/test_heavy_wq.c
+++ b/tests/lib/test_heavy_wq.c
@@ -81,7 +81,6 @@ static void slow_func_del(struct work_queue *wq, void *data)
assert(hn && hn->str);
printf("%s: %s\n", __func__, hn->str);
XFREE(MTYPE_WQ_NODE_STR, hn->str);
- hn->str = NULL;
XFREE(MTYPE_WQ_NODE, hn);
}
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 238b1d905..3a46835d1 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -1153,7 +1153,6 @@ static char *command_generator(const char *text, int state)
return matched[index++];
XFREE(MTYPE_TMP, matched);
- matched = NULL;
return NULL;
}
diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c
index bf1ba522a..17b148178 100644
--- a/zebra/zebra_dplane.c
+++ b/zebra/zebra_dplane.c
@@ -549,7 +549,6 @@ static void dplane_ctx_free(struct zebra_dplane_ctx **pctx)
}
XFREE(MTYPE_DP_CTX, *pctx);
- *pctx = NULL;
}
/*
diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c
index 732349a57..e05db5ffa 100644
--- a/zebra/zebra_nhg.c
+++ b/zebra/zebra_nhg.c
@@ -711,7 +711,6 @@ static void nhg_ctx_free(struct nhg_ctx **ctx)
done:
XFREE(MTYPE_NHG_CTX, *ctx);
- *ctx = NULL;
}
static struct nhg_ctx *nhg_ctx_init(uint32_t id, struct nexthop *nh,
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 051d7f523..6276a5d8b 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -3114,8 +3114,6 @@ static struct rib_update_ctx *rib_update_ctx_init(vrf_id_t vrf_id,
static void rib_update_ctx_fini(struct rib_update_ctx **ctx)
{
XFREE(MTYPE_RIB_UPDATE_CTX, *ctx);
-
- *ctx = NULL;
}
static int rib_update_handler(struct thread *thread)