Possible Memory leak: tag

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@30 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: e29964bb20
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2009-12-08 (Tue, 08 Dec 2009)
This commit is contained in:
Jacek Jendrzej
2009-12-08 16:07:21 +00:00
parent 4568a0c080
commit 4ae5fd7fff

View File

@@ -757,8 +757,10 @@ enum XML_Error XML_Parser::doContent(int startTagLevel, const ENCODING *enc, con
if (!tag) return XML_ERROR_NO_MEMORY;
tag->buf=new char[INIT_TAG_BUF_SIZE];
if (!tag->buf) return XML_ERROR_NO_MEMORY;
if (!tag->buf){
delete tag;
return XML_ERROR_NO_MEMORY;
}
tag->bufEnd=tag->buf+INIT_TAG_BUF_SIZE;
}
@@ -775,8 +777,10 @@ enum XML_Error XML_Parser::doContent(int startTagLevel, const ENCODING *enc, con
int bufSize=ROUND_UP(tag->rawNameLength*4, sizeof(XML_Char));
tag->buf=(char *) realloc(tag->buf, bufSize);
if (!tag->buf) return XML_ERROR_NO_MEMORY;
if (!tag->buf){
delete tag;
return XML_ERROR_NO_MEMORY;
}
tag->bufEnd=tag->buf+bufSize;
};
@@ -812,8 +816,10 @@ enum XML_Error XML_Parser::doContent(int startTagLevel, const ENCODING *enc, con
bufSize=(tag->bufEnd-tag->buf) << 1;
tag->buf=(char *) realloc(tag->buf, bufSize);
if (!tag->buf) return XML_ERROR_NO_MEMORY;
if (!tag->buf){
delete tag;
return XML_ERROR_NO_MEMORY;
}
tag->bufEnd=tag->buf+bufSize;
if (nextPtr) tag->rawName=tag->buf;