[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [PATCH 63/88] bsd-user/syscall: fix a memory leak on
From: |
Kamil Rytarowski |
Subject: |
Re: [Qemu-trivial] [PATCH 63/88] bsd-user/syscall: fix a memory leak on EFAULT, use g_new() |
Date: |
Sat, 7 Oct 2017 10:48:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; NetBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 07.10.2017 01:49, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> Kamil are you interested in maintaining bsd-user? :)
>
Long term yes, short term I'm occupied full-time on getting modern
debuggers as fully-functional and as fully-featured on NetBSD as possible.
( http://blog.netbsd.org/tnf/entry/eurobsdcon_2017_paris_report )
> bsd-user/syscall.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c
> index 66492aaf5d..9120cea61e 100644
> --- a/bsd-user/syscall.c
> +++ b/bsd-user/syscall.c
> @@ -227,7 +227,7 @@ static abi_long do_freebsd_sysctl(abi_ulong namep,
> int32_t namelen, abi_ulong ol
> void *hnamep, *holdp, *hnewp = NULL;
> size_t holdlen;
> abi_ulong oldlen = 0;
> - int32_t *snamep = g_malloc(sizeof(int32_t) * namelen), *p, *q, i;
> + int32_t *snamep, *p, *q, i;
> uint32_t kind = 0;
>
> if (oldlenp)
> @@ -239,6 +239,7 @@ static abi_long do_freebsd_sysctl(abi_ulong namep,
> int32_t namelen, abi_ulong ol
> if (!(holdp = lock_user(VERIFY_WRITE, oldp, oldlen, 0)))
> return -TARGET_EFAULT;
> holdlen = oldlen;
> + snamep = g_new(int32_t, namelen);
> for (p = hnamep, q = snamep, i = 0; i < namelen; p++, i++)
> *q++ = tswap32(*p);
> oidfmt(snamep, namelen, NULL, &kind);
>
signature.asc
Description: OpenPGP digital signature
- [Qemu-trivial] [PATCH 58/88] ppc4xx: use g_new() family of functions, (continued)
- [Qemu-trivial] [PATCH 58/88] ppc4xx: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 59/88] ppce500: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 60/88] sPAPR: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 61/88] tests: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 62/88] user: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 63/88] bsd-user/syscall: fix a memory leak on EFAULT, use g_new(), Philippe Mathieu-Daudé, 2017/10/06
- Re: [Qemu-trivial] [PATCH 63/88] bsd-user/syscall: fix a memory leak on EFAULT, use g_new(),
Kamil Rytarowski <=
- [Qemu-trivial] [PATCH 64/88] user: use g_strfreev(), Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 65/88] util: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 66/88] util/qemu-thread-win32: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 67/88] util/coroutine: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 68/88] virtio: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 69/88] virtio-9p: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 70/88] block: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-trivial] [PATCH 72/88] hw/block/nvme: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06