diff options
author | Krishna Kant Jaju <krishna.jaju@samsung.com> | 2022-09-22 20:38:26 +0530 |
---|---|---|
committer | Krishna Kant Jaju <krishna.jaju@samsung.com> | 2022-09-22 20:39:00 +0530 |
commit | 64c5213ee561df17c39b41e00804860b3684091d (patch) | |
tree | 616110c1318362bc5ee58f5a5d51589d41e914d6 | |
parent | 4a6cef0b01783dbb38eb9b806663a85c8a9eb7e5 (diff) | |
download | msg-service-accepted/tizen/unified/20220923.125152.tar.gz msg-service-accepted/tizen/unified/20220923.125152.tar.bz2 msg-service-accepted/tizen/unified/20220923.125152.zip |
Coverity issue resolved resource_leaktizen_7.0_m2_releaseaccepted/tizen/unified/20220923.125152accepted/tizen/7.0/unified/hotfix/20221116.105335accepted/tizen/7.0/unified/20221110.062816tizen_7.0_hotfixaccepted/tizen_7.0_unified_hotfixaccepted/tizen_7.0_unified
Change-Id: Ia552b19561f965b5ee669e23b7b905a7a4f053a7
Signed-off-by: Krishna Kant Jaju <krishna.jaju@samsung.com>
-rwxr-xr-x | plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp b/plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp index 436ac43..e69dcb6 100755 --- a/plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp +++ b/plugin/sms_plugin/3gpp/Sms3gppWapPushHandler.cpp @@ -1415,6 +1415,14 @@ void Sms3gppWapPushHandler::handleMMSNotification(const char *pPushBody, int Pus } +void XmlFree(xmlChar* tmpXml) +{ + if (tmpXml != NULL) { + xmlFree(tmpXml); + tmpXml = NULL; + } +} + void Sms3gppWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bool isText, int simIndex) { MSG_BEGIN(); @@ -1482,11 +1490,15 @@ void Sms3gppWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bo if (tmpXmlChar != NULL) strncpy(pushMsg.href, (char*)tmpXmlChar, MAX_WAPPUSH_HREF_LEN-1); + XmlFree(tmpXmlChar); + tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_SI_ID_TAG); if (tmpXmlChar != NULL) strncpy(pushMsg.id, (char*)tmpXmlChar, MAX_WAPPUSH_ID_LEN-1); + XmlFree(tmpXmlChar); + tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_CREATED_TAG); if (tmpXmlChar != NULL) @@ -1495,15 +1507,21 @@ void Sms3gppWapPushHandler::handleSIMessage(char* pPushBody, int PushBodyLen, bo if (pushMsg.created == 0) pushMsg.created = pushMsg.received; + XmlFree(tmpXmlChar); + tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_EXPIRES_TAG); if (tmpXmlChar != NULL) pushMsg.expires = convertXmlCharToSec((char*)tmpXmlChar); + XmlFree(tmpXmlChar); + tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_ACTION_TAG); pushMsg.action = convertSIActionStrToEnum((char*)tmpXmlChar); + XmlFree(tmpXmlChar); + tmpXmlChar = xmlNodeListGetString(xmlDoc, indNode->xmlChildrenNode, 1); if (tmpXmlChar == NULL) { @@ -1631,6 +1649,8 @@ void Sms3gppWapPushHandler::handleSLMessage(char* pPushBody, int PushBodyLen, bo strncpy(pushMsg.href, (char*)tmpXmlChar, MAX_WAPPUSH_HREF_LEN-1); + XmlFree(tmpXmlChar); + tmpXmlChar = xmlGetProp(indNode, (xmlChar*)SMS_PUSH_XML_ACTION_TAG); pushMsg.action = convertSLActionStrToEnum((char*)tmpXmlChar); |