summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-common.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-02-26 10:57:20 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-02-26 10:57:20 +0000
commit695443f8d5e0da5fbff3b44279a0ed6abafdf3bb (patch)
tree9b5c355ed0daa832cf50ad1d9b1f9f32a7b75366 /hcid/dbus-common.c
parent89bf31abc697eab5a05bd508a352193c73991476 (diff)
Use GLib memory allocation functions
Diffstat (limited to 'hcid/dbus-common.c')
-rw-r--r--hcid/dbus-common.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index aabd58cd..2c84a5b2 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -273,11 +273,7 @@ static gboolean system_bus_reconnect(void *data)
return TRUE;
}
- dl = malloc(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl));
- if (!dl) {
- error("Can't allocate memory");
- goto failed;
- }
+ dl = g_malloc0(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl));
dl->dev_num = HCI_MAX_DEV;
dr = dl->dev_req;
@@ -300,8 +296,7 @@ failed:
if (sk >= 0)
close(sk);
- if (dl)
- free(dl);
+ g_free(dl);
return ret_val;
}