From 580a11da3a5ea8b56e7714e3ebb34eb4149a456d Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 11 Apr 2018 17:16:28 +0200 Subject: [PATCH] core: minor cleanup of handling specific-object in NMActiveConnection - use nm_assert() for something that ~really~ always should be given. - use nm_streq0() and nm_clear_g_free(). --- src/nm-active-connection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/nm-active-connection.c b/src/nm-active-connection.c index be61c472ce..c6d6645d51 100644 --- a/src/nm-active-connection.c +++ b/src/nm-active-connection.c @@ -515,9 +515,9 @@ nm_active_connection_set_specific_object (NMActiveConnection *self, /* Nothing that calls this function should be using paths from D-Bus, * where NM uses "/" to mean NULL. */ - g_assert (g_strcmp0 (specific_object, "/") != 0); + nm_assert (!nm_streq0 (specific_object, "/")); - if (g_strcmp0 (priv->specific_object, specific_object) == 0) + if (nm_streq0 (priv->specific_object, specific_object)) return; g_free (priv->specific_object); @@ -1430,8 +1430,7 @@ dispose (GObject *object) auth_cancel (self); - g_free (priv->specific_object); - priv->specific_object = NULL; + nm_clear_g_free (&priv->specific_object); _set_settings_connection (self, NULL); g_clear_object (&priv->applied_connection);