diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2007-05-09 06:14:13 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2007-05-09 06:14:13 +0000 |
commit | d39f65d953ac9f104dbfe92319f21a19517f2346 (patch) | |
tree | 5425b83048287b7cef42505326911cc3b6bfb46f | |
parent | 1aa3667d6e64c46914fdc8dcfb91d831b0504cf2 (diff) | |
download | libgphoto2-d39f65d953ac9f104dbfe92319f21a19517f2346.tar.gz |
added 2 missing frees in an exit path (CID 76)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@10148 67ed7778-7388-44ab-90cf-0a291f65f57c
-rw-r--r-- | camlibs/sipix/blink2.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/camlibs/sipix/blink2.c b/camlibs/sipix/blink2.c index 9f09de268..359cefabd 100644 --- a/camlibs/sipix/blink2.c +++ b/camlibs/sipix/blink2.c @@ -216,8 +216,10 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, buf[6] = (len >> 8) & 0xff; buf[7] = len & 0xff; result = gp_port_usb_msg_write (camera->port,BLINK2_GET_MEMORY,0x03,0,buf,8); - if (result < GP_OK) + if (result < GP_OK) { + free (jpegdata); break; + } len *= 8; curread = 0; do { @@ -242,8 +244,11 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, jpeg_create_decompress(&dinfo); dinfo.src = &xjsm; ret = jpeg_read_header(&dinfo,TRUE); - if (ret != JPEG_HEADER_OK) + if (ret != JPEG_HEADER_OK) { + jpeg_destroy_decompress(&dinfo); + free (jpegdata); break; + } dinfo.out_color_space = JCS_RGB; jpeg_start_decompress(&dinfo); |