trivial: plug some memory leaks

(review+ danw)
This commit is contained in:
Dan Williams 2013-02-24 18:08:38 +01:00
parent 5f626b1c56
commit 47d8db57b5
9 changed files with 14 additions and 2 deletions

View file

@ -216,6 +216,7 @@ finalize (GObject *object)
if (priv->bdaddr)
g_byte_array_free (priv->bdaddr, TRUE);
g_free (priv->type);
G_OBJECT_CLASS (nm_setting_bluetooth_parent_class)->finalize (object);
}

View file

@ -202,6 +202,7 @@ finalize (GObject *object)
{
NMSettingInfinibandPrivate *priv = NM_SETTING_INFINIBAND_GET_PRIVATE (object);
g_free (priv->carrier_detect);
g_free (priv->transport_mode);
if (priv->mac_address)
g_byte_array_free (priv->mac_address, TRUE);

View file

@ -667,6 +667,7 @@ finalize (GObject *object)
g_free (priv->iface_name);
g_free (priv->parent);
g_free (priv->carrier_detect);
nm_utils_slist_free (priv->ingress_priority_map, g_free);
nm_utils_slist_free (priv->egress_priority_map, g_free);
}

View file

@ -551,6 +551,7 @@ finalize (GObject *object)
g_free (priv->port);
g_free (priv->duplex);
g_free (priv->s390_nettype);
g_free (priv->carrier_detect);
g_hash_table_destroy (priv->s390_options);

View file

@ -450,6 +450,7 @@ update_permanent_hw_address (NMDevice *dev)
g_object_notify (G_OBJECT (dev), NM_DEVICE_ETHERNET_PERMANENT_HW_ADDRESS);
}
g_free (epaddr);
close (fd);
}

View file

@ -4517,6 +4517,7 @@ finalize (GObject *object)
g_object_unref (priv->fw_manager);
g_free (priv->udi);
g_free (priv->path);
g_free (priv->iface);
g_free (priv->ip_iface);
g_free (priv->driver);

View file

@ -75,6 +75,8 @@ nm_policy_hosts_clean_etc_hosts (void)
}
new = nm_policy_get_etc_hosts (contents, contents_len);
g_free (contents);
if (new && new->len) {
nm_log_dbg (LOGD_DNS, "Cleaning leftovers from /etc/hosts");

View file

@ -2660,7 +2660,7 @@ fill_8021x (shvarFile *ifcfg,
NMSetting8021x *s_8021x;
shvarFile *keys = NULL;
char *value;
char **list, **iter;
char **list = NULL, **iter;
value = svGetValue (ifcfg, "IEEE_8021X_EAP_METHODS", FALSE);
if (!value) {
@ -2719,7 +2719,6 @@ fill_8021x (shvarFile *ifcfg,
}
g_free (lower);
}
g_strfreev (list);
if (nm_setting_802_1x_get_num_eap_methods (s_8021x) == 0) {
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
@ -2727,11 +2726,15 @@ fill_8021x (shvarFile *ifcfg,
goto error;
}
if (list)
g_strfreev (list);
if (keys)
svCloseFile (keys);
return s_8021x;
error:
if (list)
g_strfreev (list);
if (keys)
svCloseFile (keys);
g_object_unref (s_8021x);

View file

@ -164,6 +164,7 @@ wifi_nl80211_deinit (WifiData *parent)
nl_socket_free (nl80211->nl_sock);
if (nl80211->nl_cb)
nl_cb_put (nl80211->nl_cb);
g_free (nl80211->freqs);
}
struct nl80211_iface_info {