diff options
author | Thomas Haller <thaller@redhat.com> | 2014-09-30 11:13:26 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-09-30 11:13:26 +0200 |
commit | d8541d17be028cbd9dc29b962a854ca3b69dfa3c (patch) | |
tree | 77bab5434977634f97d3213376e5681c32d18b71 /src/nm-dbus-manager.c | |
parent | 4cc3c6ab71cc9d89c3345752bd26262d60f636e4 (diff) | |
download | NetworkManager-d8541d17be028cbd9dc29b962a854ca3b69dfa3c.tar.gz |
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 <thaller@redhat.com>
Diffstat (limited to 'src/nm-dbus-manager.c')
-rw-r--r-- | src/nm-dbus-manager.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nm-dbus-manager.c b/src/nm-dbus-manager.c index d6e4abf662..2a3bfe3026 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)); |