Remove C++ template declarance from C linkage
[platform/core/security/drm-service-core-tizen.git] / tappsd / src / db / DTapps2SqliteDB.cpp
index 4789f07..e06b4ac 100644 (file)
@@ -114,7 +114,7 @@ BOOL DTappsDBOpen(void *&pDb, const char* CallingFun)
        else
        {
                DRM_TAPPS_LOG("no connection exists.. pairCount=[%ld]", pairCount);
-               pDBConnectionInfo = NEW DtappsDBConnectionInfo;
+               pDBConnectionInfo = new(std::nothrow) DtappsDBConnectionInfo;
                MTRY_BL(NULL != pDBConnectionInfo);
                IsMemAllocated = true;   // prevent fix
 
@@ -147,10 +147,9 @@ BOOL DTappsDBOpen(void *&pDb, const char* CallingFun)
 
 MCATCH_B
 
-       if (true == IsMemAllocated)
-       {
-               MDELETE(pDBConnectionInfo);
-       }
+       if (IsMemAllocated && pDBConnectionInfo)
+               delete pDBConnectionInfo;
+
        DRM_TAPPS_EXCEPTION("This fn fails");
 
        return FALSE;