goto err_internal_error;
err_none:
- *string_id = strdup(temp);
- TryReturn(*string_id != NULL, free(temp), PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation is failed.");
+ if (strlen(temp) == 0) {
+ *string_id = NULL;
+ } else {
+ *string_id = strdup(temp);
+ TryReturn(*string_id != NULL, free(temp), PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation is failed.");
+ }
free(temp);
return PRVINFO_ERROR_NONE;
TryReturn(*display_name != NULL, free(tempPrivilege), PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
free(tempPrivilege);
} else if (ret == PRVINFO_ERROR_NONE) {
+ TryReturn(string_id != NULL, *display_name = NULL, PRVINFO_ERROR_NONE, "No DID for privilege : %s", privilege);
ret = privilege_info_get_string_by_string_id(string_id, display_name);
free(string_id);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
ret = privilege_info_get_string_by_string_id("IDS_TPLATFORM_BODY_THIS_PRIVILEGE_IS_NOT_DEFINED", description);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
} else if (ret == PRVINFO_ERROR_NONE) {
+ TryReturn(string_id != NULL, *description = NULL, PRVINFO_ERROR_NONE, "No DID for privilege : %s", privilege);
ret = privilege_info_get_string_by_string_id(string_id, description);
free(string_id);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
TryReturn(*display_name != NULL, free(tempPrivilege), PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
free(tempPrivilege);
} else if (ret == PRVINFO_ERROR_NONE) {
+ TryReturn(string_id != NULL, *display_name = NULL, PRVINFO_ERROR_NONE, "No DID for privilege : %s", privilege);
ret = privilege_info_get_string_by_string_id(string_id, display_name);
free(string_id);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
ret = privilege_info_get_string_by_string_id("IDS_TPLATFORM_BODY_THIS_PRIVILEGE_IS_NOT_DEFINED", description);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");
} else if (ret == PRVINFO_ERROR_NONE) {
+ TryReturn(string_id != NULL, *description = NULL, PRVINFO_ERROR_NONE, "No DID for privilege : %s", privilege);
ret = privilege_info_get_string_by_string_id(string_id, description);
free(string_id);
TryReturn(ret == PRVINFO_ERROR_NONE, , PRVINFO_ERROR_OUT_OF_MEMORY, "[PRVINFO_ERROR_OUT_OF_MEMORY] Memory allocation failed.");