This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Compilation regression [Re: [RFA] Fix memory leak in gdbserver/hostio.c]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Michael Snyder <msnyder at vmware dot com>
- Cc: Pedro Alves <pedro at codesourcery dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, "drow at false dot org" <drow at false dot org>
- Date: Mon, 28 Feb 2011 05:22:52 +0100
- Subject: [commit] Compilation regression [Re: [RFA] Fix memory leak in gdbserver/hostio.c]
- References: <4D699B2E.3020107@vmware.com> <201102271705.43466.pedro@codesourcery.com> <4D6AC713.10800@vmware.com>
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;
}