summaryrefslogtreecommitdiffstats
path: root/pbrd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2023-08-20 21:32:21 +0200
committerGitHub <noreply@github.com>2023-08-20 21:32:21 +0200
commit19ad3e2770c5b4a6235194dd58dd444dcd1cf82c (patch)
tree117754f31398764e255f7d436eeaf64447dc7dd7 /pbrd
parentMerge pull request #14216 from LabNConsulting/ziemba-coverity-pbr-230816 (diff)
parentpbrd: Correct Handling of Sequence Deletion (diff)
downloadfrr-19ad3e2770c5b4a6235194dd58dd444dcd1cf82c.tar.xz
frr-19ad3e2770c5b4a6235194dd58dd444dcd1cf82c.zip
Merge pull request #14226 from Keelan10/fix-pbrd-leak
pbrd: Correct Handling of Sequence Deletion
Diffstat (limited to 'pbrd')
-rw-r--r--pbrd/pbr_map.c2
-rw-r--r--pbrd/pbr_map.h2
-rw-r--r--pbrd/pbr_vty.c1
3 files changed, 4 insertions, 1 deletions
diff --git a/pbrd/pbr_map.c b/pbrd/pbr_map.c
index 6b81e1058..774e7ee85 100644
--- a/pbrd/pbr_map.c
+++ b/pbrd/pbr_map.c
@@ -62,7 +62,7 @@ static int pbr_map_sequence_compare(const struct pbr_map_sequence *pbrms1,
return 1;
}
-static void pbr_map_sequence_delete(struct pbr_map_sequence *pbrms)
+void pbr_map_sequence_delete(struct pbr_map_sequence *pbrms)
{
XFREE(MTYPE_TMP, pbrms->internal_nhg_name);
diff --git a/pbrd/pbr_map.h b/pbrd/pbr_map.h
index 61577e407..9fb674bd6 100644
--- a/pbrd/pbr_map.h
+++ b/pbrd/pbr_map.h
@@ -251,6 +251,8 @@ extern void pbr_map_policy_install(const char *name);
extern void pbr_map_policy_delete(struct pbr_map *pbrm,
struct pbr_map_interface *pmi);
+extern void pbr_map_sequence_delete(struct pbr_map_sequence *pbrms);
+
extern void pbr_map_check_vrf_nh_group_change(const char *nh_group,
struct pbr_vrf *pbr_vrf,
uint32_t old_vrf_id);
diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c
index 3dbb0b958..1f1e42218 100644
--- a/pbrd/pbr_vty.c
+++ b/pbrd/pbr_vty.c
@@ -123,6 +123,7 @@ DEFUN_NOSH(no_pbr_map,
continue;
pbr_map_delete(pbrms);
+ pbr_map_sequence_delete(pbrms);
}
return CMD_SUCCESS;