tests/eal: fix memory leak
authorOwen Hilyard <ohilyard@iol.unh.edu>
Wed, 16 Jun 2021 16:24:52 +0000 (12:24 -0400)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 24 Jun 2021 13:34:45 +0000 (15:34 +0200)
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>
app/test/test_eal_flags.c

index 932fbe3..b4880ee 100644 (file)
@@ -124,6 +124,7 @@ process_hugefiles(const char * prefix, enum hugepage_action action)
                        case HUGEPAGE_CHECK_EXISTS:
                                {
                                        /* file exists, return */
+                                       closedir(hugepage_dir);
                                        result = 1;
                                        goto end;
                                }