]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
getaddrinfo: Release resolver context on error in gethosts [BZ #21885]
authorFlorian Weimer <fweimer@redhat.com>
Thu, 3 Aug 2017 10:33:00 +0000 (12:33 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 3 Aug 2017 10:33:00 +0000 (12:33 +0200)
ChangeLog
sysdeps/posix/getaddrinfo.c

index 4565de264435a86c0c162a80c0a5af5d453098cb..63494ae75a63705f209d51044f055d6a38c4c68e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-03  Florian Weimer  <fweimer@redhat.com>
+
+       [BZ #21885]
+       * sysdeps/posix/getaddrinfo.c (gethosts): Release resolver context
+       on memory allocation failure.
+
 2017-08-03  Alan Modra  <amodra@gmail.com>
 
        * sysdeps/powerpc/mod-tlsopt-powerpc.c: Extract from
index efa71184989900732ebc3fced4f1646b0927c727..699411cc92fc210cfba963c717638c790d063af4 100644 (file)
@@ -255,6 +255,8 @@ convert_hostent_to_gaih_addrtuple (const struct addrinfo *req,
       break;                                                                 \
     if (!scratch_buffer_grow (tmpbuf))                                       \
       {                                                                              \
+       __resolv_context_enable_inet6 (res_ctx, res_enable_inet6);            \
+       __resolv_context_put (res_ctx);                                       \
        result = -EAI_MEMORY;                                                 \
        goto free_and_return;                                                 \
       }                                                                              \