summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2014-01-05 20:32:31 +0000
committerMarcus Meissner <marcus@jet.franken.de>2014-01-05 20:32:31 +0000
commitaee0c68e3b185bfc3df363f46061eb1dab950b4c (patch)
treef379c020891de04aaec494271ded89208dda8a4d /libgphoto2
parent0afc97d423dd7c1023ce1d2b559df482937ed97d (diff)
downloadlibgphoto2-aee0c68e3b185bfc3df363f46061eb1dab950b4c.tar.gz
fixed some leaks in a helper function on error exists (Coverity)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14638 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/exif.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgphoto2/exif.c b/libgphoto2/exif.c
index e958ce9b9..5886fa142 100644
--- a/libgphoto2/exif.c
+++ b/libgphoto2/exif.c
@@ -458,6 +458,7 @@ unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size)
fprintf(stderr,"Too few ifds, doesn't look right. Giving up\n");
}
*size = 0;
+ free(newimg);
return(NULL); /* Things don't look right...*/
}
@@ -481,6 +482,7 @@ unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size)
if (dsize==-1){
fprintf(stderr,"No Jpeg size tag for thumbnail, skipping\n");
*size = 0;
+ free(newimg);
return(NULL);
}
imagedata=exifdat->data+tmp;
@@ -494,6 +496,7 @@ unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size)
if (tmp==-1) {
fprintf(stderr,"gpe_get_thumbnail: Tiff or jpeg data not found, skipping\n");
*size = 0;
+ free(newimg);
return(NULL);
}
imagedata=exifdat->data+tmp;
@@ -502,6 +505,7 @@ unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size)
if (dataptr==-1) {
printf("Split two\n");
*size = 0;
+ free(newimg);
return(NULL);
}