]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Free temporary memory after using argv_concat()
authorDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 27 Feb 2023 14:26:32 +0000 (16:26 +0200)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Mon, 27 Feb 2023 14:53:28 +0000 (16:53 +0200)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_vty.c

index cf9a05b198f582dbb7dfe5f10c925c65c7335ca8..a1e9a9a8a94b1e976bf6c15379afd59ccb837b21 100644 (file)
@@ -8893,7 +8893,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)
@@ -8905,6 +8905,8 @@ DEFPY(neighbor_path_attribute_discard,
 
        bgp_path_attribute_discard_vty(vty, peer, discard_attrs, true);
 
+       XFREE(MTYPE_TMP, discard_attrs);
+
        return CMD_SUCCESS;
 }
 
@@ -8920,7 +8922,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)
@@ -8932,6 +8934,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;
 }
 
@@ -8946,7 +8950,7 @@ DEFPY(neighbor_path_attribute_treat_as_withdraw,
 {
        struct peer *peer;
        int idx = 0;
-       const char *withdraw_attrs = NULL;
+       char *withdraw_attrs = NULL;
 
        peer = peer_and_group_lookup_vty(vty, neighbor);
        if (!peer)
@@ -8958,6 +8962,8 @@ DEFPY(neighbor_path_attribute_treat_as_withdraw,
 
        bgp_path_attribute_withdraw_vty(vty, peer, withdraw_attrs, true);
 
+       XFREE(MTYPE_TMP, withdraw_attrs);
+
        return CMD_SUCCESS;
 }
 
@@ -8973,7 +8979,7 @@ DEFPY(no_neighbor_path_attribute_treat_as_withdraw,
 {
        struct peer *peer;
        int idx = 0;
-       const char *withdraw_attrs = NULL;
+       char *withdraw_attrs = NULL;
 
        peer = peer_and_group_lookup_vty(vty, neighbor);
        if (!peer)
@@ -8985,6 +8991,8 @@ DEFPY(no_neighbor_path_attribute_treat_as_withdraw,
 
        bgp_path_attribute_withdraw_vty(vty, peer, withdraw_attrs, false);
 
+       XFREE(MTYPE_TMP, withdraw_attrs);
+
        return CMD_SUCCESS;
 }