On Mon, Oct 13, 2025 at 11:02:24AM +0800, Chengwen Feng wrote:
> 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 0586b3e1d0..25a79d1d6c 100644
> --- a/app/test-dma-perf/main.c
> +++ b/app/test-dma-perf/main.c
> @@ -480,6 +480,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;
> }
>
Do we not need a matching free() for each strdup call? (Same comment applies
to next patch too.)
- [PATCH v3 00/13] bugfix and refactor of dma-perf Chengwen Feng
- [PATCH v3 06/13] app/dma-perf: add more global confi... Chengwen Feng
- [PATCH v3 09/13] app/dma-perf: refactor benchmark fu... Chengwen Feng
- [PATCH v3 12/13] app/dma-perf: fix on-flight DMA whe... Chengwen Feng
- [PATCH v3 07/13] app/dma-perf: remove invalid or red... Chengwen Feng
- [PATCH v3 02/13] app/dma-perf: add global section fo... Chengwen Feng
- [PATCH v3 11/13] app/dma-perf: fix segment fault wit... Chengwen Feng
- [PATCH v3 01/13] app/dma-perf: fix use-after-free Chengwen Feng
- Re: [PATCH v3 01/13] app/dma-perf: fix use-after... Bruce Richardson
- Re: [PATCH v3 01/13] app/dma-perf: fix use-a... fengchengwen
- [PATCH v3 03/13] app/dma-perf: use argparse lib to p... Chengwen Feng
- [PATCH v3 08/13] app/dma-perf: refactor load config ... Chengwen Feng
- [PATCH v3 13/13] app/dma-perf: fix wrong stage to st... Chengwen Feng
- [PATCH v3 10/13] app/dma-perf: support specific erro... Chengwen Feng
- [PATCH v3 05/13] app/dma-perf: support list DMA devi... Chengwen Feng
- [PATCH v3 04/13] app/dma-perf: refactor output csv Chengwen Feng

