Add null check 05/146405/1 submit/tizen/20170828.100558
authorJongHeon Choi <j-h.choi@samsung.com>
Mon, 28 Aug 2017 10:01:38 +0000 (19:01 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Mon, 28 Aug 2017 10:01:48 +0000 (19:01 +0900)
Change-Id: I94bb4d6f6a3b56e71bc25b7f2a9bf5ba6f233b2c

NativeLauncher/installer-plugin/common.cc

index 8ba2a09..74b6f18 100644 (file)
@@ -132,6 +132,10 @@ static void crossgen(const char* dllPath, const char* appPath)
                // get reference API directory ([DEVICE_API_DIR]/ref)
                int len = strlen(__DEVICE_API_DIR);
                char* refAPIDir = (char*)calloc(len + 4, 1);
+               if (!refAPIDir) {
+                       printf("fail to allocate memory for reference API directory\n");
+                       return;
+               }
                snprintf(refAPIDir, len + 4, "%s%s", __DEVICE_API_DIR, "/ref");
                tpaDir.push_back(refAPIDir);