From 1dc0acced59124a07bfcaf8dfab834181dcdddeb Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 5 Jan 2014 22:04:49 +0000 Subject: [PATCH] free (xx) on return (Coverity) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14644 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ptp2/ptp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/camlibs/ptp2/ptp.c b/camlibs/ptp2/ptp.c index 68f4c45c1..f80128e49 100644 --- a/camlibs/ptp2/ptp.c +++ b/camlibs/ptp2/ptp.c @@ -489,7 +489,7 @@ traverse_tree (PTPParams *params, int depth, xmlNodePtr node) { if (!node) return 0; - xx = malloc(depth * 4 + 1); + xx = malloc (depth * 4 + 1); memset (xx, ' ', depth*4); xx[depth*4] = 0; @@ -503,6 +503,7 @@ traverse_tree (PTPParams *params, int depth, xmlNodePtr node) { fprintf(stderr,"%scontent %s\n", xx,xchar); traverse_tree (params, depth+1,xmlFirstElementChild (next)); } while ((next = xmlNextElementSibling (next))); + free (xx); return PTP_RC_OK; }