From 1efcd217fbf2162c6157fd04a97b08452beff58f Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 5 Jan 2014 20:34:00 +0000 Subject: [PATCH] free comment (Coverity) git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14639 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2/exif.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libgphoto2/exif.c b/libgphoto2/exif.c index 5886fa142..d79491aac 100644 --- a/libgphoto2/exif.c +++ b/libgphoto2/exif.c @@ -447,7 +447,10 @@ unsigned char *gpi_exif_get_thumbnail_and_size(exifparser *exifdat, long *size) gpi_exif_get_field( EXIF_Model, -1, exifdat, &owner); printf("Camera model: %s\n",owner.data); printf("Comment for this picture (%d chars)",gpi_exif_get_comment( exifdat, &comment)); - if (comment) printf(" -> %s\n",comment); + if (comment) { + printf(" -> %s\n",comment); + free(comment); + } gpi_exif_get_field( EXIF_SubjectDistance, 2, exifdat, &owner); /* dump_exif(exifdat); */ }