]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fsstress: fix a memory leak
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:00:31 +0000 (14:00 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 18 Feb 2025 04:42:39 +0000 (12:42 +0800)
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@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
ltp/fsstress.c

index 9e8eaa6d8656da7b87b84f3841c3ad2b62d46ca5..14c29921e8b0f87751f14de9d3a083844a39826a 100644 (file)
@@ -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",