From patchwork Wed Sep 6 13:37:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 810607 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-84253-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="iLoSe3mE"; 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 3xnPlb4vSBz9sNV for ; Wed, 6 Sep 2017 23:37:31 +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:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= FNXcwcCHLFlietBkRZCMNCnOd1SMwZNg6MCUYIF5eIoGzdVe/r1jB0R0Q+AH2x2w iuGIAm5eNXimEjwNXZ5HLM+zS2td4PDkt+NblPc/9gfwa1PzH0XDMO97/elg/x3o 1BFhX/82y1moOAGYvUc3V2DT2i/MZ7/LBd9+Mi0qGBE= 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:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=2dJAUd MPZrHx/WRtH8ge9GLA/PU=; b=iLoSe3mENErE761l6kiFXnDCjWCgav0rZuFJ6C AbHDROwNnQW9oLyKn4ds0d6mpJD0DptAfc7g8vlzkPGozsJKoD2RM23NTQ0XDi1u iZ8tEoHtVBh2p5DlCHCFjpsyQvpz0TnvGFu7RgDBn/ou0RnJTkU33rktMH9tFNTW dBoH0= Received: (qmail 93366 invoked by alias); 6 Sep 2017 13:37:26 -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 93355 invoked by uid 89); 6 Sep 2017 13:37:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, 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 B3018883C6 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Wed, 06 Sep 2017 15:37:22 +0200 To: libc-alpha@sourceware.org Subject: [PATCH COMMITTED] resolv: __resolv_conf_attach must not free passed conf object [BZ #22096] User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Message-Id: <20170906133722.9AC8140240833@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 2017-09-06 Florian Weimer [BZ #22096] * resolv/resolv_conf.c (__resolv_conf_attach): Do not free conf in case of failure to obtain the global conf object. diff --git a/resolv/resolv_conf.c b/resolv/resolv_conf.c index f391d30c27..e0f296d02e 100644 --- a/resolv/resolv_conf.c +++ b/resolv/resolv_conf.c @@ -600,10 +600,7 @@ __resolv_conf_attach (struct __res_state *resp, struct resolv_conf *conf) struct resolv_conf_global *global_copy = get_locked_global (); if (global_copy == NULL) - { - free (conf); - return false; - } + return false; /* Try to find an unused index in the array. */ size_t index;