Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5023637yba; Wed, 8 May 2019 06:47:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEj1CGPms3mnSx1zVCRP71D/fJn4mo6OUbBDh2voas1T44UHRabv616TDoJTViTdGHs1ZR X-Received: by 2002:aa7:8455:: with SMTP id r21mr49732521pfn.253.1557323275124; Wed, 08 May 2019 06:47:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557323275; cv=none; d=google.com; s=arc-20160816; b=D1UkELYmIzJNeq+pXWMdYYPWin3FpjAQTsYhtMW5TRekfDfb8P8d/3XOYNpK+WDla3 neGhQAa4VbgOWPSV6/t6olDaNGoOmePzd4kgzSqNeiEoYF0f2L0hq4W5OqBkztEICXIh P3sAHR5RYn+tRXwNVaZHkhRaU/OXZ7dUDnavELOxz1hrtRfJElxra9106ZiUJDXdzt9X ZB1g3BRzdMsLje0KZMAdfBQR3ZDxs8h3OI4yoQzIOxH8mFfqqu2/eppn8WcByhqTUokI O+UC4X4oKzOdMOj3S1tdHq5u3rfFUWAVzjDgXKBjObfrTVIAA+Z3NPGXpJs/MagByCUb hoBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=1Gcmb/6q1ATlSZWoo7s9e7oziJcs6iek54HhiQyG5jo=; b=yG6Wv/K5RA5ItBtUAHMObUIWEdrQ56bWtURd2inOjvIbACmgLZC3YWQjCQp0DcShy3 QZwxHbRba7g5B8SAmQvk9oCAjnOjMSWB9snuGiI5vgc+Xmef3xNHc7XLKRs5W5zJr1YY le7iAv+0/ubHDqcTQe2mfx1BOKaOXhTQV8Pabm4G+yOMgZG5I6MbS0YO8d+XH5xlRmfh wgIrmDF7MLp1mHgyRxrXBU09/JrmnE9FkwkgL3HJljRJKN5Uu2GMuttgFtYFG8p+R3Bn p8PG7xsBD/zaNGT7P+sGT+IIYL7yyfRC0pmmyItg7pA7RyqNyAyof2bmY3+CwmZULPxW 9DWg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d34si12890837pgd.558.2019.05.08.06.47.41; Wed, 08 May 2019 06:47:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727370AbfEHNft (ORCPT + 99 others); Wed, 8 May 2019 09:35:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58744 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbfEHNft (ORCPT ); Wed, 8 May 2019 09:35:49 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 370833078ABB for ; Wed, 8 May 2019 13:35:49 +0000 (UTC) Received: from madhat.boston.devel.redhat.com (ovpn-116-59.phx2.redhat.com [10.3.116.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id E66745C269 for ; Wed, 8 May 2019 13:35:48 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH 16/19] Removed a resource leak from mount/stropts.c Date: Wed, 8 May 2019 09:35:33 -0400 Message-Id: <20190508133536.6077-17-steved@redhat.com> In-Reply-To: <20190508133536.6077-1-steved@redhat.com> References: <20190508133536.6077-1-steved@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 08 May 2019 13:35:49 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org mount/stropts.c:986: leaked_storage: Variable "address" going out of scope leaks the storage it points to. Signed-off-by: Steve Dickson --- utils/mount/stropts.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index a093926..1bb7a73 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -983,8 +983,11 @@ static int nfs_try_mount(struct nfsmount_info *mi) } if (!nfs_append_addr_option(address->ai_addr, - address->ai_addrlen, mi->options)) + address->ai_addrlen, mi->options)) { + nfs_freeaddrinfo(address); + errno = ENOMEM; return 0; + } mi->address = address; } -- 2.20.1