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 <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5150
This commit is contained in:
luozhengzheng
2016-09-24 00:10:50 +08:00
committed by Brian Behlendorf
parent d5b897a6a1
commit d0662a1beb
2 changed files with 10 additions and 4 deletions
@@ -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);
}
}