From d8541d17be028cbd9dc29b962a854ca3b69dfa3c Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 30 Sep 2014 11:13:26 +0200 Subject: [PATCH] core/dbus: minor refactoring not to clone the string tag Since we already intenalize the @tag to a GQuark, just use the constant string, instead of duplicating the string. Signed-off-by: Thomas Haller --- src/nm-dbus-manager.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c index d6e4abf66..2a3bfe302 100644 --- a/src/nm-dbus-manager.c +++ b/src/nm-dbus-manager.c @@ -96,7 +96,7 @@ nm_dbus_manager_get (void) /**************************************************************/ struct _PrivateServer { - char *tag; + const char *tag; GQuark detail; char *address; DBusServer *server; @@ -208,8 +208,8 @@ private_server_new (const char *path, (GDestroyNotify) private_server_dbus_connection_destroy, g_free); s->manager = manager; - s->tag = g_strdup (tag); - s->detail = g_quark_from_string (s->tag); + s->detail = g_quark_from_string (tag); + s->tag = g_quark_to_string (s->detail); return s; } @@ -221,7 +221,6 @@ private_server_free (gpointer ptr) unlink (s->address); g_free (s->address); - g_free (s->tag); g_hash_table_destroy (s->connections); dbus_server_unref (s->server); memset (s, 0, sizeof (*s));