summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2016-01-10 12:28:19 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-01-10 12:28:19 +0100
commitd077ca26f13236ceadfaaa4ccc5787e8f8ebf3a0 (patch)
treeb3b9cc51d793288d7177ebc67392185e3c064c99
parent05afc5175d52c98d7645685c07024de7428eba59 (diff)
downloadlibgphoto2-d077ca26f13236ceadfaaa4ccc5787e8f8ebf3a0.tar.gz
free data in error exit paths (Coverity)
-rw-r--r--libgphoto2_port/vusb/vcamera.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libgphoto2_port/vusb/vcamera.c b/libgphoto2_port/vusb/vcamera.c
index 7944ae04d..c696caf12 100644
--- a/libgphoto2_port/vusb/vcamera.c
+++ b/libgphoto2_port/vusb/vcamera.c
@@ -820,12 +820,14 @@ ptp_getobjectinfo_write(vcamera *cam, ptpcontainer *ptp) {
fd = open(cur->fsname,O_RDONLY);
if (fd == -1) {
free (filedata);
+ free (data);
gp_log (GP_LOG_ERROR,__FUNCTION__, "could not open %s", cur->fsname);
ptp_response(cam,PTP_RC_GeneralError,0);
return 1;
}
if (cur->stbuf.st_size != read(fd, filedata, cur->stbuf.st_size)) {
free (filedata);
+ free (data);
close (fd);
gp_log (GP_LOG_ERROR,__FUNCTION__, "could not read data of %s", cur->fsname);
ptp_response(cam,PTP_RC_GeneralError,0);