This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[ob] Fix a memory leak from my qSupported patch


Noticed while merging the patch to another branch.  Tested, committed as
obvious.

-- 
Daniel Jacobowitz
CodeSourcery

2006-07-04  Daniel Jacobowitz  <dan@codesourcery.com>

	* remote.c (init_remote_state): Use xrealloc instead of xmalloc.

Index: gdb/remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.217
diff -u -p -r1.217 remote.c
--- gdb/remote.c	22 Jun 2006 14:06:37 -0000	1.217
+++ gdb/remote.c	4 Jul 2006 13:31:10 -0000
@@ -334,7 +334,7 @@ init_remote_state (struct gdbarch *gdbar
   if (rs->buf_size < rsa->remote_packet_size)
     {
       rs->buf_size = 2 * rsa->remote_packet_size;
-      rs->buf = xmalloc (rs->buf_size);
+      rs->buf = xrealloc (rs->buf, rs->buf_size);
     }
 
   return rsa;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]