summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorluozhengzheng <[email protected]>2016-09-24 00:10:50 +0800
committerBrian Behlendorf <[email protected]>2016-09-23 09:10:50 -0700
commitd0662a1beb03033480dc0ac36e905b607e1e8eb8 (patch)
treee87f18c77360828ecf699b1fa82ecacfe723dc24 /tests
parentd5b897a6a1da2f031a708fd267b4de2cc9b7a6e2 (diff)
Fix coverity defects: CID 147613 147614 147616 147617
coverity scan CID:147617,type: resource leaks coverity scan CID:147616,type: resource leaks coverity scan CID:147614,type: resource leaks coverity scan CID:147613,type: resource leaks Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: luozhengzheng <[email protected]> Closes #5150
Diffstat (limited to 'tests')
-rw-r--r--tests/zfs-tests/cmd/xattrtest/xattrtest.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c
index 6b07d141a..68a809f17 100644
--- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c
+++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c
@@ -252,6 +252,7 @@ drop_caches(void)
rc = write(fd, "3", 1);
if ((rc == -1) || (rc != 1)) {
ERROR("Error %d: write(%d, \"3\", 1)\n", errno, fd);
+ (void) close(fd);
return (errno);
}
@@ -630,6 +631,7 @@ unlink_files(void)
rc = unlink(file);
if ((rc == -1) && (errno != ENOENT)) {
ERROR("Error %d: unlink(%s)\n", errno, file);
+ free(file);
return (errno);
}
}