From patchwork Wed Aug 9 15:23:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 22043 Received: (qmail 35269 invoked by alias); 9 Aug 2017 15:23:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 35254 invoked by uid 89); 9 Aug 2017 15:23:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8A8DFB5256 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Wed, 09 Aug 2017 17:23:34 +0200 To: libc-alpha@sourceware.org Subject: [PATCH] nss: Call __resolv_context_put before early return in get*_r [BZ #21932] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170809152334.71E2D40164AE0@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) This corrects an oversight introduce in commit 352f4ff9a268b81ef5d4b2413f582565806e4790 (resolv: Introduce struct resolv_context). 2017-08-09 Florian Weimer * nss/getXXbyYY_r.c (REENTRANT_NAME): Call __resolv_context_put before early return. diff --git a/nss/getXXbyYY_r.c b/nss/getXXbyYY_r.c index 6c547ea..bce80e0 100644 --- a/nss/getXXbyYY_r.c +++ b/nss/getXXbyYY_r.c @@ -234,6 +234,9 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, H_ERRNO_VAR_P)) { case -1: +# ifdef NEED__RES + __resolv_context_put (res_ctx); +# endif return errno; case 1: #ifdef NEED_H_ERRNO @@ -253,7 +256,12 @@ INTERNAL (REENTRANT_NAME) (ADD_PARAMS, LOOKUP_TYPE *resbuf, char *buffer, nscd_status = NSCD_NAME (ADD_VARIABLES, resbuf, buffer, buflen, result H_ERRNO_VAR); if (nscd_status >= 0) - return nscd_status; + { +# ifdef NEED__RES + __resolv_context_put (res_ctx); +# endif + return nscd_status; + } } #endif