@@ -984,7 +984,12 @@ static void bgp_pbr_match_entry_hash_free(void *arg)
984
984
bgp_pbr_match_entry_free (bpme );
985
985
}
986
986
987
- static void bgp_pbr_match_free (void * arg )
987
+ static void bgp_pbr_match_free (struct bgp_pbr_match * bpm )
988
+ {
989
+ XFREE (MTYPE_PBR_MATCH , bpm );
990
+ }
991
+
992
+ static void bgp_pbr_match_hash_free (void * arg )
988
993
{
989
994
struct bgp_pbr_match * bpm ;
990
995
@@ -1009,7 +1014,7 @@ static void bgp_pbr_match_free(void *arg)
1009
1014
}
1010
1015
hash_clean_and_free (& bpm -> entry_hash , NULL );
1011
1016
1012
- XFREE ( MTYPE_PBR_MATCH , bpm );
1017
+ bgp_pbr_match_free ( bpm );
1013
1018
}
1014
1019
1015
1020
static void * bgp_pbr_match_alloc_intern (void * arg )
@@ -1377,7 +1382,7 @@ struct bgp_pbr_match *bgp_pbr_match_iptable_lookup(vrf_id_t vrf_id,
1377
1382
1378
1383
void bgp_pbr_cleanup (struct bgp * bgp )
1379
1384
{
1380
- hash_clean_and_free (& bgp -> pbr_match_hash , bgp_pbr_match_free );
1385
+ hash_clean_and_free (& bgp -> pbr_match_hash , bgp_pbr_match_hash_free );
1381
1386
hash_clean_and_free (& bgp -> pbr_rule_hash , bgp_pbr_rule_free );
1382
1387
hash_clean_and_free (& bgp -> pbr_action_hash , bgp_pbr_action_free );
1383
1388
@@ -1706,6 +1711,7 @@ static void bgp_pbr_flush_entry(struct bgp *bgp, struct bgp_pbr_action *bpa,
1706
1711
bpm -> action = NULL ;
1707
1712
}
1708
1713
hash_release (bgp -> pbr_match_hash , bpm );
1714
+ bgp_pbr_match_free (bpm );
1709
1715
/* XXX release pbr_match_action if not used
1710
1716
* note that drop does not need to call send_pbr_action
1711
1717
*/
0 commit comments