memzone: fix leak on allocation error
authorAnatoly Burakov <anatoly.burakov@intel.com>
Thu, 21 Dec 2017 18:07:07 +0000 (18:07 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 12 Jan 2018 14:38:29 +0000 (15:38 +0100)
commitdb22d31a79733f08e974f134c883361fd8641984
treeee522fa9f6adf0426ee6f6f9b918359c07f25d34
parentfb033aceaf81bee4fcbd77d016bb590d9a27146f
memzone: fix leak on allocation error

We check if there's space in config after we allocated the memzone,
but if there isn't, we never free it back. This patch adds memzone
free if there's no room in memzone config.

Fixes: ff909fe21f0a ("mem: introduce memzone freeing")
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
lib/librte_eal/common/eal_common_memzone.c