Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5023440yba; Wed, 8 May 2019 06:47:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxHc+M3XMZi5nu8B/pbLfIU4/h98aW/x3gc2HfAoTwl0cWXmWR/l7rGd7E48FNBS1Po2/DD X-Received: by 2002:a63:785:: with SMTP id 127mr5550731pgh.230.1557323265163; Wed, 08 May 2019 06:47:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557323265; cv=none; d=google.com; s=arc-20160816; b=0b69iYDTE0MQnnNzpD2S/oybcP2RY5DTTo7qsy8YeIChRrc27Gnit0VoEr1ovjQkUh AgESsgyhRY12PpoXtd24fxrvEOYxjKjqPi2rmFMFfY7sfQjqFTOBQMZnp9q0J3H2jeVI LsJJckMkbXe828htWeLjKodfOn111HFq+0OzALWygnnhNkwSOxtZzab7Y3lXKyhild+3 H/10UcDlVt19gw4DSkIVnDPqUdB0h1cAk3sdAom/gu4w5AfeVNAAqa/x7+gHPmqZt1Mi uWPc1tMdhoHmSA3tv9RWWUMF+fZQ1FGiq9tOCPCX4jOYvDEgQM8dgTkcBuG6P6qwAz30 66zw== 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=6Zu90VqQCzfNXo5mCsoTXNH6yb+HkUA6d7JibI5EX6E=; b=pQnDArT1+KR9Bgn+iLqe5Bs486D5NDq6roXx1S4JyNkujWJVyPskPW/RDwKs3eg9HN o0KEPyFx7KknEfx9VAtm6z4+VcxT7UcG8lq5eEoBo6/UHjqwml3/xMTQwDK6ANa9eClx 2LwkB9T0WF3f327yyb9s5do7KK9xtybsleyYY9CMl/bW8o5L6M1Ip6yN1uJPb0bJRoUi o5/guMAdL8YeOlqyxL5ZWVLjiQt9SEQLk+AizBrlHaUe5WOQ6eeZ5nUQK+N9Q6H9NlL0 tIXiD3sVzxFYjH3533qzPzeO+Xz8cIg24o1WEDuJ3axKuIkxDvt66hUBBRuoeDrDoaXl +8OA== 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 c4si22960984pgm.186.2019.05.08.06.47.26; Wed, 08 May 2019 06:47:45 -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 S1726534AbfEHNfl (ORCPT + 99 others); Wed, 8 May 2019 09:35:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726762AbfEHNfk (ORCPT ); Wed, 8 May 2019 09:35:40 -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 9F6E33088B77 for ; Wed, 8 May 2019 13:35:40 +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 5A9611724D for ; Wed, 8 May 2019 13:35:40 +0000 (UTC) From: Steve Dickson To: Linux NFS Mailing list Subject: [PATCH 03/19] Removed a resource leak from nfs/mydaemon.c Date: Wed, 8 May 2019 09:35:20 -0400 Message-Id: <20190508133536.6077-4-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.42]); Wed, 08 May 2019 13:35:40 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org nfs/mydaemon.c:130: leaked_handle: Handle variable "tempfd" going out of scope leaks the handle. Signed-off-by: Steve Dickson --- support/nfs/mydaemon.c | 1 + 1 file changed, 1 insertion(+) diff --git a/support/nfs/mydaemon.c b/support/nfs/mydaemon.c index 343e80b..d1cf08d 100644 --- a/support/nfs/mydaemon.c +++ b/support/nfs/mydaemon.c @@ -123,6 +123,7 @@ daemon_init(bool fg) dup2(tempfd, 0); dup2(tempfd, 1); dup2(tempfd, 2); + close(tempfd); closelog(); dup2(pipefds[1], 3); pipefds[1] = 3; -- 2.20.1