ACK: [PATCH] lib: fwts_pipeio: fix regression from memory leak fix
Colin Ian King
colin.king at canonical.com
Mon Apr 9 22:08:23 UTC 2018
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>
More information about the fwts-devel
mailing list