Implement set / get volume logic from transport
[platform/core/connectivity/bluetooth-frwk.git] / bt-otp / bt-otpserver.c
index c588be9..ae40cef 100644 (file)
@@ -1188,8 +1188,6 @@ void _bt_otp_create_new_object(uint32_t size, char *uuid)
        curr_obj_index = g_slist_length(otp_object_list) - 1;
        curr_obj_id = selected_object->id;
        object_id++;
-
-       free(uuid);
 }
 
 void _bt_otp_restore_old_object()
@@ -1224,7 +1222,7 @@ int _bt_otp_oacp_write_cb(char *value, int len, int offset,
        int opcode = value[0];
        uint32_t object_offset, length, object_size;
        uint8_t mode = 0;
-       char *uuid;
+       char *uuid = NULL;
        char absolute_file_path[BT_FILE_PATH_MAX_LEN] = {0, };
 
        BT_INFO("OACP Opcode 0x%d", opcode);
@@ -1258,6 +1256,7 @@ int _bt_otp_oacp_write_cb(char *value, int len, int offset,
 
                oacp_create = TRUE;
                _bt_otp_create_new_object(object_size, uuid);
+               g_free(uuid);
 
                if (oacp_create_timeout_id > 0)
                        g_source_remove(oacp_create_timeout_id);
@@ -1972,6 +1971,7 @@ void _bt_otp_gatt_char_property_changed_event(GVariant *msg,
                                } else {
                                        BT_ERR("Array Len 0");
                                }
+                               g_variant_unref(val);
                        } else {
                                BT_ERR("var==NULL");
                        }
@@ -2133,6 +2133,7 @@ void _bt_otp_device_property_event_filter(GDBusConnection *connection,
                        }
                }
        }
+       g_variant_unref(val);
 }
 
 int _bt_otp_init_event_receiver()