[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r14057 - in /fsf/trunk/libc: ChangeLog nscd/nscd_getserv_r.c sysdeps/unix/sysv/linux/dl-osinfo.h



Author: eglibc
Date: Wed Jun  1 00:03:13 2011
New Revision: 14057

Log:
Import glibc-mainline for 2011-06-01

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/nscd/nscd_getserv_r.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Jun  1 00:03:13 2011
@@ -1,3 +1,13 @@
+2011-05-31  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix
+	typo.
+
+2011-05-31  Andreas Schwab  <schwab@xxxxxxxxxx>
+
+	* nscd/nscd_getserv_r.c (nscd_getserv_r): Don't free non-malloced
+	memory.  Use alloca_account.  Fix memory leak when retrying.
+
 2011-05-31  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	* version.h (RELEASE): Bump for 2.14 release.

Modified: fsf/trunk/libc/nscd/nscd_getserv_r.c
==============================================================================
--- fsf/trunk/libc/nscd/nscd_getserv_r.c (original)
+++ fsf/trunk/libc/nscd/nscd_getserv_r.c Wed Jun  1 00:03:13 2011
@@ -124,6 +124,7 @@
 	  s_name = (char *) (&found->data[0].servdata + 1);
 	  serv_resp = found->data[0].servdata;
 	  s_proto = s_name + serv_resp.s_name_len;
+	  alloca_aliases_len = 1;
 	  aliases_len = (uint32_t *) (s_proto + serv_resp.s_proto_len);
 	  aliases_list = ((char *) aliases_len
 			  + serv_resp.s_aliases_cnt * sizeof (uint32_t));
@@ -154,7 +155,9 @@
 				     + (serv_resp.s_aliases_cnt
 					* sizeof (uint32_t)));
 	      if (alloca_aliases_len)
-		tmp = __alloca (serv_resp.s_aliases_cnt * sizeof (uint32_t));
+		tmp = alloca_account (serv_resp.s_aliases_cnt
+				      * sizeof (uint32_t),
+				      alloca_used);
 	      else
 		{
 		  tmp = malloc (serv_resp.s_aliases_cnt * sizeof (uint32_t));
@@ -249,8 +252,9 @@
 				     + (serv_resp.s_aliases_cnt
 					* sizeof (uint32_t)));
 	      if (alloca_aliases_len)
-		aliases_len = alloca (serv_resp.s_aliases_cnt
-				      * sizeof (uint32_t));
+		aliases_len = alloca_account (serv_resp.s_aliases_cnt
+					      * sizeof (uint32_t),
+					      alloca_used);
 	      else
 		{
 		  aliases_len = malloc (serv_resp.s_aliases_cnt
@@ -368,7 +372,11 @@
 	}
 
       if (retval != -1)
-	goto retry;
+	{
+	  if (!alloca_aliases_len)
+	    free (aliases_len);
+	  goto retry;
+	}
     }
 
   if (!alloca_aliases_len)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/dl-osinfo.h Wed Jun  1 00:03:13 2011
@@ -81,7 +81,7 @@
 	{
 	  ssize_t reslen = read_not_cancel (fd, ret.bytes + 1, filllen);
 	  close_not_cancel_no_status (fd);
-	  if (reslen == (ssize_) filllen)
+	  if (reslen == (ssize_t) filllen)
 	    return ret.num;
 	}
 # endif