From d27a4b4f259fb4e5ae01255eda13e85e1334e33b Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sat, 12 Dec 2009 11:05:11 +0000 Subject: [PATCH] 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 --- camlibs/ptp2/library.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }