diff --git a/cocos2dx/support/user_default/CCUserDefault.cpp b/cocos2dx/support/user_default/CCUserDefault.cpp index a38be0ad0f..44e4af6634 100644 --- a/cocos2dx/support/user_default/CCUserDefault.cpp +++ b/cocos2dx/support/user_default/CCUserDefault.cpp @@ -66,6 +66,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLEle break; } xmlDoc->Parse(pXmlBuffer); + delete[] pXmlBuffer; // get root node *rootNode = xmlDoc->RootElement(); if (NULL == *rootNode) diff --git a/cocos2dx/support/user_default/CCUserDefault.mm b/cocos2dx/support/user_default/CCUserDefault.mm index 8936a65e07..285c729879 100644 --- a/cocos2dx/support/user_default/CCUserDefault.mm +++ b/cocos2dx/support/user_default/CCUserDefault.mm @@ -81,6 +81,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc break; } xmlDoc->Parse(pXmlBuffer); + delete[] pXmlBuffer; // get root node rootNode = xmlDoc->RootElement(); if (NULL == rootNode) diff --git a/cocos2dx/support/user_default/CCUserDefaultAndroid.cpp b/cocos2dx/support/user_default/CCUserDefaultAndroid.cpp index b94d474609..220adf0deb 100644 --- a/cocos2dx/support/user_default/CCUserDefaultAndroid.cpp +++ b/cocos2dx/support/user_default/CCUserDefaultAndroid.cpp @@ -82,6 +82,7 @@ static tinyxml2::XMLElement* getXMLNodeForKey(const char* pKey, tinyxml2::XMLDoc break; } xmlDoc->Parse(pXmlBuffer); + delete[] pXmlBuffer; // get root node rootNode = xmlDoc->RootElement(); if (NULL == rootNode)