]> 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 11:59:17 +0000 (13:59 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 3 Aug 2017 11:59:17 +0000 (13:59 +0200)
(cherry picked from commit 964263bb8d650f1681665c55704fb01a8e725621)

ChangeLog
NEWS
sysdeps/posix/getaddrinfo.c

index 8dbfc7eaffad18cf01256f5b2c908437442665ce..28ce9c847992adc77c5853f213b8215da06edc64 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-02  Siddhesh Poyarekar  <siddhesh@sourceware.org>
 
        * version.h (RELEASE): Set to "stable"
diff --git a/NEWS b/NEWS
index 8295f20c0a5dcaddef512d5769b45b7bda902ee4..9a645796580d904d20f2af5e7edceeccc7e1e6b7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,12 @@ See the end for copying conditions.
 Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
 using `glibc' in the "product" field.
 \f
+Version 2.26.1
+
+The following bugs are resolved with this release:
+
+  [21885] getaddrinfo: Release resolver context on error in gethosts
+\f
 Version 2.26
 
 Major new features:
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;                                                 \
       }                                                                              \