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]

[commit] Compilation regression [Re: [RFA] Fix memory leak in gdbserver/hostio.c]


On Sun, 27 Feb 2011 22:50:11 +0100, Michael Snyder wrote:
> 2011-02-27  Michael Snyder  <msnyder@vmware.com>
> 
> 	* hostio.c (require_data): Free malloc memory before returning
> 	error.
> 
> --- hostio.c	1 Jan 2011 15:33:24 -0000	1.11
> +++ hostio.c	27 Feb 2011 21:48:00 -0000
> @@ -134,7 +134,10 @@ require_data (char *p, int p_len, char *
> +      xfree (data);

 = http://sourceware.org/ml/gdb-cvs/2011-02/msg00220.html

hostio.c: In function ‘require_data’:
hostio.c:138:7: error: implicit declaration of function ‘xfree’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors
make: *** [hostio.o] Error 1

It could not build as -Werror is there by default, could it?

Checked in the fix.


Regards,
Jan


http://sourceware.org/ml/gdb-cvs/2011-02/msg00227.html

--- src/gdb/gdbserver/ChangeLog	2011/02/28 01:46:50	1.459
+++ src/gdb/gdbserver/ChangeLog	2011/02/28 04:20:29	1.460
@@ -1,3 +1,7 @@
+2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* hostio.c (require_data): Use free, not xfree.
+
 2011-02-27  Michael Snyder  <msnyder@vmware.com>
 
 	* server.c (handle_query): Discard unused value.
--- src/gdb/gdbserver/hostio.c	2011/02/27 23:32:04	1.12
+++ src/gdb/gdbserver/hostio.c	2011/02/28 04:20:30	1.13
@@ -135,7 +135,7 @@
 
   if (escaped)
     {
-      xfree (data);
+      free (data);
       return -1;
     }
 


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