Network: fix a refcounting bug with vpn settings

nm_connection_get_setting_by_name() does not return a reference,
so we have to get one ourselves.
This commit is contained in:
Matthias Clasen 2011-03-15 21:07:51 -04:00
parent eeb6193248
commit ea5f76247d

View file

@ -66,7 +66,7 @@ net_vpn_set_connection (NetVpn *vpn, NMConnection *connection)
G_CALLBACK (connection_state_changed_cb),
vpn);
}
priv->setting = NM_SETTING_VPN (nm_connection_get_setting_by_name (connection, "vpn"));
priv->setting = NM_SETTING_VPN (g_object_ref (nm_connection_get_setting_by_name (connection, "vpn")));
}
NMConnection *