tests/test_eal_flags: fix memory leak
Checks
Commit Message
From: Owen Hilyard <ohilyard@iol.unh.edu>
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 <ohilyard@iol.unh.edu>
---
app/test/test_eal_flags.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Wed, Jun 16, 2021 at 6:26 PM <ohilyard@iol.unh.edu> wrote:
>
> From: Owen Hilyard <ohilyard@iol.unh.edu>
>
> 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 <ohilyard@iol.unh.edu>
Reviewed-by: David Marchand <david.marchand@redhat.com>
On Wed, Jun 16, 2021 at 6:37 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> On Wed, Jun 16, 2021 at 6:26 PM <ohilyard@iol.unh.edu> wrote:
> >
> > From: Owen Hilyard <ohilyard@iol.unh.edu>
> >
> > 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.
On Wed, Jun 16, 2021 at 6:26 PM <ohilyard@iol.unh.edu> wrote:
>
> From: Owen Hilyard <ohilyard@iol.unh.edu>
>
> 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 <ohilyard@iol.unh.edu>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Applied, thanks.
@@ -125,6 +125,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)
{
/* file exists, return */
result = 1;
+ closedir(hugepage_dir);
goto end;
}
break;