From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8zVv-0002li-9S for qemu-devel@nongnu.org; Tue, 04 Sep 2012 16:14:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T8zVu-0007Ad-76 for qemu-devel@nongnu.org; Tue, 04 Sep 2012 16:14:23 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:50560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T8zVu-0007AS-0q for qemu-devel@nongnu.org; Tue, 04 Sep 2012 16:14:22 -0400 From: Stefan Weil Date: Tue, 4 Sep 2012 22:14:19 +0200 Message-Id: <1346789659-6824-1-git-send-email-sw@weilnetz.de> Subject: [Qemu-devel] [PATCH] linux-user: Remove redundant null check and replace free by g_free List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Riku Voipio Cc: Stefan Weil , qemu-devel@nongnu.org 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 --- linux-user/syscall.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1513f08..c3533da 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; } -- 1.7.10