Remove std::nothrow from ASLR enabled bin 37/108937/3 accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable accepted/tizen/common/20170109.202447 accepted/tizen/ivi/20170109.084941 accepted/tizen/mobile/20170109.084837 accepted/tizen/tv/20170109.084904 accepted/tizen/unified/20170309.033147 accepted/tizen/wearable/20170109.084922 submit/tizen/20170109.064234 submit/tizen_unified/20170308.100408
authorKyungwook Tak <k.tak@samsung.com>
Fri, 6 Jan 2017 08:15:47 +0000 (17:15 +0900)
committerkyungwook tak <k.tak@samsung.com>
Fri, 6 Jan 2017 08:21:52 +0000 (00:21 -0800)
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>
tappsd/src/db/DTapps2SqliteDB.cpp

index 31d78e0..51e2653 100644 (file)
@@ -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.");