raw/skeleton: fix memory leak on test failure
authorShreyansh Jain <shreyansh.jain@nxp.com>
Wed, 24 Oct 2018 05:33:41 +0000 (05:33 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 24 Oct 2018 22:59:28 +0000 (00:59 +0200)
commit88d0e47880ec729dac682be5e4242e13ffd7dcd2
treed9e7d924a2378c6e681541de3cda6fecbc37400e
parent44e87c27a51ef82f16c24c105b5fec16480e558e
raw/skeleton: fix memory leak on test failure

In skeleton_rawdev unit tests, a malloc'd memory was leaking in case
the next sequential test fails. This fix moves the free of the
malloc'd memory above the failing test.

Coverity issue: 260402
Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases")

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/raw/skeleton_rawdev/skeleton_rawdev_test.c