summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_math.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Variables/src/parse_math.cpp')
-rw-r--r--plugins/Variables/src/parse_math.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp
index bd11a39c9f..54820e48f1 100644
--- a/plugins/Variables/src/parse_math.cpp
+++ b/plugins/Variables/src/parse_math.cpp
@@ -142,8 +142,10 @@ static TCHAR *parseNum(ARGUMENTSINFO *ai)
unsigned zeros = max(padding - (signed int)_tcslen(szVal), 0);
TCHAR *res = (TCHAR*)mir_alloc((zeros + _tcslen(szVal) + 1)*sizeof(TCHAR));
- if (res == NULL)
+ if (res == NULL) {
+ mir_free(szVal);
return NULL;
+ }
memset(res, 0, ((zeros + _tcslen(szVal) + 1) * sizeof(TCHAR)));
TCHAR *cur = res;