Skip to content

Commit

Permalink
app/dumpcap: verify strdup return
Browse files Browse the repository at this point in the history
[ upstream commit 6bb5ffe3ea9a5ad41848c19c2787df42de2a3cab ]

Add verify strdup return value logic.

Fixes: cbb4414 ("app/dumpcap: add new packet capture application")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
  • Loading branch information
fengchengwen authored and kevintraynor committed Mar 5, 2024
1 parent b8422c5 commit 59b5633
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/dumpcap/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ static void dpdk_init(void)
for (i = 1; i < RTE_DIM(args); i++)
eal_argv[i] = strdup(args[i]);

for (i = 0; i < (unsigned int)eal_argc; i++) {
if (eal_argv[i] == NULL)
rte_panic("No memory\n");
}

if (rte_eal_init(eal_argc, eal_argv) < 0)
rte_exit(EXIT_FAILURE, "EAL init failed: is primary process running?\n");

Expand Down

0 comments on commit 59b5633

Please sign in to comment.