From patchwork Mon Mar 4 22:39:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2214661 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 72D41DF2F2 for ; Mon, 4 Mar 2013 21:40:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932603Ab3CDVkd (ORCPT ); Mon, 4 Mar 2013 16:40:33 -0500 Received: from nat-pool-rdu.redhat.com ([66.187.233.202]:49498 "EHLO bp-05.lab.msp.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932228Ab3CDVkb (ORCPT ); Mon, 4 Mar 2013 16:40:31 -0500 Received: by bp-05.lab.msp.redhat.com (Postfix, from userid 0) id A47701E0965; Mon, 4 Mar 2013 16:40:07 -0600 (CST) From: Eric Sandeen To: linux-btrfs@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 01/14] btrfs-progs: close fd on cmd_subvol_list return Date: Mon, 4 Mar 2013 16:39:51 -0600 Message-Id: <1362436804-16766-2-git-send-email-sandeen@redhat.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1362436804-16766-1-git-send-email-sandeen@redhat.com> References: <1362436804-16766-1-git-send-email-sandeen@redhat.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org stops an fd leak that Coverity found. Signed-off-by: Eric Sandeen --- cmds-subvolume.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/cmds-subvolume.c b/cmds-subvolume.c index 461eed9..a13a58d 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -464,6 +464,8 @@ static int cmd_subvol_list(int argc, char **argv) !is_list_all && !is_only_in_path, NULL); out: + if (fd != -1) + close(fd); if (filter_set) btrfs_list_free_filter_set(filter_set); if (comparer_set)