summaryrefslogtreecommitdiff
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorajs <ajs>2005-01-29 18:19:13 +0000
committerajs <ajs>2005-01-29 18:19:13 +0000
commit3b8b1855038afde448993e5a56955e9b7a4d99c2 (patch)
tree5378ad7cc9d2fdb42558044833036e347ca1277e /bgpd/bgp_vty.c
parent4460e7a4cf3dadcd9f06e4b519ba7be2cc936c0a (diff)
2005-01-29 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* buffer.h: Fix comment on buffer_getstr to reflect that it now uses XMALLOC. * buffer.c: (buffer_getstr) Use XMALLOC(MTYPE_TMP) instead of malloc. * filter.c: (access_list_remark,ipv6_access_list_remark) Use argv_concat instead of buffer_getstr. * if.c: (interface_desc) Use argv_concat instead of buffer_getstr. * plist.c: (ip_prefix_list_description,ipv6_prefix_list_description) Use argv_concat instead of buffer_getstr. * bgp_filter.c: (ip_as_path,no_ip_as_path) Use argv_concat instead of buffer_getstr. * bgp_route.c: (bgp_show_regexp) Fix memory leak: need to free string returned by buffer_getstr. (bgp_show_community) Must use XFREE instead of free on string returned by buffer_getstr. * bgp_routemap.c: (set_community) Must use XFREE instead of free on string returned by buffer_getstr. * bgp_vty.c: (neighbor_description) Use argv_concat instead of buffer_getstr.
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 027b8ca9..5968f68c 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -28,6 +28,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "stream.h"
#include "thread.h"
#include "log.h"
+#include "memory.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_attr.h"
@@ -2576,9 +2577,7 @@ DEFUN (neighbor_description,
"Up to 80 characters describing this neighbor\n")
{
struct peer *peer;
- struct buffer *b;
char *str;
- int i;
peer = peer_and_group_lookup_vty (vty, argv[0]);
if (! peer)
@@ -2587,21 +2586,11 @@ DEFUN (neighbor_description,
if (argc == 1)
return CMD_SUCCESS;
- /* Make string from buffer. This function should be provided by
- buffer.c. */
- b = buffer_new (1024);
- for (i = 1; i < argc; i++)
- {
- buffer_putstr (b, argv[i]);
- buffer_putc (b, ' ');
- }
- buffer_putc (b, '\0');
- str = buffer_getstr (b);
- buffer_free (b);
+ str = argv_concat(argv, argc, 1);
peer_description_set (peer, str);
- free (str);
+ XFREE (MTYPE_TMP, str);
return CMD_SUCCESS;
}