From: <mar...@us...> - 2013-10-08 06:48:36
|
Revision: 14561 http://sourceforge.net/p/gphoto/code/14561 Author: marcusmeissner Date: 2013-10-08 06:48:30 +0000 (Tue, 08 Oct 2013) Log Message: ----------- added a missing fclose in an errorcase (Coverity) Modified Paths: -------------- trunk/libgphoto2/libgphoto2/gphoto2-file.c Modified: trunk/libgphoto2/libgphoto2/gphoto2-file.c =================================================================== --- trunk/libgphoto2/libgphoto2/gphoto2-file.c 2013-10-07 21:21:41 UTC (rev 14560) +++ trunk/libgphoto2/libgphoto2/gphoto2-file.c 2013-10-08 06:48:30 UTC (rev 14561) @@ -659,8 +659,10 @@ 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); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |