Fix memory leaks
authorhb.min <hb.min@samsung.com>
Mon, 15 Jul 2013 12:58:49 +0000 (21:58 +0900)
committerhb.min <hb.min@samsung.com>
Mon, 15 Jul 2013 12:58:49 +0000 (21:58 +0900)
Change-Id: Icdcf41ed2951a6ea5bba7ec862b0db27ff185980
Signed-off-by: hb.min <hb.min@samsung.com>
src/security/FSecPrivacyInfo.cpp
src/security/FSecPrivilegeInfo.cpp
src/security/FSec_PrivilegeInfo.cpp
src/security/FSec_PrivilegeInfoImpl.cpp

index 6fac720..9dc7b05 100755 (executable)
@@ -40,7 +40,7 @@ PrivacyInfo::PrivacyInfo(void)
 
 PrivacyInfo::~PrivacyInfo(void)
 {
-
+       delete __pImpl;
 }
 
 result
index f982070..1fe92d1 100755 (executable)
@@ -43,7 +43,7 @@ PrivilegeInfo::PrivilegeInfo(void)
 
 PrivilegeInfo::~PrivilegeInfo(void)
 {
-
+       delete __pImpl;
 }
 
 result
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;
index 9c2e0fa..87d17ac 100755 (executable)
@@ -139,8 +139,8 @@ _PrivilegeInfoImpl::CheckExternalPrivilege(const Tizen::Base::String& privilegeI
 
 CATCH:
 
-       delete pDb;
        delete pStmt;
+       delete pDb;
 
        return flag;
 }