From: <mar...@us...> - 2007-06-29 17:48:52
|
Revision: 10418 http://svn.sourceforge.net/gphoto/?rev=10418&view=rev Author: marcusmeissner Date: 2007-06-29 10:48:48 -0700 (Fri, 29 Jun 2007) Log Message: ----------- added free for objectinfo so we free the objectinfo strings on free_params time. Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/ptp.c trunk/libgphoto2/camlibs/ptp2/ptp.h Modified: trunk/libgphoto2/camlibs/ptp2/ptp.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.c 2007-06-29 16:41:15 UTC (rev 10417) +++ trunk/libgphoto2/camlibs/ptp2/ptp.c 2007-06-29 17:48:48 UTC (rev 10418) @@ -469,6 +469,8 @@ **/ void ptp_free_params (PTPParams *params) { + int i; + while (params->proplist) { MTPPropList *xpl = params->proplist; @@ -481,6 +483,8 @@ if (params->cameraname) free (params->cameraname); if (params->wifi_profiles) free (params->wifi_profiles); free (params->handles.Handler); + for (i=0;i<params->handles.n;i++) + ptp_free_objectinfo (¶ms->objectinfo[i]); free (params->objectinfo); ptp_free_DI (¶ms->deviceinfo); } @@ -2916,6 +2920,14 @@ } } +void +ptp_free_objectinfo (PTPObjectInfo *oi) +{ + if (!oi) return; + free (oi->Filename); + free (oi->Keywords); +} + void ptp_perror(PTPParams* params, uint16_t error) { Modified: trunk/libgphoto2/camlibs/ptp2/ptp.h =================================================================== --- trunk/libgphoto2/camlibs/ptp2/ptp.h 2007-06-29 16:41:15 UTC (rev 10417) +++ trunk/libgphoto2/camlibs/ptp2/ptp.h 2007-06-29 17:48:48 UTC (rev 10418) @@ -1728,7 +1728,9 @@ void ptp_free_devicepropvalue (uint16_t dt, PTPPropertyValue* dpd); void ptp_free_objectpropdesc (PTPObjectPropDesc* dpd); void ptp_free_params (PTPParams *params); +void ptp_free_objectinfo (PTPObjectInfo *oi); + void ptp_perror (PTPParams* params, uint16_t error); const char* This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |