From: Donatas Abraitis Date: Mon, 27 Feb 2023 14:26:32 +0000 (+0200) Subject: bgpd: Free temporary memory after using argv_concat() X-Git-Tag: docker/8.5.3~23^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=refs%2Fpull%2F14001%2Fhead;p=mirror%2Ffrr.git bgpd: Free temporary memory after using argv_concat() Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index b960cd3499..826ca9dd3e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8795,7 +8795,7 @@ DEFPY(neighbor_path_attribute_discard, { struct peer *peer; int idx = 0; - const char *discard_attrs = NULL; + char *discard_attrs = NULL; peer = peer_and_group_lookup_vty(vty, neighbor); if (!peer) @@ -8807,6 +8807,8 @@ DEFPY(neighbor_path_attribute_discard, bgp_path_attribute_discard_vty(vty, peer, discard_attrs, true); + XFREE(MTYPE_TMP, discard_attrs); + return CMD_SUCCESS; } @@ -8822,7 +8824,7 @@ DEFPY(no_neighbor_path_attribute_discard, { struct peer *peer; int idx = 0; - const char *discard_attrs = NULL; + char *discard_attrs = NULL; peer = peer_and_group_lookup_vty(vty, neighbor); if (!peer) @@ -8834,6 +8836,8 @@ DEFPY(no_neighbor_path_attribute_discard, bgp_path_attribute_discard_vty(vty, peer, discard_attrs, false); + XFREE(MTYPE_TMP, discard_attrs); + return CMD_SUCCESS; }