summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Variables/src/parse_system.cpp')
-rw-r--r--plugins/Variables/src/parse_system.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp
index 1c888e24f1..b17266b807 100644
--- a/plugins/Variables/src/parse_system.cpp
+++ b/plugins/Variables/src/parse_system.cpp
@@ -645,8 +645,10 @@ static TCHAR *parseTextFile(ARGUMENTSINFO *ai)
}
bufSz = TXTFILEBUFSZ*csz;
pBuf = (PBYTE)mir_calloc(bufSz);
- if (pBuf == NULL)
+ if (pBuf == NULL) {
+ CloseHandle(hFile);
return NULL;
+ }
// count number of lines
do {