[quagga-dev,15567,16/16] vtysh: fix a memory leak in vtysh_client_execute

Message ID 1465927630-27768-16-git-send-email-chris@opensourcerouting.org
State Under Review
Headers show
Series
  • [quagga-dev,15552,01/16] zebra: fix null pointer dereference in zsend_ipv4_nexthop_lookup_mrib
Related show

Commit Message

Christian Franke June 14, 2016, 6:07 p.m.
From: Christian Franke <nobody@nowhere.ws>

buf is dynamically allocated and needs to be freed in the error handling
path too.

Signed-off-by: Christian Franke <chris@opensourcerouting.org>
---
 vtysh/vtysh.c | 1 +
 1 file changed, 1 insertion(+)

Comments

cisystem@netdef.org June 15, 2016, 1:40 a.m. | #1
Continous Integration Result: FAILED

See below for issues.
This is an EXPERIMENTAL automated CI system.
For questions and feedback, feel free to email
Martin Winter <mwinter@opensourcerouting.org>.

Patches applied :
  Patchwork 1985: http://patchwork.quagga.net/patch/1985
       [quagga-dev,15552,01/16] zebra: fix null pointer dereference in zsend_ipv4_nexthop_lookup_mrib
  Patchwork 1986: http://patchwork.quagga.net/patch/1986
       [quagga-dev,15553,02/16] bgpd: setting nexthop doesn&#39;t need inet_pton
  Patchwork 1987: http://patchwork.quagga.net/patch/1987
       [quagga-dev,15554,03/16] bgpd: check return value of zebra_interface_state_read
  Patchwork 1988: http://patchwork.quagga.net/patch/1988
       [quagga-dev,15555,04/16] bgpd: fix bgp_table_stats for mpls vpn
  Patchwork 1989: http://patchwork.quagga.net/patch/1989
       [quagga-dev,15556,05/16] bgpd: don&#39;t leak memory in community_regexp_include
  Patchwork 1990: http://patchwork.quagga.net/patch/1990
       [quagga-dev,15557,06/16] bgpd: fix off-by-one in attribute flags handling
  Patchwork 1994: http://patchwork.quagga.net/patch/1994
       [quagga-dev,15561,07/16] bgpd: fix memory leaks in show commands
  Patchwork 1991: http://patchwork.quagga.net/patch/1991
       [quagga-dev,15558,08/16] ospfd: fix double assignment in ospf_vl_set_timers
  Patchwork 1992: http://patchwork.quagga.net/patch/1992
       [quagga-dev,15559,09/16] ospf6d: don&#39;t access nexthops out of bounds
  Patchwork 1993: http://patchwork.quagga.net/patch/1993
       [quagga-dev,15560,10/16] ospf6d: fix off-by-one on display of spf reasons
  Patchwork 1995: http://patchwork.quagga.net/patch/1995
       [quagga-dev,15562,11/16] isisd: fix an error that was probably a result of copypasting
  Patchwork 1996: http://patchwork.quagga.net/patch/1996
       [quagga-dev,15563,12/16] isisd: Fix size of malloc
  Patchwork 1997: http://patchwork.quagga.net/patch/1997
       [quagga-dev,15564,13/16] pimd: don&#39;t leak original_s_route on error
  Patchwork 1998: http://patchwork.quagga.net/patch/1998
       [quagga-dev,15565,14/16] ripd: print md5 auth digest correctly
  Patchwork 1999: http://patchwork.quagga.net/patch/1999
       [quagga-dev,15566,15/16] vtysh: handle case if there is no match in &quot;write terminal $daemon&quot;
  Patchwork 2000: http://patchwork.quagga.net/patch/2000
       [quagga-dev,15567,16/16] vtysh: fix a memory leak in vtysh_client_execute
Tested on top of Git : 5f67888 (as of 20160429.234845 UTC)
CI System Testrun URL: https://ci1.netdef.org/browse/QUAGGA-QPWORK-313/


Get source and apply patch from patchwork: Failed
----------------
> Applying Patchwork patch 1985
> ------------------------------------
> Git Patch: Using "git apply" for patch 1985
> error: patch failed: zebra/zserv.c:626
> error: zebra/zserv.c: patch does not apply

Regards,
  NetDEF/OpenSourceRouting Continous Integration (CI) System

---
OpenSourceRouting.org is a project of the Network Device Education Foundation,
For more information, see www.netdef.org and www.opensourcerouting.org
For questions in regards to this CI System, contact Martin Winter, mwinter@netdef.org
Donald Sharp June 16, 2016, 1:46 p.m. | #2
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>

On Tue, Jun 14, 2016 at 2:07 PM, Christian Franke
<chris@opensourcerouting.org> wrote:
> From: Christian Franke <nobody@nowhere.ws>
>
> buf is dynamically allocated and needs to be freed in the error handling
> path too.
>
> Signed-off-by: Christian Franke <chris@opensourcerouting.org>
> ---
>  vtysh/vtysh.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
> index 625ab1c..2497f70 100644
> --- a/vtysh/vtysh.c
> +++ b/vtysh/vtysh.c
> @@ -124,6 +124,7 @@ vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
>         {
>           fprintf (stderr, ERR_WHERE_STRING \
>                    "warning - pbuf beyond buffer end.\n");
> +         XFREE(MTYPE_TMP, buf);
>           return CMD_WARNING;
>         }
>
> --
> 2.8.0
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev

Patch hide | download patch | download mbox

diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 625ab1c..2497f70 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -124,6 +124,7 @@  vtysh_client_execute (struct vtysh_client *vclient, const char *line, FILE *fp)
 	{
 	  fprintf (stderr, ERR_WHERE_STRING \
 		   "warning - pbuf beyond buffer end.\n");
+	  XFREE(MTYPE_TMP, buf);
 	  return CMD_WARNING;
 	}