diff options
author | ajs <ajs> | 2005-01-29 18:19:13 +0000 |
---|---|---|
committer | ajs <ajs> | 2005-01-29 18:19:13 +0000 |
commit | 3b8b1855038afde448993e5a56955e9b7a4d99c2 (patch) | |
tree | 5378ad7cc9d2fdb42558044833036e347ca1277e /lib/filter.c | |
parent | 4460e7a4cf3dadcd9f06e4b519ba7be2cc936c0a (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 'lib/filter.c')
-rw-r--r-- | lib/filter.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/lib/filter.c b/lib/filter.c index 9817c07d..0dd7a775 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -1359,8 +1359,6 @@ DEFUN (access_list_remark, "Comment up to 100 characters\n") { struct access_list *access; - struct buffer *b; - int i; access = access_list_get (AFI_IP, argv[0]); @@ -1369,19 +1367,7 @@ DEFUN (access_list_remark, XFREE (MTYPE_TMP, access->remark); access->remark = NULL; } - - /* Below is remark get codes. */ - b = buffer_new (1024); - for (i = 1; i < argc; i++) - { - buffer_putstr (b, argv[i]); - buffer_putc (b, ' '); - } - buffer_putc (b, '\0'); - - access->remark = buffer_getstr (b); - - buffer_free (b); + access->remark = argv_concat(argv, argc, 1); return CMD_SUCCESS; } @@ -1541,8 +1527,6 @@ DEFUN (ipv6_access_list_remark, "Comment up to 100 characters\n") { struct access_list *access; - struct buffer *b; - int i; access = access_list_get (AFI_IP6, argv[0]); @@ -1551,19 +1535,7 @@ DEFUN (ipv6_access_list_remark, XFREE (MTYPE_TMP, access->remark); access->remark = NULL; } - - /* Below is remark get codes. */ - b = buffer_new (1024); - for (i = 1; i < argc; i++) - { - buffer_putstr (b, argv[i]); - buffer_putc (b, ' '); - } - buffer_putc (b, '\0'); - - access->remark = buffer_getstr (b); - - buffer_free (b); + access->remark = argv_concat(argv, argc, 1); return CMD_SUCCESS; } |