eal/linux: fix memory leak in uevent handling
authorYunjian Wang <wangyunjian@huawei.com>
Sat, 23 May 2020 10:52:21 +0000 (18:52 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Tue, 20 Oct 2020 14:01:37 +0000 (16:01 +0200)
commit01072d52affac0f7fb6b8a5c8dd98015c4cef4c3
tree5621a37dfefdeee46640bc750f9b1303c74e9665
parent59440fbabfbcfae350e0efa6f47201b5cf0bd625
eal/linux: fix memory leak in uevent handling

When the memory for uevent.devname is allocated in dev_uev_parse(). It
is not freed when parse the subsystem layer fails in dev_uev_parse().
Before return, it is also not freed in dev_uev_handler(). These cause a
memory leak.

Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
lib/librte_eal/linux/eal_dev.c