Coverity Fixes in BTAPI and BTHAL
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-gatt-client.c
index 9daa2eb..c0f5620 100755 (executable)
@@ -2412,7 +2412,7 @@ BT_EXPORT_API int bluetooth_gatt_client_set_service_change_watcher(
                if (_bluetooth_gatt_check_service_change_watcher_address(address)
                                == TRUE) {
                        BT_INFO("The watcher is already set");
-                       return BLUETOOTH_ERROR_NONE;
+                       goto done;
                }
 
                if (service_monitor_list == NULL) {
@@ -2452,6 +2452,7 @@ BT_EXPORT_API int bluetooth_gatt_client_set_service_change_watcher(
                }
        }
 
+done:
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
        return result;
 }