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: 915455 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-92597-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="cjNt4qTX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40msks2VtDz9s3G for ; Thu, 17 May 2018 23:35:48 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=TR7lNHIDuNdeVxK1wh3tb4s3kQiQH Lx60LwhV+AFW8UbaNZ2H711qfi+5k+yRhGvFGg0RWU5VIfVAsHSNqqqRls3QfZyz mQ4oew/g9zILAfgB+k7k2T8jfP40ivUdlT/uUOWy4FiFMxp+oWwjA7IXjmxxmAXy w5RTMFSJtsgDBM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=ldTIbVe3WJPKK85pTbLQKhGJ2ns=; b=cjN t4qTXGlmTn7EDEsVQaOFRjskvApMgMNhrjeDunmQckc81okGCUE8NWYt1buIiWcP dcFEYqv/gR82s8xT9bcsuhU6a3Z8lvBdOUy4SUFJXuGoxMl90D5kEOA7ipJ0+87+ H4MWySLq0v1CJc5+dLJBWOLMm8vzE0eyBF4v53Gk= 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; }