|
From: | Riku Voipio |
Subject: | Re: [Qemu-devel] [PATCH v4] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0() |
Date: | Tue, 06 Oct 2015 13:41:23 +0300 |
User-agent: | Trojita/0.5-git; Qt/5.4.2; xcb; Linux; Debian GNU/Linux testing (stretch) |
On maanantaina 5. lokakuuta 2015 6.32.27 EEST, Harmandeep Kaur wrote:
Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() in linux-user/syscall.c file
@@ -7723,7 +7723,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,struct linux_dirent *dirp; abi_long count = arg3;- dirp = malloc(count);+ dirp = g_try_malloc(sizeof(count));
Shouldn't this be g_try_malloc(count) ?
if (!dirp) { ret = -TARGET_ENOMEM; goto fail;@@ -7760,7 +7760,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,ret = count1; unlock_user(target_dirp, arg2, ret); } - free(dirp); + g_free(dirp); } #else {
[Prev in Thread] | Current Thread | [Next in Thread] |