From patchwork Mon Nov 5 13:08:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 30027 Received: (qmail 26182 invoked by alias); 5 Nov 2018 13:08:38 -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 26163 invoked by uid 89); 5 Nov 2018 13:08:38 -0000 Authentication-Results: sourceware.org; auth=none 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, SPF_PASS autolearn=ham version=3.3.2 spammy=creation, gpg X-HELO: mx1.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] libanl: properly cleanup if first helper thread creation failed (bug 22927) X-Yow: It's the RINSE CYCLE!! They've ALL IGNORED the RINSE CYCLE!! Date: Mon, 05 Nov 2018 14:08:34 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 [BZ #22927] * resolv/gai_misc.c (__gai_enqueue_request): Don't crash if creating the first helper thread failed. --- resolv/gai_misc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resolv/gai_misc.c b/resolv/gai_misc.c index e7c3b63cc5..80a2cff835 100644 --- a/resolv/gai_misc.c +++ b/resolv/gai_misc.c @@ -261,8 +261,11 @@ __gai_enqueue_request (struct gaicb *gaicbp) /* We cannot create a thread in the moment and there is also no thread running. This is a problem. `errno' is set to EAGAIN if this is only a temporary problem. */ - assert (lastp->next == newp); - lastp->next = NULL; + assert (requests == newp || lastp->next == newp); + if (lastp != NULL) + lastp->next = NULL; + else + requests = NULL; requests_tail = lastp; newp->next = freelist;