summaryrefslogtreecommitdiff
path: root/camlibs/jd11
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2007-05-08 18:55:44 +0000
committerMarcus Meissner <marcus@jet.franken.de>2007-05-08 18:55:44 +0000
commit8cfffe15687ce76c642cb09d4bb9bc3ad0e1e62a (patch)
treefe6ea106014719435600b07b234f19bb9f51b28b /camlibs/jd11
parent1f8f833d6def3180c7b65054f149e5fd99aaebf8 (diff)
downloadlibgphoto2-8cfffe15687ce76c642cb09d4bb9bc3ad0e1e62a.tar.gz
added some gp_file_free () in error exit paths (CID 68)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10127 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/jd11')
-rw-r--r--camlibs/jd11/serial.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/camlibs/jd11/serial.c b/camlibs/jd11/serial.c
index 52f631934..7fc110719 100644
--- a/camlibs/jd11/serial.c
+++ b/camlibs/jd11/serial.c
@@ -414,9 +414,16 @@ jd11_index_reader(GPPort *port, CameraFilesystem *fs, GPContext *context) {
thumb[47*64-off+(63-x)] = src[off+x];
}
ret = gp_file_append(file,thumb,sizeof(thumb));
- if (ret != GP_OK) return ret;
+ if (ret != GP_OK) {
+ gp_file_free (file);
+ return ret;
+ }
ret = gp_filesystem_append(fs, "/", fn, context);
- if (ret != GP_OK) return ret;
+ if (ret != GP_OK) {
+ /* should perhaps remove the entry again */
+ gp_file_free (file);
+ return ret;
+ }
ret = gp_filesystem_set_file_noop(fs, "/", file, context);
if (ret != GP_OK) return ret;