summaryrefslogtreecommitdiffstats
path: root/network/manager.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-05 18:58:41 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2007-04-05 18:58:41 +0000
commit6b9efc12eaf7ae2196bf7b80f3fc33366f97390e (patch)
treed49314e33fcbd859c85c9643ff1d943a371d5565 /network/manager.c
parenta2ace90c14ede86b8179a930fb104de4aca93849 (diff)
network: missing pending_reply initialization and connection ref/unref
Diffstat (limited to 'network/manager.c')
-rw-r--r--network/manager.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/network/manager.c b/network/manager.c
index 1cbb9c70..408e0ab3 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -68,12 +68,14 @@ static void pending_reply_free(struct pending_reply *pr)
{
if (pr->addr)
g_free(pr->addr);
-
if (pr->path)
g_free(pr->path);
-
if (pr->adapter_path)
g_free(pr->adapter_path);
+ if (pr->msg)
+ dbus_message_unref(pr->msg);
+ if (pr->conn)
+ dbus_connection_unref(pr->conn);
}
static DBusHandlerResult create_path(DBusConnection *conn,
@@ -484,8 +486,8 @@ static DBusHandlerResult create_server(DBusConnection *conn,
if ((id != BNEP_SVC_GN) && (id != BNEP_SVC_NAP))
return err_invalid_args(conn, msg, "Not supported");
- pr = g_new(struct pending_reply, 1);
- pr->conn = conn;
+ pr = g_new0(struct pending_reply, 1);
+ pr->conn = dbus_connection_ref(conn);;
pr->msg = dbus_message_ref(msg);
pr->mgr = mgr;
pr->addr = NULL;
@@ -549,8 +551,8 @@ static DBusHandlerResult create_connection(DBusConnection *conn,
if ((id != BNEP_SVC_GN) && (id != BNEP_SVC_NAP))
return err_invalid_args(conn, msg, "Not supported");
- pr = g_new(struct pending_reply, 1);
- pr->conn = conn;
+ pr = g_new0(struct pending_reply, 1);
+ pr->conn = dbus_connection_ref(conn);
pr->msg = dbus_message_ref(msg);
pr->mgr = mgr;
pr->addr = g_strdup(addr);