From: <mar...@us...> - 2009-12-12 11:05:28
|
Revision: 12546 http://gphoto.svn.sourceforge.net/gphoto/?rev=12546&view=rev Author: marcusmeissner Date: 2009-12-12 11:05:11 +0000 (Sat, 12 Dec 2009) Log Message: ----------- free(props) array on error (Coverity) Modified Paths: -------------- trunk/libgphoto2/camlibs/ptp2/library.c Modified: trunk/libgphoto2/camlibs/ptp2/library.c =================================================================== --- trunk/libgphoto2/camlibs/ptp2/library.c 2009-12-06 18:20:24 UTC (rev 12545) +++ trunk/libgphoto2/camlibs/ptp2/library.c 2009-12-12 11:05:11 UTC (rev 12546) @@ -2939,9 +2939,9 @@ } else { for (j=0;j<propcnt;j++) { n = snprintf (txt, spaceleft," %04x/",props[j]); - if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + if (n >= spaceleft) { free (props); return GP_OK;} spaceleft -= n; txt += n; n = ptp_render_mtp_propname(props[j],spaceleft,txt); - if (n >= spaceleft) return GP_OK; spaceleft -= n; txt += n; + if (n >= spaceleft) { free (props); return GP_OK;} spaceleft -= n; txt += n; } free(props); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |