eal: fix leak on hotplug parsing error
authorGaetan Rivet <gaetan.rivet@6wind.com>
Thu, 3 Aug 2017 12:34:31 +0000 (14:34 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 3 Aug 2017 20:08:46 +0000 (22:08 +0200)
commit7b681637d26eb91c1253c03e3d0268a7e3e29b66
tree47180a83d015e92d9db418b40985ca43c8ab7f8b
parent3054036f054a7486ae1979ce18d32c6e3d057b26
eal: fix leak on hotplug parsing error

If rte_eal_devargs_parse fails, the rte_devargs has not yet been inserted
in the global list. When jumping to err_devarg, the removal fails and it
is not properly freed.

Free the allocated rte_devargs if its removal failed.

Coverity issue: 158658
Fixes: 7e8b26650146 ("eal: fix hotplug add / remove")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
lib/librte_eal/common/eal_common_dev.c