diff options
author | Stefan Weil <sw@weilnetz.de> | 2012-09-04 22:14:19 +0200 |
---|---|---|
committer | Doug Goldstein <cardoe@cardoe.com> | 2012-11-13 22:50:03 -0600 |
commit | ba091aeface240cec0d4c91a51cc83f770daf8b8 (patch) | |
tree | c000b8fb6abf5b7be15f989f08777bba5cc1927d | |
parent | TextConsole: saturate escape parameter in TTY_STATE_CSI (diff) | |
download | qemu-kvm-ba091aeface240cec0d4c91a51cc83f770daf8b8.tar.gz qemu-kvm-ba091aeface240cec0d4c91a51cc83f770daf8b8.tar.bz2 qemu-kvm-ba091aeface240cec0d4c91a51cc83f770daf8b8.zip |
linux-user: Remove redundant null check and replace free by g_free
Report from smatch:
linux-user/syscall.c:3632 do_ioctl_dm(220) info:
redundant null check on big_buf calling free()
'big_buf' was allocated by g_malloc0, therefore free was also
replaced by g_free.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
(cherry picked from commit ad11ad77748bdd8016370db210751683dc038dd6)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
(cherry picked from commit 61dea8e914440d02720a929ad78178ed821f9946)
-rw-r--r-- | linux-user/syscall.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 6257a04d0..471d0605f 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3628,9 +3628,7 @@ static abi_long do_ioctl_dm(const IOCTLEntry *ie, uint8_t *buf_temp, int fd, unlock_user(argptr, arg, target_size); } out: - if (big_buf) { - free(big_buf); - } + g_free(big_buf); return ret; } |