]> git.proxmox.com Git - mirror_frr.git/commitdiff
*: don't null after XFREE; XFREE does this itself
authorQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 3 Feb 2020 16:22:13 +0000 (11:22 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Mon, 3 Feb 2020 16:22:13 +0000 (11:22 -0500)
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
43 files changed:
babeld/babeld.c
bfdd/control.c
bgpd/bgp_advertise.c
bgpd/bgp_community.c
bgpd/bgp_dump.c
bgpd/bgp_filter.c
bgpd/bgp_lcommunity.c
bgpd/bgp_main.c
bgpd/bgp_mpath.c
bgpd/bgp_open.c
bgpd/bgp_packet.c
bgpd/bgp_pbr.c
bgpd/bgp_route.c
bgpd/bgp_updgrp.c
bgpd/bgp_zebra.c
bgpd/bgpd.c
bgpd/rfapi/rfapi.c
bgpd/rfapi/rfapi_encap_tlv.c
eigrpd/eigrp_interface.c
isisd/isis_bfd.c
lib/bfd.c
lib/command.c
lib/distribute.c
lib/filter.c
lib/if.c
lib/if_rmap.c
lib/log.c
lib/plist.c
lib/prefix.c
lib/routemap.c
lib/vty.c
nhrpd/nhrp_route.c
nhrpd/nhrp_shortcut.c
ospf6d/ospf6_message.c
ospfd/ospf_asbr.c
ospfd/ospf_interface.c
ripd/rip_interface.c
ripngd/ripng_interface.c
tests/lib/test_heavy_wq.c
vtysh/vtysh.c
zebra/zebra_dplane.c
zebra/zebra_nhg.c
zebra/zebra_rib.c

index 6ad004a4a41a011f738df0b6e70daf2b10999a6d..71bab2fcbfe1c4642069cd4640e9d96bc9a7232f 100644 (file)
@@ -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. */
index cf821f45b88f472f81c1711fe4725a74ddc67486..ae6f5a3e793165aea49e13a592d8781e4a32c720 100644 (file)
@@ -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;
 }
index 76a65f7f04b50fdaefb131f3d289da87b4acfbf2..8d1c83cf5f4650d9655e486d1fd691e434598ff0 100644 (file)
@@ -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;
        }
 }
index 432c922ea56dd537c8849a06b146a01e1930adc8..496d7ed2b121a9152ed78b8bdc0187efed8c45c9 100644 (file)
@@ -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;
                }
index f850cb49cf9979b0cce53a03edb67c7a33e72fef..e9711f5b90d531dae766d9f44d3cae15eb5c3a2e 100644 (file)
@@ -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;
index f08f9b2fb759fba023121801b9a4cd5238c6601a..a3c86c7eaf0ac17ca9c56c38960c1bbcc42fbc4a 100644 (file)
@@ -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);
 }
index 674686b3c449d7df7da366203fbdaeaccc877622..f889693001a658543ad55dadddd98283c4b4073d 100644 (file)
@@ -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;
                }
index fab2a584c0a314463c30977d8edf9c1a120d2e15..898c35e4ef3f6551119868efbfab42198c028a26 100644 (file)
@@ -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;
index 77448ec15d3477375149fbb5f717497b55f65701..cc7bd6e7c70938c6bcafa13d86bbb2ffbe92193c 100644 (file)
@@ -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;
        }
 }
 
index e743fdda8f2c9ed9300346e7c1f3658a069e4a8e..f97827931fa940f422fdf304c3068e81c0c242e1 100644 (file)
@@ -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);
index e77194a6244b70b5909f41efe757c2ee568f4eb9..02f0ecf2fd9bf1bf79b6e2158ca91a0583d43b4a 100644 (file)
@@ -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;
                }
        }
index 14f5fefb2020955cf544a93448bd857a8e1e3c62..9ced99616b435059cc1290e390afb24f83ccbc20 100644 (file)
@@ -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)
index f7ace6aede628045406cd51da1645fbcd5eefac8..4b2db05143e744a2394a8b18eeafa1f60a5aaaeb 100644 (file)
@@ -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 =
index 5b3eb2c719b730226f6b59777e8b95bf758f77c9..3dbc67521212299b40baa42a952242bcec60b569 100644 (file)
@@ -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);
 
index 03d5cd984fd6c3dddad93ab5cfa37fc5349e6712..d2b8f5d79031795d234c1f96de25d42f03f2ada2 100644 (file)
@@ -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. */
index d866ba7f5d28fd2942f8155bdf6dd19d71287a01..0e2bbbe7cbdf78b0fcfe79ea69f96ef87132994e 100644 (file)
@@ -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.  */
index 7c4f8eaa012633d364087d4fb9e3d39aff196ee7..a9e60436c947c4b8239f0f6042066485bd0cf6a9 100644 (file)
@@ -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);
 
index f31342e1925902a4db52f10d85f018b702cefa78..a7bc909c589161dd576560dfdd9d4a9bed530073 100644 (file)
@@ -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;
 }
index ece0b4b0c4c4a4aeecadfc2415b6c056acdd01b4..9ef4e8623702ca3e46d92e5862711d51c9aeecef 100644 (file)
@@ -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;
 }
index cf4b841798748959659b4bad758c7663e4d685b9..68be9c1a995660d1222145f96367485a932cd8ec 100644 (file)
@@ -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,
index ffb3cbc1f86f044da7a9cf4d0b1d0131561a3b6f..48d8914f618fc18e09cc674781d4c167793a0fac 100644 (file)
--- 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;
        }
 }
 
index d2145d9f5a03becf2282605bdf3c74b88cac31f9..05bb66565744f4e9293b27c1646c1ce292f29825 100644 (file)
@@ -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,
index 2aa6b927fb01afcc3f1f64f82ca8f2e6afc59857..3ea60c8772df3911dbd2d1a80ece546215182624 100644 (file)
@@ -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);
index 31e25d600136920c74076d4be64fb0459aae309a..e7a225961f493db0d66718eab76b81aa98556dae 100644 (file)
@@ -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)
index 7332dceb45e89bf7d336a18029ae073349072108..0e9471923f5fc0d368f74b8d08046c5aafdd5910 100644 (file)
--- 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 ----------- */
index ca6f512ec6d6f2d85f2a4d2ff76bd0231128743a..1973d40be4ec97e223e71f59528b8aa34323a532 100644 (file)
@@ -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)
index 798b776d0074f479dda58a1f2a4263d403ea21af..3bb01a3f6ef2322170b1a59046dabd6875e0a5e4 100644 (file)
--- 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;
 }
index a0976cd6bdd976ed29da62c8c72a0461795d07c0..971fc621645290d942011443cd1e3e7ca4f4ede2 100644 (file)
@@ -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)
index 806df0b4c697be8583ed4cfd15e48a26141032ae..cb6e53b30539f1cd7d6cdb8041f8fe0dcdfa561e 100644 (file)
@@ -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 */
index 14fec0283cafebcb98f9e6559f3b61a5a0172afd..9771288a6507b6163e3f323121b95da339ab5f1e 100644 (file)
@@ -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:
index 40da8abcd74b575a63fe13a2b40fc0b59a9d0dde..75e68c0330b89674a4443ff073db4c4f0f7dd0ae 100644 (file)
--- 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;
        }
 }
 
index cfca86a9bf7897f60e527be99304c931f77deb20..a23ac347454e9b0d7f741aa01aab5e946c760bdf 100644 (file)
@@ -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);
index 84053b4b5d68ee8c31551297c5a322f50292376f..b3fdecf0ec8c21303c1c459f45837c6e4b95cc59 100644 (file)
@@ -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);
        }
index da42a242522c068a46202e7bf32641e60fe9889e..40a21b37b3758f94d8a062883b5e71a3593e3c59 100644 (file)
@@ -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;
index a60af36564f6974ff5c9bb756ab398f069f0e439..6d00935347d60eaca8a5770369679795ffeb44b7 100644 (file)
@@ -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. */
index 8efb32af37ad61e44b8416f185c7e3edcc53574f..3eb03f53c4df28f8a2504f782979373092f43cfb 100644 (file)
@@ -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;
 }
index 4d4874060675a117a6370ef97f23d747f96e4719..d07cc894a5bb8f86a8199771478556109c6a08e1 100644 (file)
@@ -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;
 }
 
index 97113a180f22b010fed718d1eaf70852a9e45068..250c7803f7dc4f8b5e26b00467fa77a7784e197b 100644 (file)
@@ -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;
 }
 
index 442b8c83801f54ad6273fd030ea1a053f2115687..cffd52ee021190fade2442c551938a46522aaf1d 100644 (file)
@@ -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);
 }
 
index 238b1d905bf10ad9eab8060bc8aa40bcf84623eb..3a46835d1afe1f549054f6eb3cfdf142b767a51a 100644 (file)
@@ -1153,7 +1153,6 @@ static char *command_generator(const char *text, int state)
                return matched[index++];
 
        XFREE(MTYPE_TMP, matched);
-       matched = NULL;
 
        return NULL;
 }
index bf1ba522a37fb6ead27900b5e5a34ec2f3bc37b7..17b148178f8a0d786a394329fe0058b7ea69abd8 100644 (file)
@@ -549,7 +549,6 @@ static void dplane_ctx_free(struct zebra_dplane_ctx **pctx)
        }
 
        XFREE(MTYPE_DP_CTX, *pctx);
-       *pctx = NULL;
 }
 
 /*
index 732349a570621f96c7e95e4bd480a5e0fb40c5b6..e05db5ffae1a484dc1a5d7f818f8444a896d3f99 100644 (file)
@@ -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,
index 051d7f523135888ddb331a6254c6a8d82e45d5d8..6276a5d8b30961ba022d48430a2babfaf74302b0 100644 (file)
@@ -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)