summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-19 15:43:12 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-19 15:43:12 +0200
commit7275aef0fd47fde3cc7a2b976bc990c1791a10fa (patch)
treec6f7cd0d46971859ed76d59d43361adca660b094
parentd7f6a828761b82721415ea2a21defc989ef9fe70 (diff)
downloadobexd-7275aef0fd47fde3cc7a2b976bc990c1791a10fa.tar.gz
Use g_malloc and g_new where appropriate
-rw-r--r--src/bluetooth.c2
-rw-r--r--src/main.c2
-rw-r--r--src/obex.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/src/bluetooth.c b/src/bluetooth.c
index d6f7d82..0b0037b 100644
--- a/src/bluetooth.c
+++ b/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/src/main.c b/src/main.c
index cb38b98..b2c308a 100644
--- a/src/main.c
+++ b/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/src/obex.c b/src/obex.c
index 9acf246..84409ff 100644
--- a/src/obex.c
+++ b/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;