summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2016-01-10 12:28:56 +0100
committerMarcus Meissner <marcus@jet.franken.de>2016-01-10 12:28:56 +0100
commit3b46b47dc72a99207dd6831760e1606f3d2fc1c9 (patch)
treed874be50a672a808984abb8c77f55ec92257b208
parentd077ca26f13236ceadfaaa4ccc5787e8f8ebf3a0 (diff)
downloadlibgphoto2-3b46b47dc72a99207dd6831760e1606f3d2fc1c9.tar.gz
avoid leaking data on error exit (Coverity)
-rw-r--r--libgphoto2_port/vusb/vcamera.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libgphoto2_port/vusb/vcamera.c b/libgphoto2_port/vusb/vcamera.c
index c696caf12..580363a23 100644
--- a/libgphoto2_port/vusb/vcamera.c
+++ b/libgphoto2_port/vusb/vcamera.c
@@ -730,14 +730,13 @@ ptp_getstorageinfo_write(vcamera *cam, ptpcontainer *ptp) {
CHECK_SESSION();
CHECK_PARAM_COUNT(1);
- data = malloc(200);
-
if (ptp->params[0] != 0x00010001) {
gp_log (GP_LOG_ERROR,__FUNCTION__, "invalid storage id 0x%08x", ptp->params[1]);
ptp_response(cam,PTP_RC_InvalidStorageId,0);
return 1;
}
+ data = malloc(200);
x += put_16bit_le (data+x, 3); /* StorageType: Fixed RAM */
x += put_16bit_le (data+x, 3); /* FileSystemType: Generic Hierarchical */
x += put_16bit_le (data+x, 2); /* AccessCapability: R/O with object deletion */