Prevent Issue fixes
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-gatt-client.c
index 3f92e17..9e3d0d8 100755 (executable)
@@ -2327,19 +2327,18 @@ BT_EXPORT_API int bluetooth_gatt_client_watch_characteristics(
 
        if (result != BLUETOOTH_ERROR_NONE) {
                BT_ERR("Fail to send request");
+               BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
                return result;
        } else if (NULL == out_fd_list) {
                BT_ERR("out_fd_list is NULL");
+               result = BLUETOOTH_ERROR_INTERNAL;
 
        } else {
 
                int *fd_list_array;
                int len = 0;
                int mtu;
-               int fd = -1;;
-
-               if (!out_fd_list)
-                       return BLUETOOTH_ERROR_INTERNAL;
+               int fd = -1;
 
                fd_list_array = g_unix_fd_list_steal_fds(out_fd_list, &len);
                BT_INFO("Num fds in fd_list is : %d, fd_list[0]: %d", len, fd_list_array[0]);