diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2013-10-08 06:48:30 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2013-10-08 06:48:30 +0000 |
commit | 54a60266c5d492d3421c75509d9c3a18ea50c51c (patch) | |
tree | 9f4a2f0437eb227c6d524ca3481a3626497cbcd0 /libgphoto2/gphoto2-file.c | |
parent | 1a003f310b59785f2c03f500020302456762c0bc (diff) | |
download | libgphoto2-54a60266c5d492d3421c75509d9c3a18ea50c51c.tar.gz |
added a missing fclose in an errorcase (Coverity)
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@14561 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-file.c')
-rw-r--r-- | libgphoto2/gphoto2-file.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libgphoto2/gphoto2-file.c b/libgphoto2/gphoto2-file.c index ee3507455..cb01a58fb 100644 --- a/libgphoto2/gphoto2-file.c +++ b/libgphoto2/gphoto2-file.c @@ -659,8 +659,10 @@ gp_file_open (CameraFile *file, const char *filename) switch (file->accesstype) { case GP_FILE_ACCESSTYPE_MEMORY: file->data = malloc (sizeof(char)*(size + 1)); - if (!file->data) + if (!file->data) { + fclose (fp); return (GP_ERROR_NO_MEMORY); + } size_read = fread (file->data, (size_t)sizeof(char), (size_t)size, fp); if (ferror(fp)) { gp_file_clean (file); |