[dpdk-dev] [PATCH] tests/test_eal_flags: fix memory leak

Subsystems: the rest

4 messages, 2 authors, 2021-06-24 · open the first message on its own page

[dpdk-dev] [PATCH] tests/test_eal_flags: fix memory leak

From: <hidden>
Date: 2021-06-16 16:24:58

From: Owen Hilyard <redacted>

The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.

Signed-off-by: Owen Hilyard <redacted>
---
 app/test/test_eal_flags.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
index 932fbe3d0..0c1e0fb21 100644
--- a/app/test/test_eal_flags.c
+++ b/app/test/test_eal_flags.c
@@ -125,6 +125,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)
 				{
 					/* file exists, return */
 					result = 1;
+					closedir(hugepage_dir);
 					goto end;
 				}
 				break;
-- 
2.30.2

Re: [dpdk-dev] [PATCH] tests/test_eal_flags: fix memory leak

From: David Marchand <hidden>
Date: 2021-06-16 16:37:18

On Wed, Jun 16, 2021 at 6:26 PM [off-list ref] wrote:
From: Owen Hilyard <redacted>

The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.

Signed-off-by: Owen Hilyard <redacted>
Reviewed-by: David Marchand <redacted>


-- 
David Marchand

Re: [dpdk-dev] [PATCH] tests/test_eal_flags: fix memory leak

From: David Marchand <hidden>
Date: 2021-06-16 16:50:57

On Wed, Jun 16, 2021 at 6:37 PM David Marchand
[off-list ref] wrote:
On Wed, Jun 16, 2021 at 6:26 PM [off-list ref] wrote:
quoted
From: Owen Hilyard <redacted>

The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.
Just forgot to ask for a Fixes: tag.
I guess this is:
Fixes: 45f1b6e8680a ("app: add new tests on eal flags")

I will add it when applying.

-- 
David Marchand

Re: [dpdk-dev] [PATCH] tests/test_eal_flags: fix memory leak

From: David Marchand <hidden>
Date: 2021-06-24 13:26:52

On Wed, Jun 16, 2021 at 6:26 PM [off-list ref] wrote:
From: Owen Hilyard <redacted>

The directory steam was not closed when the hugepage action was
HUGEPAGE_CHECK_EXISTS. This caused a memory leak in some parts of
the unit tests.
Fixes: 45f1b6e8680a ("app: add new tests on eal flags")
Cc: stable@dpdk.org

Signed-off-by: Owen Hilyard <redacted>
Reviewed-by: David Marchand <redacted>

Applied, thanks.


-- 
David Marchand
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help