]> 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)
committerUlrich Drepper <drepper@gmail.com>
Mon, 13 Jun 2011 12:31:50 +0000 (08:31 -0400)
ChangeLog
sysdeps/posix/getaddrinfo.c

index 604619f2093350f8e8e77238f00ca2a562faba9c..50a35a3aef7090016930188a1c07249ea64212db 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-10  Roland McGrath  <roland@hack.frob.com>
 
        * Makerules (shlib.lds): Fail if the linker script comes out empty.
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
            {