diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c index 4985a2373..18a368843 100644 --- a/camlibs/ptp2/library.c +++ b/camlibs/ptp2/library.c @@ -2939,9 +2939,9 @@ camera_summary (Camera* camera, CameraText* summary, GPContext *context) } else { for (j=0;j= 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); }