[tizen] Fix memory leak and for exception case.
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / tizen / framework-tizen.cpp
index d934bc8..4c7e03b 100644 (file)
@@ -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.