Memory leak in parser->vbNextToken
Brought to you by:
essmann
createSimpleXmlParser() allocates a buffer in parser->vbNextToken by calling
parser->vbNextToken= createSimpleXmlValueBuffer(512);
which in turn allocates the buffer by allocating the 512 bytes into vb->sBuffer.
However, when destroySimpleXmlParser() is releasing resources, it merely calls free(parser->vbNextToken), which leaks the actual buffer allocated in vb->sBuffer.
A cleanup function, destroySimpleXmlValueBuffer() is already provided, but not used. This patch will replace the call to free() with a call to destroySimpleXmlValueBuffer() which will clean up both the buffer and the container object.
Memory leak patch