This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix resource leaks

Found by:	Coverity Scan, CID 1016673, 1007118
Approved by:	re
  • Loading branch information...
emaste committed Oct 7, 2013
1 parent 2094cd3 commit 082d19dd6e6d8f671df3bc5bf7391273de3f1a92
Showing with 2 additions and 0 deletions.
  1. +2 −0 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. */

0 comments on commit 082d19d

Please sign in to comment.