From ae6388344694f5e068172e6f8c1d48b0cf4bfb05 Mon Sep 17 00:00:00 2001 From: Kyungwook Tak Date: Fri, 6 Jan 2017 17:15:47 +0900 Subject: [PATCH] Remove std::nothrow from ASLR enabled bin 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 --- tappsd/src/db/DTapps2SqliteDB.cpp | 9 +++++---- 1 file 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 pDBConnectionInfo( - new(std::nothrow) DtappsDBConnectionInfo); - - if (pDBConnectionInfo == NULL) + std::unique_ptr pDBConnectionInfo; + try { + pDBConnectionInfo.reset(new DtappsDBConnectionInfo); + } catch (const std::bad_alloc &) { return FALSE; + } DRM_TAPPS_FRQ_LOG("Opening DB connection."); -- 2.7.4