free(props) array on error (Coverity)

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12546 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2009-12-12 11:05:11 +00:00
parent 4279475dcc
commit d27a4b4f25

View File

@@ -2939,9 +2939,9 @@ camera_summary (Camera* camera, CameraText* summary, GPContext *context)
} 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);
}