Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix memory leak in gdbserver/hostio.c
@ 2011-02-27  0:40 Michael Snyder
  2011-02-27 17:10 ` Pedro Alves
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Snyder @ 2011-02-27  0:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: drow

[-- Attachment #1: Type: text/plain, Size: 20 bytes --]

Found by coverity.


[-- Attachment #2: hostio.txt --]
[-- Type: text/plain, Size: 610 bytes --]

2011-02-26  Michael Snyder  <msnyder@vmware.com>

	* hostio.c (handle_pwrite): Free alloced buffer on early return.

Index: hostio.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/hostio.c,v
retrieving revision 1.11
diff -u -p -u -p -r1.11 hostio.c
--- hostio.c	1 Jan 2011 15:33:24 -0000	1.11
+++ hostio.c	27 Feb 2011 00:27:20 -0000
@@ -367,6 +367,7 @@ handle_pwrite (char *own_buf, int packet
       || require_data (p, packet_len - (p - own_buf), &data, &len))
     {
       hostio_packet_error (own_buf);
+      free (data);
       return;
     }
 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-28 15:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-27  0:40 [RFA] Fix memory leak in gdbserver/hostio.c Michael Snyder
2011-02-27 17:10 ` Pedro Alves
2011-02-27 21:57   ` Michael Snyder
2011-02-27 23:29     ` Pedro Alves
2011-02-28  4:39     ` [commit] Compilation regression [Re: [RFA] Fix memory leak in gdbserver/hostio.c] Jan Kratochvil
2011-02-28 16:00       ` Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox