From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [119.145.14.64]) by dpdk.org (Postfix) with ESMTP id 03C2A593E for ; Tue, 19 Aug 2014 05:48:08 +0200 (CEST) Received: from 172.24.2.119 (EHLO szxeml462-hub.china.huawei.com) ([172.24.2.119]) by szxrg01-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CAM08375; Tue, 19 Aug 2014 11:51:31 +0800 (CST) Received: from localhost (10.177.25.235) by szxeml462-hub.china.huawei.com (10.82.67.205) with Microsoft SMTP Server id 14.3.158.1; Tue, 19 Aug 2014 11:51:22 +0800 From: To: Date: Tue, 19 Aug 2014 11:51:11 +0800 Message-ID: <1408420271-11568-1-git-send-email-zhang.zhangkun@huawei.com> X-Mailer: git-send-email 1.7.3.1.msysgit.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.25.235] X-CFilter-Loop: Reflected Cc: zhangkun Subject: [dpdk-dev] [PATCH] there are some memory leak about Dir operator X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 03:48:10 -0000 From: zhangkun Signed-off-by: zhangkun --- lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c index b72a205..d784b7c 100644 --- a/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c +++ b/lib/librte_eal/linuxapp/eal/eal_hugepage_info.c @@ -311,12 +311,14 @@ eal_hugepage_info_init(void) /* if blocking lock failed */ if (flock(hpi->lock_descriptor, LOCK_EX) == -1) { RTE_LOG(CRIT, EAL, "Failed to lock hugepage directory!\n"); + closedir(dir); return -1; } /* clear out the hugepages dir from unused pages */ - if (clear_hugedir(hpi->hugedir) == -1) + if (clear_hugedir(hpi->hugedir) == -1) { + closedir(dir); return -1; - + } /* for now, put all pages into socket 0, * later they will be sorted */ hpi->num_pages[0] = get_num_hugepages(dirent->d_name); -- 1.7.3.1.msysgit.0