[nbs] fix svace issue WGID 158431 54/103354/2
authorHyunjin Park <hj.na.park@samsung.com>
Thu, 8 Dec 2016 06:17:16 +0000 (15:17 +0900)
committerHyunjin Park <hj.na.park@samsung.com>
Thu, 8 Dec 2016 06:22:26 +0000 (15:22 +0900)
- MEMORY_LEAK.STRDUP

[verification] test result of web TCT is 100% passed.

Change-Id: I1806e9e7da2e9285f9eea2ae5c9d4ad70427ead4

src/networkbearerselection/networkbearerselection_manager.cc

index 1c4903b..34b23e1 100644 (file)
@@ -268,6 +268,10 @@ void NetworkBearerSelectionManager::requestRouteToHost(
   if (connection_profile_get_name(profileHandle, &currentProfileName_c) !=
       CONNECTION_ERROR_NONE) {
     LoggerE("Fail to get current profile name");
+    if (currentProfileName_c != nullptr) {
+      free(currentProfileName_c);
+      currentProfileName_c = nullptr;
+    }
     makeErrorCallback(domain_name, kPlatformError);
     return;
   }