Re: [PATCH 29/34] fsstress: fix a memory leak

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



On Tue, Feb 04, 2025 at 01:29:52PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@xxxxxxxxxx>
> 
> Someone forgot to free the iovec that readv_f allocates.
> 
> Fixes: 80499d8f5f251e ("fsstress: new writev and readv operations test")
> Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
> ---
>  ltp/fsstress.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> 
> diff --git a/ltp/fsstress.c b/ltp/fsstress.c
> index 9e8eaa6d8656da..14c29921e8b0f8 100644
> --- a/ltp/fsstress.c
> +++ b/ltp/fsstress.c
> @@ -4652,6 +4652,7 @@ readv_f(opnum_t opno, long r)
>  	}
>  
>  	e = readv(fd, iov, iovcnt) < 0 ? errno : 0;
> +	free(iov);
>  	free(buf);
>  	if (v)
>  		printf("%d/%lld: readv %s%s [%lld,%d,%d] %d\n",

looks good - writev_f() frees the iov, so this now matches.

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

-- 
Dave Chinner
david@xxxxxxxxxxxxx




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux