From patchwork Thu May 17 13:35:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Schwab X-Patchwork-Id: 27315 Received: (qmail 47783 invoked by alias); 17 May 2018 13:35:43 -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 47773 invoked by uid 89); 17 May 2018 13:35:42 -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, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] Remove unneded setting of errno after malloc failure X-Yow: Yow! And then we could sit on the hoods of cars at stop lights! Date: Thu, 17 May 2018 15:35:39 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 The errno value has alread been set by malloc. * resolv/res_send.c (__res_context_send): Don't set errno when returning error after malloc failure. --- resolv/res_send.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resolv/res_send.c b/resolv/res_send.c index 9e9541789b..947ebf5212 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -472,10 +472,7 @@ __res_context_send (struct resolv_context *ctx, sizeof (struct sockaddr_in6) - sizeof (struct sockaddr_in)); else - { - __set_errno (ENOMEM); - return -1; - } + return -1; } EXT(statp).nscount = statp->nscount; }