From c80cf95f45a40b6df3db9c27a22dec0dde015f3f Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 20 Mar 2010 22:11:15 +0000 Subject: [PATCH] free capturemode and burst propdesc git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12807 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/library.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index d3b8e7df4..759d371f5 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -1760,15 +1760,20 @@ camera_nikon_capture (Camera *camera, CameraCaptureType type, CameraFilePath *pa return GP_ERROR_NOT_SUPPORTED; } if ( ptp_property_issupported(params, PTP_DPC_StillCaptureMode) && - (PTP_RC_OK == ptp_getdevicepropdesc (params, PTP_DPC_StillCaptureMode, &propdesc)) && - (propdesc.DataType == PTP_DTC_UINT16) && - (propdesc.CurrentValue.u16 == 2) /* Burst Mode */ && - ptp_property_issupported(params, PTP_DPC_BurstNumber) && - (PTP_RC_OK == ptp_getdevicepropdesc (params, PTP_DPC_BurstNumber, &propdesc)) && - (propdesc.DataType == PTP_DTC_UINT16) - ) { - burstnumber = propdesc.CurrentValue.u16; - gp_log (GP_LOG_DEBUG, "ptp2", "burstnumber %d", burstnumber); + (PTP_RC_OK == ptp_getdevicepropdesc (params, PTP_DPC_StillCaptureMode, &propdesc))) { + PTPDevicePropDesc burstdesc; + + if ((propdesc.DataType == PTP_DTC_UINT16) && + (propdesc.CurrentValue.u16 == 2) /* Burst Mode */ && + ptp_property_issupported(params, PTP_DPC_BurstNumber) && + (PTP_RC_OK == ptp_getdevicepropdesc (params, PTP_DPC_BurstNumber, &burstdesc))) { + if (burstdesc.DataType == PTP_DTC_UINT16) { + burstnumber = burstdesc.CurrentValue.u16; + gp_log (GP_LOG_DEBUG, "ptp2", "burstnumber %d", burstnumber); + } + ptp_free_devicepropdesc (&burstdesc); + } + ptp_free_devicepropdesc (&propdesc); } /* if in liveview mode, we have to run non-af capture */