Skip to content

Commit

Permalink
app/pdump: verify strdup return
Browse files Browse the repository at this point in the history
[ upstream commit 32e1cb918d4bbe94c5da8d0888ce29fac1f4dbb4 ]

Add verify strdup return value logic.

Fixes: caa7028 ("app/pdump: add tool for packet capturing")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
  • Loading branch information
fengchengwen authored and kevintraynor committed Mar 5, 2024
1 parent 59b5633 commit 268ceff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/pdump/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ parse_device_id(const char *key __rte_unused, const char *value,
struct pdump_tuples *pt = extra_args;

pt->device_id = strdup(value);
if (pt->device_id == NULL)
return -1;

pt->dump_by_type = DEVICE_ID;

return 0;
Expand Down

0 comments on commit 268ceff

Please sign in to comment.