1 From 302434688d925134065498b4a5574f6ee6bfb9fd Mon Sep 17 00:00:00 2001
2 From: Florian Weimer <fweimer@redhat.com>
3 Date: Thu, 10 Aug 2017 09:10:36 +0200
4 Subject: [PATCH 06] nss: Call __resolv_context_put before early return in
7 This corrects an oversight introduced in commit
8 352f4ff9a268b81ef5d4b2413f582565806e4790 (resolv: Introduce struct
11 (cherry picked from commit 3016149819268b14660f791b971910ccc2cc13e5)
15 nss/getXXbyYY_r.c | 10 +++++++++-
16 3 files changed, 16 insertions(+), 1 deletion(-)
18 diff --git a/ChangeLog b/ChangeLog
19 index 459062cc20..3127648626 100644
23 +2017-08-09 Florian Weimer <fweimer@redhat.com>
26 + * nss/getXXbyYY_r.c (REENTRANT_NAME): Call __resolv_context_put
27 + before early return.
29 2017-08-09 Adhemerval Zanella <adhemerval.zanella@linaro.org>
32 diff --git a/NEWS b/NEWS
33 index 9a64579658..ec6cf34122 100644
36 @@ -10,6 +10,7 @@ Version 2.26.1
37 The following bugs are resolved with this release:
39 [21885] getaddrinfo: Release resolver context on error in gethosts
40 + [21932] Unpaired __resolv_context_get in generic get*_r implementation
44 diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c
45 index 6c547ea1ca..bce80e05dd 100644
46 --- a/nss/getXXbyYY_r.c
47 +++ b/nss/getXXbyYY_r.c
48 @@ -234,6 +234,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
53 + __resolv_context_put (res_ctx);
58 @@ -253,7 +256,12 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer,
59 nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen, result
65 + __resolv_context_put (res_ctx);