From b82dd151b2a94caaca78e826e65694852e9f6cf9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 25 Nov 2013 15:18:02 -0600 Subject: trivial: fix leak in hostname reverse-lookup code g_inet_address_to_string() returns an allocated value. --- src/nm-policy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nm-policy.c b/src/nm-policy.c index 677f8f9e9e..3c09a04513 100644 --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -1939,8 +1939,10 @@ dns_config_changed (NMDnsManager *dns_manager, gpointer user_data) /* Re-start the hostname lookup thread if we don't have hostname yet. */ if (priv->lookup_addr) { - nm_log_dbg (LOGD_DNS, "restarting reverse-lookup thread for address %s'", - g_inet_address_to_string (priv->lookup_addr)); + char *str = g_inet_address_to_string (priv->lookup_addr); + + nm_log_dbg (LOGD_DNS, "restarting reverse-lookup thread for address %s", str); + g_free (str); priv->lookup_cancellable = g_cancellable_new (); g_resolver_lookup_by_address_async (priv->resolver, -- cgit v1.2.1