Merge "Revert "Fix prevent defect for locales"" into tizen_2.2
[platform/framework/native/appfw.git] / src / security / FSec_PrivilegeInfo.cpp
index 1cb7d72..48b125b 100644 (file)
@@ -98,6 +98,10 @@ _PrivilegeInfo::Construct(const AppId& appId, const byte* pBitwisePrivilege, con
                SysTryReturnResult(NID_SEC, ret == PRVMGR_ERR_NONE, E_SYSTEM, "An unexpected system error occurred.");
 
                __privilegeList.Add((new String(*pTempString)), (new String(pPrivilegeLevel)));
+               if (pPrivilegeLevel != null)
+               {
+                       free(pPrivilegeLevel);
+               }
        }
 
        return r;
@@ -165,6 +169,10 @@ _PrivilegeInfo::Construct(const AppId& appId, const String& encryptedPrivileges,
                SysTryReturnResult(NID_SEC, ret == PRVMGR_ERR_NONE, E_SYSTEM, "An unexpected system error occurred.");
 
                __privilegeList.Add((new String(*pTempString)), (new String(pPrivilegeLevel)));
+               if (pPrivilegeLevel != null)
+               {
+                       free(pPrivilegeLevel);
+               }
        }
 
        return r;
@@ -265,6 +273,10 @@ _PrivilegeInfo::Construct(const AppId& appId, const String& encryptedPrivileges,
                SysTryReturnResult(NID_SEC, ret == PRVMGR_ERR_NONE, E_SYSTEM, "An unexpected system error occurred.");
 
                __privilegeList.Add((new String(*pTempString)), (new String(pPrivilegeLevel)));
+               if (pPrivilegeLevel != null)
+               {
+                       free(pPrivilegeLevel);
+               }
        }
 
        return r;