Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [obv] fix memory leaks in gdbserver
@ 2009-05-07 23:29 Doug Evans
  0 siblings, 0 replies; only message in thread
From: Doug Evans @ 2009-05-07 23:29 UTC (permalink / raw)
  To: gdb-patches

Hi.

Checked in under the obvious rule.

2009-05-07  Doug Evans  <dje@google.com>

	* linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
	(regsets_store_inferior_registers): Ditto.

Index: linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.99
diff -u -p -u -p -r1.99 linux-low.c
--- linux-low.c	6 May 2009 17:32:59 -0000	1.99
+++ linux-low.c	7 May 2009 23:23:35 -0000
@@ -2092,6 +2092,7 @@ regsets_fetch_inferior_registers ()
 	      /* If we get EIO on a regset, do not try it again for
 		 this process.  */
 	      disabled_regsets[regset - target_regsets] = 1;
+	      free (buf);
 	      continue;
 	    }
 	  else
@@ -2106,6 +2107,7 @@ regsets_fetch_inferior_registers ()
 	saw_general_regs = 1;
       regset->store_function (buf);
       regset ++;
+      free (buf);
     }
   if (saw_general_regs)
     return 0;
@@ -2165,6 +2167,7 @@ regsets_store_inferior_registers ()
 	      /* If we get EIO on a regset, do not try it again for
 		 this process.  */
 	      disabled_regsets[regset - target_regsets] = 1;
+	      free (buf);
 	      continue;
 	    }
 	  else if (errno == ESRCH)
@@ -2173,6 +2176,7 @@ regsets_store_inferior_registers ()
 		 already gone, in which case we simply ignore attempts
 		 to change its registers.  See also the related
 		 comment in linux_resume_one_lwp.  */
+	      free (buf);
 	      return 0;
 	    }
 	  else


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-07 23:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-07 23:29 [obv] fix memory leaks in gdbserver Doug Evans

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