ACK: ACK: [PATCH] lib: fwts_pipeio: fix regression from memory leak fix

Alex Hung alex.hung at canonical.com
Mon Apr 9 23:58:37 UTC 2018


On 2018-04-09 03:08 PM, Colin Ian King wrote:
> On 09/04/18 22:22, Deb McLemore wrote:
>> Commit c4435dca34093fa25cfcd6d9debd668de1cfcfba regressed cases
>> where bytes read is zero which results in out_size of zero but
>> there will not be memory allocated and the condition is valid
>> for the caller.
>>
>> Signed-off-by: Deb McLemore <debmc at linux.vnet.ibm.com>
>> ---
>>   src/lib/src/fwts_pipeio.c | 8 +++-----
>>   1 file changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
>> index 60030de..3b3cfaf 100644
>> --- a/src/lib/src/fwts_pipeio.c
>> +++ b/src/lib/src/fwts_pipeio.c
>> @@ -219,11 +219,9 @@ int fwts_pipe_readwrite(
>>   
>>   	}
>>   
>> -	if (out_size) {
>> -		*out_len = out_size;
>> -		*out_buf = ptr;
>> -		return 0;
>> -	}
>> +	*out_len = out_size;
>> +	*out_buf = ptr;
>> +	return 0;
>>   fail:
>>   	free(ptr);
>>   	*out_len = 0;
>>
> 
> Thanks for fixing my bug. Oops.
> 
> Acked-by: Colin Ian King <colin.king at canonical.com>
> 


Acked-by: Alex Hung <alex.hung at canonical.com>



More information about the fwts-devel mailing list