diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-03-26 08:57:23 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-03-26 08:57:23 +0000 |
commit | 530f237f2af91ed82938d7e92d6f6b75d36f315c (patch) | |
tree | 447dad8a397ca26e15a8b2d6bfe3648832862127 /src/modules | |
parent | 182051f3e97c54a79edab4f9f495120b105254d8 (diff) |
memory leak fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@12498 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/xml/xmlParser.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/xml/xmlParser.cpp b/src/modules/xml/xmlParser.cpp index 1f5da4006b..67d65089c7 100644 --- a/src/modules/xml/xmlParser.cpp +++ b/src/modules/xml/xmlParser.cpp @@ -1317,7 +1317,10 @@ char XMLNode::maybeAddTxT(void *pa, XMLCSTR tokenPStr) n = xstrlen(d->pText[i]); size_t n2 = xstrlen(lpt)+1; d->pText[i] = (XMLSTR)realloc((void*)d->pText[i], (n+n2)*sizeof(XMLCHAR)); - if (!d->pText[i]) return 1; + if (!d->pText[i]) { + free(lpt); + return 1; + } memcpy((void*)(d->pText[i]+n), lpt, n2*sizeof(XMLCHAR)); free(lpt); return 0; |