Changes in getters functions for security manager policy entries
[platform/core/security/security-manager.git] / src / client / client-security-manager.cpp
index 87b0a74..56d4f23 100644 (file)
@@ -859,44 +859,29 @@ int security_manager_policy_update_req_add_entry(policy_update_req *p_req, const
 SECURITY_MANAGER_API
 const char *security_manager_policy_entry_get_user(policy_entry *p_entry)
 {
-    if (p_entry)
-        return strdup(p_entry->user.c_str());
-    else
-        return nullptr;
+    return p_entry ? p_entry->user.c_str() : nullptr;
 }
 
 SECURITY_MANAGER_API
 const char *security_manager_policy_entry_get_application(policy_entry *p_entry)
 {
-    if (p_entry)
-        return strdup(p_entry->appId.c_str());
-    else
-        return nullptr;
+    return p_entry ? p_entry->appId.c_str() : nullptr;
 }
 SECURITY_MANAGER_API
 const char *security_manager_policy_entry_get_privilege(policy_entry *p_entry)
 {
-    if (p_entry)
-        return strdup(p_entry->privilege.c_str());
-    else
-        return nullptr;
+    return p_entry ? p_entry->privilege.c_str() : nullptr;
 }
 SECURITY_MANAGER_API
 const char *security_manager_policy_entry_get_level(policy_entry *p_entry)
 {
-    if (p_entry)
-        return strdup(p_entry->currentLevel.c_str());
-    else
-        return nullptr;
+    return p_entry ? p_entry->currentLevel.c_str() : nullptr;
 }
 
 SECURITY_MANAGER_API
 const char *security_manager_policy_entry_get_max_level(policy_entry *p_entry)
 {
-    if (p_entry)
-        return strdup(p_entry->maxLevel.c_str());
-    else
-        return nullptr;
+    return p_entry ? p_entry->maxLevel.c_str() : nullptr;
 }
 
 SECURITY_MANAGER_API