summaryrefslogtreecommitdiff
path: root/camlibs/ricoh
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-06-30 06:36:33 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-06-30 06:36:33 +0000
commit8069d9743871887fc6733347e64f77f446f353a3 (patch)
tree147670423848e6b0c6a1275596b4c4fd7b9ed45f /camlibs/ricoh
parentbb2723f5955776f44f607a1d541f265e79916e6e (diff)
downloadlibgphoto2-8069d9743871887fc6733347e64f77f446f353a3.tar.gz
fixed memory leak and progress context leak (Coverity)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@15043 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/ricoh')
-rw-r--r--camlibs/ricoh/g3.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c
index 41c4339e0..ba6ef3cee 100644
--- a/camlibs/ricoh/g3.c
+++ b/camlibs/ricoh/g3.c
@@ -120,15 +120,20 @@ g3_channel_read_bytes(
ret = gp_port_read(port, (char *)xbuf, rest);
if (ret < GP_OK) {
gp_log(GP_LOG_ERROR, "g3", "read error in g3_channel_read\n");
+ gp_context_progress_stop (context, id);
+ free(xbuf);
return ret;
}
if (ret != rest) {
gp_log(GP_LOG_ERROR, "g3", "read error in g3_channel_read\n");
+ gp_context_progress_stop (context, id);
+ free(xbuf);
return ret;
}
if ((xbuf[2] != 0xff) || (xbuf[3] != 0xff)) {
gp_log(GP_LOG_ERROR, "g3", "first bytes do not match.\n");
+ gp_context_progress_stop (context, id);
free(xbuf);
return GP_ERROR_IO;
}