This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch ld]: Do some memory cleanup for def-file parsing


2011/4/18 Nick Clifton <nickc@redhat.com>:
> Hi Kai,
>
>> ld/
>> 2011-04-16 ?Kai Tietz
>>
>> ? ? ? ?* deffilep.y (def_pool_str): New type.
>> ? ? ? ?(pool_strs): Local static.
>> ? ? ? ?(def_pool_alloc): Local function.
>> ? ? ? ?(def_pool_strdup): Likewise.
>> ? ? ? ?(def_pool_free): Likewise.
>> ? ? ? ?(opt_name): Replace xmalloc/xstrdup by
>> ? ? ? ?def_pool_alloc/def_pool_strdup.
>> ? ? ? ?(dot_name): Likewise.
>> ? ? ? ?(anylang_id): Likewise.
>> ? ? ? ?(def_lex): Likewise.
>> ? ? ? ?(def_file_parse): Call def_pool_free on
>> ? ? ? ?exit and cleanup directives elements.
>> ? ? ? ?(def_file_add_directive): Call def_pool_free.
>
> Approved - please apply.
>
> But ...
>
> + ?e = (def_pool_str *) xmalloc (sizeof (def_pool_str) + sz);
> + ?if (!e)
> + ? ?return NULL;
>
> This check is unnecessary - xmalloc() cannot return a NULL pointer.
>
> Cheers
> ?Nick
>

Applied with removing of unnecessary nil-check.

Thanks,
Kai


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]