summaryrefslogtreecommitdiffstats
path: root/sbin/camcontrol
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2013-10-07 16:45:16 +0000
committeremaste <emaste@FreeBSD.org>2013-10-07 16:45:16 +0000
commit082d19dd6e6d8f671df3bc5bf7391273de3f1a92 (patch)
tree590bdb02a514980716970bcacc9d621e6cbd2b67 /sbin/camcontrol
parent2094cd31034c72b70a2ff7d6f39667aef2e0041e (diff)
downloadFreeBSD-src-082d19dd6e6d8f671df3bc5bf7391273de3f1a92.zip
FreeBSD-src-082d19dd6e6d8f671df3bc5bf7391273de3f1a92.tar.gz
Fix resource leaks
Found by: Coverity Scan, CID 1016673, 1007118 Approved by: re
Diffstat (limited to 'sbin/camcontrol')
-rw-r--r--sbin/camcontrol/fwdownload.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/camcontrol/fwdownload.c b/sbin/camcontrol/fwdownload.c
index 7e57d32..181c234 100644
--- a/sbin/camcontrol/fwdownload.c
+++ b/sbin/camcontrol/fwdownload.c
@@ -224,6 +224,7 @@ fw_read_img(const char *fw_img_path, const struct fw_vendor *vp, int *num_bytes)
goto bailout;
}
*num_bytes = img_size;
+ close(fd);
return (buf);
bailout:
free(buf);
@@ -286,6 +287,7 @@ fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp,
ata_28bit_cmd(&ccb->ataio, ATA_ATA_IDENTIFY, 0, 0, 0);
} else {
warnx("weird disk type '%s'", type);
+ cam_freeccb(ccb);
return 1;
}
/* Disable freezing the device queue. */
OpenPOWER on IntegriCloud