Fix memory leak in getaddrinfo

This commit is contained in:
Ulrich Drepper 2011-06-13 08:31:50 -04:00
parent decd4e50b6
commit 3154bfb8c7
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-06-10 Andreas Schwab <schwab@redhat.com>
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix logic allocating
tmpbuf.
2011-06-10 Roland McGrath <roland@hack.frob.com>
* Makerules (shlib.lds): Fail if the linker script comes out empty.

View File

@ -821,7 +821,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
size_t tmpbuflen = 1024;
malloc_tmpbuf = !__libc_use_alloca (alloca_used + tmpbuflen);
assert (tmpbuf == NULL);
if (malloc_tmpbuf)
if (!malloc_tmpbuf)
tmpbuf = alloca_account (tmpbuflen, alloca_used);
else
{