mem: fix resource leak
authorAnatoly Burakov <anatoly.burakov@intel.com>
Mon, 22 Oct 2018 12:57:03 +0000 (13:57 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 23 Oct 2018 09:36:48 +0000 (11:36 +0200)
commit198b66b9461c01558d4fb474d1485d1312bf2650
tree82d5c3584b197da4c4e2a4e1f41cbf1c38c9b48b
parent51bc78a5a765848b33a09889f596545f9c00c6d7
mem: fix resource leak

Segment preallocation code allocates an array of structures on the
heap but does not free the memory afterwards. Fix it by freeing it
at the end of the function, and changing control flow to always go
through that code path.

Coverity issue: 323524
Fixes: 1dd342d0fdc4 ("mem: improve segment list preallocation")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/linuxapp/eal/eal_memory.c