From 1cb226283f527c9fe600625e065eccc46f95ebb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bryon=20Gloden=2C=20CISSP=C2=AE?= Date: Sat, 1 Oct 2016 11:41:07 -0400 Subject: [PATCH] resource leak: fp [source/shared_lib/sources/map/map_preview.cpp:830]: (error) Resource leak: f1 Found by https://github.com/bryongloden/cppcheck --- source/shared_lib/sources/map/map_preview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/shared_lib/sources/map/map_preview.cpp b/source/shared_lib/sources/map/map_preview.cpp index d494bc895..76540927d 100644 --- a/source/shared_lib/sources/map/map_preview.cpp +++ b/source/shared_lib/sources/map/map_preview.cpp @@ -827,6 +827,7 @@ void MapPreview::loadFromFile(const string &path) { if(bytes != 1) { char szBuf[8096]=""; snprintf(szBuf,8096,"fread returned wrong size = " MG_SIZE_T_SPECIFIER " on line: %d.",bytes,__LINE__); + fclose(f1); throw megaglest_runtime_error(szBuf); } fromEndianMapFileHeader(header);