From 3d0c5f19d08057ec5e77bf5aa601bd42a99eb808 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 19 Nov 2008 15:43:12 +0200 Subject: [PATCH] obexd: Use g_malloc and g_new where appropriate --- obexd/src/bluetooth.c | 2 +- obexd/src/main.c | 2 +- obexd/src/obex.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/obexd/src/bluetooth.c b/obexd/src/bluetooth.c index d6f7d820a..0b0037b8f 100644 --- a/obexd/src/bluetooth.c +++ b/obexd/src/bluetooth.c @@ -177,7 +177,7 @@ static gint server_register(guint16 service, const gchar *name, guint8 channel, uint32_t handle; int err; - server = g_malloc0(sizeof(struct server)); + server = g_new0(struct server, 1); server->services = service; server->name = g_strdup(name); server->folder = g_strdup(folder); diff --git a/obexd/src/main.c b/obexd/src/main.c index cb38b98fc..b2c308a26 100644 --- a/obexd/src/main.c +++ b/obexd/src/main.c @@ -88,7 +88,7 @@ int tty_init(int services, const gchar *root_path, cfmakeraw(&options); tcsetattr(fd, TCSANOW, &options); - server = g_malloc0(sizeof(struct server)); + server = g_new0(struct server, 1); server->services = services; server->folder = g_strdup(root_path); server->auto_accept = TRUE; diff --git a/obexd/src/obex.c b/obexd/src/obex.c index 9acf24656..84409ff18 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -438,7 +438,7 @@ gboolean os_prepare_get(struct obex_session *os, gchar *file, guint32 *size) os->offset = 0; if (stats.st_size > 0) - os->buf = g_new0(guint8, os->tx_mtu); + os->buf = g_malloc0(os->tx_mtu); *size = stats.st_size; -- 2.47.3