mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-26 15:02:56 +02:00
Possible Memory leak: tag
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@30 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user