GNU C Library master sources branch, master, updated. glibc-2.12-68-g23d101d

roland@sourceware.org roland@sourceware.org
Wed Jul 21 02:28:00 GMT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  23d101d8eea76469b41c12b10a8e8ed13cf66bc6 (commit)
      from  5dbc3b6cc0b759bf4b22d851ccb9cbf3e3cbc6ef (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=23d101d8eea76469b41c12b10a8e8ed13cf66bc6

commit 23d101d8eea76469b41c12b10a8e8ed13cf66bc6
Author: Emilio Pozuelo Monfort <pochu27@gmail.com>
Date:   Tue Jul 20 19:19:34 2010 -0700

    Hurd: fix sendmsg memory leak in error paths

diff --git a/ChangeLog b/ChangeLog
index de7f38f..fa670c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 	ld.so.cache was broken.  With it, there is no way to disable dsocaps
 	like LD_HWCAP_MASK can disable hwcaps.
 
+2010-06-02  Emilio Pozuelo Monfort  <pochu27@gmail.com>
+
+	* sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Fix memory leaks.
+
 2010-07-16  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/x86_64/multiarch/strstr.c: Rewrite to avoid indirect function
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index a9d1c8c..118fd59 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -109,14 +109,22 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags)
 	     and talk to it with the ifsock protocol.  */
 	  file_t file = __file_name_lookup (addr->sun_path, 0, 0);
 	  if (file == MACH_PORT_NULL)
-	    return -1;
+	    {
+	      if (dealloc)
+		__vm_deallocate (__mach_task_self (), data.addr, len);
+	      return -1;
+	    }
 	  err = __ifsock_getsockaddr (file, &aport);
 	  __mach_port_deallocate (__mach_task_self (), file);
 	  if (err == MIG_BAD_ID || err == EOPNOTSUPP)
 	    /* The file did not grok the ifsock protocol.  */
 	    err = ENOTSOCK;
 	  if (err)
-	    return __hurd_fail (err);
+	    {
+	      if (dealloc)
+		__vm_deallocate (__mach_task_self (), data.addr, len);
+	      return __hurd_fail (err);
+	    }
 	}
       else
 	err = EIEIO;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                   |    4 ++++
 sysdeps/mach/hurd/sendmsg.c |   12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources



More information about the Glibc-cvs mailing list