]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix memory leak in getaddrinfo
authorUlrich Drepper <drepper@gmail.com>
Mon, 13 Jun 2011 12:31:50 +0000 (08:31 -0400)
committerAndreas Schwab <schwab@redhat.com>
Tue, 14 Jun 2011 11:14:41 +0000 (13:14 +0200)
(cherry picked from commit 3154bfb8c7fb84fbf7ecdc787752b395579d2ac7)

ChangeLog
sysdeps/posix/getaddrinfo.c

index 2826e829642044a78997e6b43df816ca3b9518ea..db9d5863d405322026d7ffc916da1b9b3e3fc8cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-06-10  Andreas Schwab  <schwab@redhat.com>
+
+       * sysdeps/posix/getaddrinfo.c (gaih_inet): Fix logic allocating
+       tmpbuf.
+
 2011-06-07  David S. Miller  <davem@davemloft.net>
 
        * sysdeps/sparc/sparc32/dl-irel.h (elf_irela): Pass dl_hwcap to
index 1e017b2ed6bb4a16a9cafa081d0851fa546dbd71..469abe22decccb924204246bc474d1b59decafde 100644 (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
            {