VirtualBox

Changeset 33835 in vbox for trunk/src


Ignore:
Timestamp:
Nov 8, 2010 1:00:42 PM (14 years ago)
Author:
vboxsync
Message:

Main;Runtime: fix memory freeing returned by libxml2

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ApplianceImplExport.cpp

    r33698 r33835  
    17251725            /* Write the ovf file to disk. */
    17261726            vrc = RTSha1WriteBuf(strOvfFile.c_str(), pvBuf, cbSize, pCallbacks, pStorage);
    1727             RTMemFree(pvBuf);
    17281727            if (RT_FAILURE(vrc))
    17291728                throw setError(VBOX_E_FILE_ERROR,
  • trunk/src/VBox/Runtime/r3/xml.cpp

    r33700 r33835  
    14631463
    14641464XmlMemWriter::XmlMemWriter()
     1465  : m_pBuf(0)
    14651466{
    14661467}
     
    14681469XmlMemWriter::~XmlMemWriter()
    14691470{
     1471    if (m_pBuf)
     1472        xmlFree(m_pBuf);
    14701473}
    14711474
    14721475void XmlMemWriter::write(const Document &doc, void **ppvBuf, size_t *pcbSize)
    14731476{
    1474     xmlChar* pBuf;
     1477    if (m_pBuf)
     1478    {
     1479        xmlFree(m_pBuf);
     1480        m_pBuf = 0;
     1481    }
    14751482    int size;
    1476     xmlDocDumpFormatMemory(doc.m->plibDocument, &pBuf, &size, 1);
    1477     *ppvBuf = pBuf;
     1483    xmlDocDumpFormatMemory(doc.m->plibDocument, (xmlChar**)&m_pBuf, &size, 1);
     1484    *ppvBuf = m_pBuf;
    14781485    *pcbSize = size;
    14791486}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette