Re: [PATCH] univ-init: scalar initializer needs some additional checks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 03/06/2020 02:01, Ramsay Jones wrote:

> On 02/06/2020 17:33, Luc Van Oostenryck wrote:
[snip]
> I applied this patch just now and everything worked fine. In addition,
> the tests from my patch also passed, once I had remembered to add the
> -Wno-universal-initializer to the 'check-command' - because I do not
> have the patch which changes the default for that warning.
> 
> The only thing which gave me pause ...
> 
>> Fixes: 537e3e2daebd37d69447e65535fc94e82b38fc18
>> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
>> ---
>>  evaluate.c                 |  3 +++
>>  expression.h               |  1 +
>>  parse.c                    | 15 ++++++++-------
>>  validation/Wuniv-init-ko.c | 16 ++++++++++++++++
>>  validation/Wuniv-init-ok.c | 18 ++++++++++++++++++
>>  5 files changed, 46 insertions(+), 7 deletions(-)
>>
>> diff --git a/evaluate.c b/evaluate.c
>> index 8d2e68692a48..16553eb3481b 100644
>> --- a/evaluate.c
>> +++ b/evaluate.c
>> @@ -2608,6 +2608,9 @@ static void handle_list_initializer(struct expression *expr,
>>  	struct expression *e, *last = NULL, *top = NULL, *next;
>>  	int jumped = 0;
>>  
>> +	if (expr->zero_init)
>> +		expr->expr_list = NULL;
> 
> ... was the potential memory leak here. (OK it wouldn't be a
> huge leak, but still!).

Heh, as soon as my head hit the pillow I realised that, due to extensive
use of memory pools/arenas, this is a rather silly comment! ;-)

[Ah, well, it was 2am!]

ATB,
Ramsay Jones





[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux