[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Changed malloc() to g_malloc() at places where
From: |
haris iqbal |
Subject: |
Re: [Qemu-devel] [PATCH] Changed malloc() to g_malloc() at places where return value was not being checked |
Date: |
Tue, 22 Mar 2016 21:22:42 +0530 |
On Tue, Mar 22, 2016 at 8:45 PM, Markus Armbruster <address@hidden> wrote:
> Md Haris Iqbal <address@hidden> writes:
>
>> Signed-off-by: Md Haris Iqbal <address@hidden>
>> ---
>> bsd-user/elfload.c | 2 +-
>> bsd-user/qemu.h | 2 +-
>> linux-user/qemu.h | 2 +-
>> thunk.c | 2 +-
>> ui/shader.c | 2 +-
>> 5 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/bsd-user/elfload.c b/bsd-user/elfload.c
>> index 0a6092b..40bd1f2 100644
>> --- a/bsd-user/elfload.c
>> +++ b/bsd-user/elfload.c
>> @@ -1064,7 +1064,7 @@ static void load_symbols(struct elfhdr *hdr, int fd)
>>
>> found:
>> /* Now know where the strtab and symtab are. Snarf them. */
>> - s = malloc(sizeof(*s));
>> + s = g_malloc(sizeof(*s));
>> syms = malloc(symtab.sh_size);
>> if (!syms) {
>> free(s);
>
> You need to track down where s is freed and change from free() to
> g_free() there. One such spot is visible in context. Same for the
> rest of the patch.
On it. Thanks.
>
> [...]
--
With regards,
Md Haris Iqbal,
Placement Coordinator, MTech IT
NITK Surathkal,
Contact: +91 8861996962
Re: [Qemu-devel] [PATCH] Changed malloc() to g_malloc() at places where return value was not being checked, Markus Armbruster, 2016/03/22
- Re: [Qemu-devel] [PATCH] Changed malloc() to g_malloc() at places where return value was not being checked,
haris iqbal <=