1 commit c8fc0c91695b1c7003c7170861274161f9224817
2 Author: Ulrich Drepper <drepper@gmail.com>
3 Date: Tue May 31 08:45:44 2011 -0400
5 Don't free non-malloced memory and fix memory leak
7 diff --git a/ChangeLog b/ChangeLog
8 index 3a6abda..eee3d1b 100644
12 +2011-05-31 Andreas Schwab <schwab@redhat.com>
14 + * nscd/nscd_getserv_r.c (nscd_getserv_r): Don't free non-malloced
15 + memory. Use alloca_account. Fix memory leak when retrying.
17 2011-05-31 Ulrich Drepper <drepper@gmail.com>
19 * version.h (RELEASE): Bump for 2.14 release.
20 diff --git a/nscd/nscd_getserv_r.c b/nscd/nscd_getserv_r.c
21 index de96a57..f9ef056 100644
22 --- a/nscd/nscd_getserv_r.c
23 +++ b/nscd/nscd_getserv_r.c
24 @@ -124,6 +124,7 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
25 s_name = (char *) (&found->data[0].servdata + 1);
26 serv_resp = found->data[0].servdata;
27 s_proto = s_name + serv_resp.s_name_len;
28 + alloca_aliases_len = 1;
29 aliases_len = (uint32_t *) (s_proto + serv_resp.s_proto_len);
30 aliases_list = ((char *) aliases_len
31 + serv_resp.s_aliases_cnt * sizeof (uint32_t));
32 @@ -154,7 +155,9 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
33 + (serv_resp.s_aliases_cnt
34 * sizeof (uint32_t)));
35 if (alloca_aliases_len)
36 - tmp = __alloca (serv_resp.s_aliases_cnt * sizeof (uint32_t));
37 + tmp = alloca_account (serv_resp.s_aliases_cnt
38 + * sizeof (uint32_t),
42 tmp = malloc (serv_resp.s_aliases_cnt * sizeof (uint32_t));
43 @@ -249,8 +252,9 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
44 + (serv_resp.s_aliases_cnt
45 * sizeof (uint32_t)));
46 if (alloca_aliases_len)
47 - aliases_len = alloca (serv_resp.s_aliases_cnt
48 - * sizeof (uint32_t));
49 + aliases_len = alloca_account (serv_resp.s_aliases_cnt
50 + * sizeof (uint32_t),
54 aliases_len = malloc (serv_resp.s_aliases_cnt
55 @@ -368,7 +372,11 @@ nscd_getserv_r (const char *crit, size_t critlen, const char *proto,
61 + if (!alloca_aliases_len)
67 if (!alloca_aliases_len)
68 commit 8c29731192565b9c917d6b97db78dcd302283df8
69 Author: Ulrich Drepper <drepper@gmail.com>
70 Date: Tue May 31 14:23:01 2011 -0400
72 Fix typo in stack guard setup code for old kernels
74 diff --git a/ChangeLog b/ChangeLog
75 index eee3d1b..2aca74a 100644
79 +2011-05-31 Ulrich Drepper <drepper@gmail.com>
81 + * sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard): Fix
84 2011-05-31 Andreas Schwab <schwab@redhat.com>
86 * nscd/nscd_getserv_r.c (nscd_getserv_r): Don't free non-malloced
87 diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
88 index eb7fedc..28fce4f 100644
89 --- a/sysdeps/unix/sysv/linux/dl-osinfo.h
90 +++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
91 @@ -81,7 +81,7 @@ _dl_setup_stack_chk_guard (void *dl_random)
93 ssize_t reslen = read_not_cancel (fd, ret.bytes + 1, filllen);
94 close_not_cancel_no_status (fd);
95 - if (reslen == (ssize_) filllen)
96 + if (reslen == (ssize_t) filllen)
100 ;2011-06-10 Andreas Schwab <schwab@redhat.com>
102 ; * sysdeps/posix/getaddrinfo.c (gaih_inet): Fix logic allocating
105 diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
106 index 1e017b2..469abe2 100644
107 --- a/sysdeps/posix/getaddrinfo.c
108 +++ b/sysdeps/posix/getaddrinfo.c
109 @@ -821,7 +821,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
110 size_t tmpbuflen = 1024;
111 malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
112 assert (tmpbuf == NULL);
114 + if (!malloc_tmpbuf)
115 tmpbuf = alloca_account (tmpbuflen, alloca_used);