mem: fix potential resource leak on alloc
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 16 Apr 2018 15:37:03 +0000 (16:37 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 27 Apr 2018 21:42:40 +0000 (23:42 +0200)
commit8dfb09dee47b78463af75d343b03e93f8324c6e4
treefe90c38e9cb4f0b7b3e95d98cd9fb0fa1423e7dd
parentb48f859a0397225f5484fd9fd78a3b6567e12f77
mem: fix potential resource leak on alloc

Normally, tailq entry should have a valid fd by the time we attempt
to map the segment. However, in case it doesn't, we're leaking fd,
so fix it.

Coverity issue: 272570
Fixes: 2a04139f66b4 ("eal: add single file segments option")

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_memalloc.c