target-mips: fix resource leak reported by Coverity
commit26e7e982b267e71d40cd20e9e234fedef6770a90
authorLeon Alrae <leon.alrae@imgtec.com>
Tue, 14 Jul 2015 10:08:15 +0000 (14 11:08 +0100)
committerLeon Alrae <leon.alrae@imgtec.com>
Wed, 15 Jul 2015 13:07:25 +0000 (15 14:07 +0100)
treefad74f2bf3bebc3365ebdfb7108c0c3d4582d2fa
parent47ada0ad3431b39863918dc80386634693d317b5
target-mips: fix resource leak reported by Coverity

UHI assert and link operations call lock_user_string() twice to obtain two
strings pointed by gpr[4] and gpr[5]. If the second lock_user_string()
fails, then the first one won't get freed. Fix this by introducing another
macro responsible for obtaining two strings and handling allocation
failure.

Signed-off-by: Leon Alrae <leon.alrae@imgtec.com>
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
target-mips/mips-semi.c