mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-04 18:48:13 +02:00
2008-10-20 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c - (nm_dhcp_manager_get): fix mismatched refcount; creating the dhcp manager object already refs it once - (nm_dhcp_manager_cancel_transaction_real): clear freed variables that also get cleaned up by nm_dhcp_device_destroy() to prevent double-frees git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4196 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
831a6fae57
commit
84387ad613
2 changed files with 16 additions and 1 deletions
|
|
@ -1,3 +1,12 @@
|
|||
2008-10-20 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/dhcp-manager/nm-dhcp-manager.c
|
||||
- (nm_dhcp_manager_get): fix mismatched refcount; creating the dhcp
|
||||
manager object already refs it once
|
||||
- (nm_dhcp_manager_cancel_transaction_real): clear freed variables that
|
||||
also get cleaned up by nm_dhcp_device_destroy() to prevent
|
||||
double-frees
|
||||
|
||||
2008-10-20 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* src/nm-manager.c
|
||||
|
|
|
|||
|
|
@ -77,8 +77,10 @@ nm_dhcp_manager_get (void)
|
|||
|
||||
if (!singleton)
|
||||
singleton = nm_dhcp_manager_new ();
|
||||
g_object_ref (singleton);
|
||||
else
|
||||
g_object_ref (singleton);
|
||||
|
||||
g_assert (singleton);
|
||||
return singleton;
|
||||
}
|
||||
|
||||
|
|
@ -185,6 +187,7 @@ nm_dhcp_device_destroy (NMDHCPDevice *device)
|
|||
g_free (device->pid_file);
|
||||
g_free (device->lease_file);
|
||||
g_free (device->iface);
|
||||
|
||||
g_slice_free (NMDHCPDevice, device);
|
||||
}
|
||||
|
||||
|
|
@ -667,18 +670,21 @@ nm_dhcp_manager_cancel_transaction_real (NMDHCPDevice *device)
|
|||
if (device->pid_file) {
|
||||
remove (device->pid_file);
|
||||
g_free (device->pid_file);
|
||||
device->pid_file = NULL;
|
||||
}
|
||||
|
||||
/* Clean up the leasefile if it got left around */
|
||||
if (device->lease_file) {
|
||||
remove (device->lease_file);
|
||||
g_free (device->lease_file);
|
||||
device->lease_file = NULL;
|
||||
}
|
||||
|
||||
/* Clean up config file if it got left around */
|
||||
if (device->conf_file) {
|
||||
remove (device->conf_file);
|
||||
g_free (device->conf_file);
|
||||
device->conf_file = NULL;
|
||||
}
|
||||
|
||||
nm_dhcp_device_watch_cleanup (device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue