From b4d2cfc5870ca5d24438cc762cecb5ef26d52c9a Mon Sep 17 00:00:00 2001 From: "Wonsik, Jung" Date: Mon, 26 Feb 2018 17:28:56 +0900 Subject: [PATCH] [tizen] Fix memory leak and for exception case. strdup() is used in app_get_resource_path() and the return value of the function is NULL sometimes. So, this patch is to fix for two cases. Change-Id: Ibf58a674a21bcde5a2b0ff5e0f952cd55fadadb9 --- dali/internal/adaptor/tizen/framework-tizen.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dali/internal/adaptor/tizen/framework-tizen.cpp b/dali/internal/adaptor/tizen/framework-tizen.cpp index d934bc8..4c7e03b 100644 --- a/dali/internal/adaptor/tizen/framework-tizen.cpp +++ b/dali/internal/adaptor/tizen/framework-tizen.cpp @@ -795,7 +795,12 @@ std::string Framework::GetResourcePath() { std::string resourcePath = ""; #if defined( TIZEN_PLATFORM_CONFIG_SUPPORTED ) && TIZEN_PLATFORM_CONFIG_SUPPORTED - resourcePath = app_get_resource_path(); + char* app_rsc_path = app_get_resource_path(); + if (app_rsc_path) + { + resourcePath = app_rsc_path; + free(app_rsc_path); + } #else // For backwards compatibility with older Tizen versions // "DALI_APPLICATION_PACKAGE" is used to get the already configured Application package path. -- 2.7.4