summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-adapter.c2
-rw-r--r--hcid/dbus-database.c12
-rw-r--r--hcid/dbus-hci.c26
-rw-r--r--hcid/dbus-manager.c2
-rw-r--r--hcid/dbus-security.c12
-rw-r--r--hcid/dbus-test.c4
6 files changed, 28 insertions, 30 deletions
diff --git a/hcid/dbus-adapter.c b/hcid/dbus-adapter.c
index 81f6bc35..d94c43b9 100644
--- a/hcid/dbus-adapter.c
+++ b/hcid/dbus-adapter.c
@@ -1716,7 +1716,7 @@ void dc_pending_timeout_cleanup(struct adapter *adapter)
{
dbus_connection_unref(adapter->pending_dc->conn);
dbus_message_unref(adapter->pending_dc->msg);
- free(adapter->pending_dc);
+ g_free(adapter->pending_dc);
adapter->pending_dc = NULL;
}
diff --git a/hcid/dbus-database.c b/hcid/dbus-database.c
index ab3a6938..86053915 100644
--- a/hcid/dbus-database.c
+++ b/hcid/dbus-database.c
@@ -84,7 +84,7 @@ static void exit_callback(const char *name, void *user_data)
if (user_record->sender)
g_free(user_record->sender);
- free(user_record);
+ g_free(user_record);
}
static DBusHandlerResult add_service_record(DBusConnection *conn,
@@ -111,20 +111,20 @@ static DBusHandlerResult add_service_record(DBusConnection *conn,
sdp_record = sdp_extract_pdu(record, &scanned);
if (!sdp_record) {
error("Parsing of service record failed");
- free(user_record);
+ g_free(user_record);
return error_failed(conn, msg, EIO);
}
if (scanned != len) {
error("Size mismatch of service record");
- free(user_record);
+ g_free(user_record);
sdp_record_free(sdp_record);
return error_failed(conn, msg, EIO);
}
if (add_record_to_server(sdp_record) < 0) {
error("Failed to register service record");
- free(user_record);
+ g_free(user_record);
sdp_record_free(sdp_record);
return error_failed(conn, msg, EIO);
}
@@ -136,7 +136,7 @@ static DBusHandlerResult add_service_record(DBusConnection *conn,
if (register_sdp_binary((uint8_t *) record, size,
&user_record->handle) < 0) {
error("Failed to register service record");
- free(user_record);
+ g_free(user_record);
return error_failed(conn, msg, errno);
}
}
@@ -250,7 +250,7 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn,
if (user_record->sender)
g_free(user_record->sender);
- free(user_record);
+ g_free(user_record);
reply = dbus_message_new_method_return(msg);
if (!reply)
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 5db47f4f..3d53b901 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -71,7 +71,7 @@ void bonding_request_free(struct bonding_request_info *bonding)
if (bonding->io)
g_io_channel_unref(bonding->io);
- free(bonding);
+ g_free(bonding);
}
int found_device_cmp(const struct remote_dev_info *d1,
@@ -159,7 +159,7 @@ static int found_device_remove(GSList **list, bdaddr_t *bdaddr)
dev = l->data;
*list = g_slist_remove(*list, dev);
- free(dev);
+ g_free(dev);
return 0;
}
@@ -421,7 +421,7 @@ int unregister_adapter_path(const char *path)
name_listener_remove(connection,
adapter->discov_requestor,
(name_cb_t) discover_devices_req_exit, adapter);
- free(adapter->discov_requestor);
+ g_free(adapter->discov_requestor);
adapter->discov_requestor = NULL;
}
@@ -430,7 +430,7 @@ int unregister_adapter_path(const char *path)
adapter->pdiscov_requestor,
(name_cb_t) periodic_discover_req_exit,
adapter);
- free(adapter->pdiscov_requestor);
+ g_free(adapter->pdiscov_requestor);
adapter->pdiscov_requestor = NULL;
}
@@ -510,7 +510,7 @@ int hcid_dbus_register_device(uint16_t id)
if (!dbus_connection_register_object_path(connection, path,
&adapter_vtable, adapter)) {
error("D-Bus failed to register %s object", path);
- free(adapter);
+ g_free(adapter);
return -1;
}
@@ -718,7 +718,7 @@ int hcid_dbus_stop_device(uint16_t id)
name_listener_remove(connection, adapter->discov_requestor,
(name_cb_t) discover_devices_req_exit,
adapter);
- free(adapter->discov_requestor);
+ g_free(adapter->discov_requestor);
adapter->discov_requestor = NULL;
}
@@ -726,7 +726,7 @@ int hcid_dbus_stop_device(uint16_t id)
name_listener_remove(connection, adapter->pdiscov_requestor,
(name_cb_t) periodic_discover_req_exit,
adapter);
- free(adapter->pdiscov_requestor);
+ g_free(adapter->pdiscov_requestor);
adapter->pdiscov_requestor = NULL;
}
@@ -1171,7 +1171,7 @@ void hcid_dbus_inquiry_complete(bdaddr_t *local)
if (adapter->discov_requestor) {
name_listener_remove(connection, adapter->discov_requestor,
(name_cb_t) discover_devices_req_exit, adapter);
- free(adapter->discov_requestor);
+ g_free(adapter->discov_requestor);
adapter->discov_requestor = NULL;
/* If there is a pending reply for discovery cancel */
@@ -1281,7 +1281,7 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status)
name_listener_remove(connection, adapter->pdiscov_requestor,
(name_cb_t) periodic_discover_req_exit,
adapter);
- free(adapter->pdiscov_requestor);
+ g_free(adapter->pdiscov_requestor);
adapter->pdiscov_requestor = NULL;
}
@@ -1376,7 +1376,7 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class,
char *dev = l->data;
adapter->oor_devices = g_slist_remove(adapter->oor_devices,
dev);
- free(dev);
+ g_free(dev);
}
}
@@ -1414,7 +1414,7 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class,
name_status = NAME_NOT_REQUIRED;
if (name)
- free(name);
+ g_free(name);
name = tmp_name;
} else {
@@ -1432,7 +1432,7 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class,
DBUS_TYPE_INVALID);
send_message_and_unref(connection, signal_name);
- free(name);
+ g_free(name);
if (name_type != 0x08)
name_status = NAME_SENT;
@@ -1538,7 +1538,7 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
if (adapter->discov_requestor) {
name_listener_remove(connection, adapter->discov_requestor,
(name_cb_t) discover_devices_req_exit, adapter);
- free(adapter->discov_requestor);
+ g_free(adapter->discov_requestor);
adapter->discov_requestor = NULL;
/* If there is a pending reply for discovery cancel */
diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c
index d061e85a..a24db32f 100644
--- a/hcid/dbus-manager.c
+++ b/hcid/dbus-manager.c
@@ -151,7 +151,7 @@ static DBusHandlerResult list_adapters(DBusConnection *conn,
if (ioctl(sk, HCIGETDEVLIST, dl) < 0) {
int err = errno;
close(sk);
- free(dl);
+ g_free(dl);
return error_failed(conn, msg, err);
}
diff --git a/hcid/dbus-security.c b/hcid/dbus-security.c
index 07a9490f..263517e1 100644
--- a/hcid/dbus-security.c
+++ b/hcid/dbus-security.c
@@ -119,18 +119,16 @@ static void passkey_agent_free(struct passkey_agent *agent)
if (!agent->exited)
release_agent(agent);
- if (agent->name)
- free(agent->name);
- if (agent->path)
- free(agent->path);
- if (agent->addr)
- free(agent->addr);
+ g_free(agent->name);
+ g_free(agent->path);
+ g_free(agent->addr);
+
if (agent->conn)
dbus_connection_unref(agent->conn);
g_slist_free(agent->pending_requests);
- free(agent);
+ g_free(agent);
}
static void agent_exited(const char *name, struct adapter *adapter)
diff --git a/hcid/dbus-test.c b/hcid/dbus-test.c
index 31b1392e..3d064c7f 100644
--- a/hcid/dbus-test.c
+++ b/hcid/dbus-test.c
@@ -107,9 +107,9 @@ static struct audit *audit_new(DBusConnection *conn, DBusMessage *msg,
static void audit_free(struct audit *audit)
{
- free(audit->requestor);
+ g_free(audit->requestor);
dbus_connection_unref(audit->conn);
- free(audit);
+ g_free(audit);
}
static void send_audit_status(struct audit *audit, const char *name)