From 3b8b1855038afde448993e5a56955e9b7a4d99c2 Mon Sep 17 00:00:00 2001 From: ajs Date: Sat, 29 Jan 2005 18:19:13 +0000 Subject: 2005-01-29 Andrew J. Schorr * 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. --- lib/if.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lib/if.c') diff --git a/lib/if.c b/lib/if.c index c7ced18e..7385ff6e 100644 --- a/lib/if.c +++ b/lib/if.c @@ -453,27 +453,15 @@ DEFUN (interface_desc, "Interface specific description\n" "Characters describing this interface\n") { - int i; struct interface *ifp; - struct buffer *b; if (argc == 0) return CMD_SUCCESS; ifp = vty->index; if (ifp->desc) - XFREE (0, ifp->desc); - - b = buffer_new (1024); - for (i = 0; i < argc; i++) - { - buffer_putstr (b, argv[i]); - buffer_putc (b, ' '); - } - buffer_putc (b, '\0'); - - ifp->desc = buffer_getstr (b); - buffer_free (b); + XFREE (MTYPE_TMP, ifp->desc); + ifp->desc = argv_concat(argv, argc, 0); return CMD_SUCCESS; } -- cgit v1.2.1