]> git.baikalelectronics.ru Git - uboot.git/commit
test/overlay: Fix various malloc/free leaks
authorTom Rini <trini@konsulko.com>
Tue, 26 Sep 2017 16:43:12 +0000 (12:43 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 6 Oct 2017 15:28:20 +0000 (11:28 -0400)
commitbdc0e925bb44c0519a2c95b604de783bcc9ea528
tree380174d01bce580150ab163ca1b73fd32eb87443
parentd57899ecf2b82780de28a34777aad218677deb86
test/overlay: Fix various malloc/free leaks

With the overlay tests now being built in sandbox Coverity has found a
number of issues in the tests.  In short, if malloc ever failed we would
leak the previous mallocs, so we need to do the usual goto pattern to
free each in turn.  Finally, we always looked at the free()d location to
see how many tests had failed for the return code.

Reported-by: Coverity (CID: 167224, 167227, 167230, 167236)
Signed-off-by: Tom Rini <trini@konsulko.com>
test/overlay/cmd_ut_overlay.c