The test_case->eal_args was pointer the entry of cfgfile, it will be
used later, but the cfgfile was closed in load_configs(). This commit
fix it by using strdup.

Fixes: 623dc9364dc6 ("app/dma-perf: introduce DMA performance test")
Cc: [email protected]

Signed-off-by: Chengwen Feng <[email protected]>
Acked-by: Vamsi Attunuru <[email protected]>
---
 app/test-dma-perf/main.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-dma-perf/main.c b/app/test-dma-perf/main.c
index 4201cc02a0..64057788c3 100644
--- a/app/test-dma-perf/main.c
+++ b/app/test-dma-perf/main.c
@@ -489,6 +489,8 @@ load_configs(const char *path)
                                        section_name, "test_seconds"));
 
                test_case->eal_args = rte_cfgfile_get_entry(cfgfile, 
section_name, "eal_args");
+               if (test_case->eal_args != NULL)
+                       test_case->eal_args = strdup(test_case->eal_args);
                test_case->is_valid = true;
        }
 
-- 
2.17.1

Reply via email to