diff --git a/cocos2dx/support/CCUserDefault.cpp b/cocos2dx/support/CCUserDefault.cpp index 57a246d261..f956146e2e 100644 --- a/cocos2dx/support/CCUserDefault.cpp +++ b/cocos2dx/support/CCUserDefault.cpp @@ -368,6 +368,12 @@ bool CCUserDefault::createXMLFile() bRet = true; } while (0); + // if doc is not null, free it + if (doc) + { + xmlFreeDoc(doc); + } + return bRet; }