return ret;
}
+ xmlChar* attribute_app_id = NULL;
+ xmlChar* attribute_provider_id = NULL;
+ xmlChar* multiple_accounts_support = NULL;
+ xmlChar* section = NULL;
+ xmlChar* account_icon = NULL;
+ xmlChar* account_small_icon = NULL;
+ xmlChar* xml_lang = NULL;
+ xmlChar* xml_label = NULL;
+ xmlChar* xml_capability = NULL;
+
// Node: <account>
xmlNodePtr cur_ptr = xmlFirstElementChild(xmlDocGetRootElement(docPtr));
if (cur_ptr == NULL) {
// Node: <account-provider>
if ((!xmlStrcmp(cur_ptr->name, _NODE_ACCOUNT_PROVIDER))) {
// Attribute: appid
- xmlChar* attribute_app_id = xmlGetProp(cur_ptr, _ATTRIBUTE_APP_ID);
+ attribute_app_id = xmlGetProp(cur_ptr, _ATTRIBUTE_APP_ID);
if (attribute_app_id == NULL) {
ret = -1;
_E("Failed to get the attribute.");
}
// Attribute: providerid
- xmlChar* attribute_provider_id = xmlGetProp(cur_ptr, _ATTRIBUTE_SERVICE_PROVIDER_ID);
+ attribute_provider_id = xmlGetProp(cur_ptr, _ATTRIBUTE_SERVICE_PROVIDER_ID);
if (attribute_provider_id != NULL) {
ret = -1;
_E("Failed to get the attribute(providerid).");
}
// Attribute: multiple-accounts-support
- xmlChar* multiple_accounts_support = xmlGetProp(cur_ptr, _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT);
+ multiple_accounts_support = xmlGetProp(cur_ptr, _ATTRIBUTE_MULTIPLE_ACCOUNTS_SUPPORT);
if (multiple_accounts_support == NULL) {
ret = -1;
_E("Failed to get the attribute.");
// Node: <icon>
if ((!xmlStrcmp(cur_ptr->name, _NODE_ICON))) {
// Attribute: section
- xmlChar* section = xmlGetProp(cur_ptr, _ATTRIBUTE_SECTION);
+ section = xmlGetProp(cur_ptr, _ATTRIBUTE_SECTION);
if (section == NULL) {
ret = -1;
_E("Failed to get the attribute.");
char *resource_path = NULL;
if ((!xmlStrcmp(section, _VALUE_ACCOUNT))) {
- xmlChar* account_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
+ account_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
if (account_icon == NULL) {
ret = -1;
_E("Failed to get the value.");
g_free(icon_path);
}
}
+ if (account_icon != NULL) {
+ xmlFree(account_icon);
+ account_icon = NULL;
+ }
} else if ((!xmlStrcmp(section, _VALUE_ACCOUNT_SMALL))) {
- xmlChar* account_small_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
+ account_small_icon = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
if (account_small_icon == NULL) {
ret = -1;
_E("Failed to get the value.");
g_free(small_icon_path);
}
}
+ if (account_small_icon != NULL) {
+ xmlFree(account_small_icon);
+ account_small_icon = NULL;
+ }
+ }
+
+ if (section != NULL) {
+ xmlFree(section);
+ section = NULL;
}
} else if ((!xmlStrcmp(cur_ptr->name, _NODE_LABEL))) {
// Node: <label>
_SECURE_D("Node: %s", cur_ptr->name);
// Attribute: xml:lang
- xmlChar* xml_lang = xmlNodeGetLang(cur_ptr);
+ xml_lang = xmlNodeGetLang(cur_ptr);
if (xml_lang != NULL) {
_SECURE_D("Attribute: xml:lang - %s", xml_lang);
g_strfreev(tokens);
- xmlChar* xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
+ xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
if (xml_label == NULL) {
ret = -1;
g_free(converted_lang);
g_free(converted_lang);
} else {
- xmlChar* xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
+ xml_label = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
if (xml_label == NULL) {
ret = -1;
_E("Failed to get the value.");
goto CATCH;
}
}
+
+ if (xml_lang != NULL) {
+ xmlFree(xml_lang);
+ xml_lang = NULL;
+ }
+ if (xml_label != NULL) {
+ xmlFree(xml_label);
+ xml_label = NULL;
+ }
+
} else if ((!xmlStrcmp(cur_ptr->name, _NODE_CAPABILITY))) {
// Node: <capability>
_SECURE_D("Node: %s", cur_ptr->name);
- xmlChar* xml_capability = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
+ xml_capability = xmlNodeListGetString(docPtr, cur_ptr->xmlChildrenNode, 1);
if (xml_capability == NULL) {
ret = -1;
_E("Failed to get the value.");
_E("[%d]Failed to set the capability.", ret);
goto CATCH;
}
- }
+ if (xml_capability != NULL) {
+ xmlFree(xml_capability);
+ xml_capability = NULL;
+ }
+ }
cur_ptr = cur_ptr->next;
}
+ if (attribute_app_id != NULL) {
+ xmlFree(attribute_app_id);
+ attribute_app_id = NULL;
+ }
+ if (attribute_provider_id != NULL) {
+ xmlFree(attribute_provider_id);
+ attribute_provider_id = NULL;
+ }
+ if (multiple_accounts_support != NULL) {
+ xmlFree(multiple_accounts_support);
+ multiple_accounts_support = NULL;
+ }
+
break;
}
return 0;
CATCH:
+ if (attribute_app_id != NULL) {
+ xmlFree(attribute_app_id);
+ attribute_app_id = NULL;
+ }
+ if (attribute_provider_id != NULL) {
+ xmlFree(attribute_provider_id);
+ attribute_provider_id = NULL;
+ }
+ if (multiple_accounts_support != NULL) {
+ xmlFree(multiple_accounts_support);
+ multiple_accounts_support = NULL;
+ }
+ if (section != NULL) {
+ xmlFree(section);
+ section = NULL;
+ }
+ if (account_icon != NULL) {
+ xmlFree(account_icon);
+ account_icon = NULL;
+ }
+ if (account_small_icon != NULL) {
+ xmlFree(account_small_icon);
+ account_small_icon = NULL;
+ }
+ if (xml_lang != NULL) {
+ xmlFree(xml_lang);
+ xml_lang = NULL;
+ }
+ if (xml_label != NULL) {
+ xmlFree(xml_label);
+ xml_label = NULL;
+ }
+ if (xml_capability != NULL) {
+ xmlFree(xml_capability);
+ xml_capability = NULL;
+ }
+
ret2 = account_type_destroy(account_type_handle);
retvm_if(ret2 != ACCOUNT_ERROR_NONE, ret2, "[%d]Failed to perform account_type_destroy().", ret2);