summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyungwook Tak <k.tak@samsung.com>2017-01-06 17:15:47 +0900
committerkyungwook tak <k.tak@samsung.com>2017-01-06 00:21:52 -0800
commitae6388344694f5e068172e6f8c1d48b0cf4bfb05 (patch)
tree93fc67022148e55ed09ae8163984e894dc6ccefd
parenteb3377ead579ea16045fb6c49f9fd6b26947cfc3 (diff)
downloaddrm-service-core-tizen-accepted/tizen/unified/20170309.033147.tar.gz
drm-service-core-tizen-accepted/tizen/unified/20170309.033147.tar.bz2
drm-service-core-tizen-accepted/tizen/unified/20170309.033147.zip
std::nothrow in glibc from gcc6.2 cannot linked with ASLR enabled executable in x86 series architectures but don't know why... So just use default new and handle std::bad_alloc. Change-Id: I21191c108e94be4ca2c7157807407f8f6ec5f4d3 Signed-off-by: Kyungwook Tak <k.tak@samsung.com>
-rw-r--r--tappsd/src/db/DTapps2SqliteDB.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tappsd/src/db/DTapps2SqliteDB.cpp b/tappsd/src/db/DTapps2SqliteDB.cpp
index 31d78e0..51e2653 100644
--- a/tappsd/src/db/DTapps2SqliteDB.cpp
+++ b/tappsd/src/db/DTapps2SqliteDB.cpp
@@ -104,11 +104,12 @@ BOOL DTappsDBOpen(void *&pDb, const char *CallingFun)
pDb = pDBConnectionInfo->pDBConnection;
} else {
DRM_TAPPS_LOG("no connection exists..");
- std::unique_ptr<DtappsDBConnectionInfo> pDBConnectionInfo(
- new(std::nothrow) DtappsDBConnectionInfo);
-
- if (pDBConnectionInfo == NULL)
+ std::unique_ptr<DtappsDBConnectionInfo> pDBConnectionInfo;
+ try {
+ pDBConnectionInfo.reset(new DtappsDBConnectionInfo);
+ } catch (const std::bad_alloc &) {
return FALSE;
+ }
DRM_TAPPS_FRQ_LOG("Opening DB connection.");