From ab0c34497889634785b9c2c7efbbc5067363c18f Mon Sep 17 00:00:00 2001 From: JongHeon Choi Date: Mon, 28 Aug 2017 19:01:38 +0900 Subject: [PATCH] Add null check Change-Id: I94bb4d6f6a3b56e71bc25b7f2a9bf5ba6f233b2c --- NativeLauncher/installer-plugin/common.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NativeLauncher/installer-plugin/common.cc b/NativeLauncher/installer-plugin/common.cc index 8ba2a09..74b6f18 100644 --- a/NativeLauncher/installer-plugin/common.cc +++ b/NativeLauncher/installer-plugin/common.cc @@ -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); -- 2.7.4