summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-08-16 08:50:11 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-08-16 08:50:11 +0000
commit9eabcf8039d34555f447de30b62b459bfcdfba8e (patch)
tree18afd0ac6503d914f318f27782eb949f0764fb04
parent12008e8d0e777d131c5a728c5b398808c20d040f (diff)
downloadlibgphoto2-9eabcf8039d34555f447de30b62b459bfcdfba8e.tar.gz
avoid leaking props (Coverity)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15123 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r--camlibs/ptp2/library.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/camlibs/ptp2/library.c b/camlibs/ptp2/library.c
index 094c7bc22..3a5af68ac 100644
--- a/camlibs/ptp2/library.c
+++ b/camlibs/ptp2/library.c
@@ -5141,7 +5141,11 @@ ptp_mtp_parse_metadata (
end = strstr (begin, propname2);
if (!end) continue;
*end = '\0';
- C_MEM (content = strdup(begin));
+ content = strdup(begin);
+ if (!content) {
+ free (props);
+ C_MEM (content);
+ }
*end = '<';
GP_LOG_D ("found tag %s, content %s", propname, content);
ret = LOG_ON_PTP_E (ptp_mtp_getobjectpropdesc (params, props[j], ofc, &opd));