diff options
author | Ahmed Abouzied | 2022-01-04 15:38:41 +0100 |
---|---|---|
committer | Laurent Vivier | 2022-01-06 11:40:52 +0100 |
commit | 7a5626a1d8a193106dc709608273ed48729967d5 (patch) | |
tree | d73685726e18fafb3c93ce6a1ee21f9f021afd7f /linux-user/syscall.c | |
parent | linux-user/nios2: Use set_sigmask in do_rt_sigreturn (diff) | |
download | qemu-7a5626a1d8a193106dc709608273ed48729967d5.tar.gz qemu-7a5626a1d8a193106dc709608273ed48729967d5.tar.xz qemu-7a5626a1d8a193106dc709608273ed48729967d5.zip |
linux-user/syscall.c: malloc to g_try_malloc
Use g_try_malloc instead of malloc to alocate the target ifconfig.
Also replace the corresponding free with g_free.
Signed-off-by: Ahmed Abouzied <email@aabouzied.com>
Message-Id: <20220104143841.25116-1-email@aabouzied.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r-- | linux-user/syscall.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3160d77154..ce9d64896c 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4915,7 +4915,7 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, * We can't fit all the extents into the fixed size buffer. * Allocate one that is large enough and use it instead. */ - host_ifconf = malloc(outbufsz); + host_ifconf = g_try_malloc(outbufsz); if (!host_ifconf) { return -TARGET_ENOMEM; } @@ -4963,7 +4963,7 @@ static abi_long do_ioctl_ifconf(const IOCTLEntry *ie, uint8_t *buf_temp, } if (free_buf) { - free(host_ifconf); + g_free(host_ifconf); } return ret; |