diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-10 18:44:06 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-01-10 18:44:06 +0000 |
commit | 2cd05c2649104e8690defdcf0122d8c3e827c1d2 (patch) | |
tree | e778d1ebc66f1942eab066d8de5b0a77e612ef5f /plugins/Variables/src/parse_logic.cpp | |
parent | e5972722ef981be64fe46ca8c07c2c403458e255 (diff) |
Variables:
- Fixed various memory leaks
git-svn-id: http://svn.miranda-ng.org/main/trunk@11821 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/src/parse_logic.cpp')
-rw-r--r-- | plugins/Variables/src/parse_logic.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp index 42f0ced5c3..9ce10a3a92 100644 --- a/plugins/Variables/src/parse_logic.cpp +++ b/plugins/Variables/src/parse_logic.cpp @@ -166,7 +166,6 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai) if (ai->argc != 5)
return NULL;
- TCHAR *parsed;
TCHAR *res = mir_tstrdup(_T(""));
FORMATINFO fi;
@@ -178,16 +177,19 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai) mir_free(formatString(&fi));
while (fi.eCount == 0) {
fi.tszFormat = ai->targv[4];
- parsed = formatString(&fi);
+ TCHAR *parsed = formatString(&fi);
if (parsed != NULL) {
if (res == NULL) {
res = (TCHAR*)mir_alloc(_tcslen(parsed) + 1 * sizeof(TCHAR));
- if (res == NULL)
+ if (res == NULL) {
+ mir_free(parsed);
return NULL;
+ }
}
else res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(parsed) + 1)*sizeof(TCHAR));
_tcscat(res, parsed);
+ mir_free(parsed);
}
fi.tszFormat = ai->targv[3];
mir_free(formatString(&fi));
|