From f1608a2509798b1586c66560e0efd255be661fc0 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Tue, 26 Nov 2019 15:30:53 +0000 Subject: [PATCH] Fix bug #520 Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4295 --- src/debug/debug.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/debug/debug.cpp b/src/debug/debug.cpp index dcf0b800..217710dc 100644 --- a/src/debug/debug.cpp +++ b/src/debug/debug.cpp @@ -2288,8 +2288,10 @@ bool CDebugVar::LoadVars(char* name) // read number of vars Bit16u num; - if (fread(&num,sizeof(num),1,f) != 1) return false; - + if (fread(&num,sizeof(num),1,f) != 1) { + fclose(f); + return false; + } for (Bit16u i=0; i