axmap: Avoid memory leak if axmap_new() failed
authorErwan Velu <erwan.velu@enovance.com>
Thu, 19 Feb 2015 12:09:09 +0000 (13:09 +0100)
committerErwan Velu <erwan.velu@enovance.com>
Thu, 19 Feb 2015 12:12:12 +0000 (13:12 +0100)
commit1d3fe9fd6945d4bfa14deaacc83aa9813c3f95aa
tree1ecd222e28f404c525427dbd594765511c9448bb
parent244484810a69a2371d938b2a10dc468a667dd029
axmap: Avoid memory leak if axmap_new() failed

The axmap_new() function implements an exit path using the label "err"
to free the alloced memory.

That cleanup code was cleaning all the sub malloc structures but not the
main structure (axmap) itself resulting in a memory leak of
sizeof(struct axmap) bytes.

This simple patch just free axmap at the end of the cleanup code.
lib/axmap.c