2004-04-05, 19:01
from cxmldocument::load(char*)
malloc and delete mixed. baaad. and the buffer is not deleted in the destructor => memleak...
Quote: m_doc = (char*) malloc(m_size); //***********
if (!m_doc)
{
m_size = 0;
fclose(hfile);
return -2;
}
if (fread(m_doc, m_size, 1, hfile)<=0)
{
delete m_doc; //************
m_doc = 0;
m_size = 0;
fclose(hfile);
return -3;
}
malloc and delete mixed. baaad. and the buffer is not deleted in the destructor => memleak...