mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 16:26:10 +00:00
*: don't null after XFREE; XFREE does this itself
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
84e1268340
commit
b3ba5dc7fe
@ -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. */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 =
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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. */
|
||||
|
20
bgpd/bgpd.c
20
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. */
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
1
lib/if.c
1
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 ----------- */
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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 */
|
||||
|
@ -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:
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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. */
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -1153,7 +1153,6 @@ static char *command_generator(const char *text, int state)
|
||||
return matched[index++];
|
||||
|
||||
XFREE(MTYPE_TMP, matched);
|
||||
matched = NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -549,7 +549,6 @@ static void dplane_ctx_free(struct zebra_dplane_ctx **pctx)
|
||||
}
|
||||
|
||||
XFREE(MTYPE_DP_CTX, *pctx);
|
||||
*pctx = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user