mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-07 08:28:05 +02:00
dhcp: fix leak in dhclient's dhclient_start()
Fixes:5d6d5cd136(cherry picked from commitc87faf07a1) (cherry picked from commit8f9240de96)
This commit is contained in:
parent
3a2c6f81f6
commit
c740726b57
1 changed files with 6 additions and 2 deletions
|
|
@ -374,11 +374,15 @@ dhclient_start (NMDhcpClient *client,
|
||||||
if (g_file_copy (src, dst, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error)) {
|
if (g_file_copy (src, dst, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error)) {
|
||||||
/* Success; use the preferred leasefile path */
|
/* Success; use the preferred leasefile path */
|
||||||
g_free (priv->lease_file);
|
g_free (priv->lease_file);
|
||||||
priv->lease_file = g_strdup (g_file_get_path (dst));
|
priv->lease_file = g_file_get_path (dst);
|
||||||
} else {
|
} else {
|
||||||
|
gs_free char *s_path = NULL;
|
||||||
|
gs_free char *d_path = NULL;
|
||||||
|
|
||||||
/* Failure; just use the existing leasefile */
|
/* Failure; just use the existing leasefile */
|
||||||
_LOGW ("failed to copy leasefile %s to %s: %s",
|
_LOGW ("failed to copy leasefile %s to %s: %s",
|
||||||
g_file_get_path (src), g_file_get_path (dst),
|
(s_path = g_file_get_path (src)),
|
||||||
|
(d_path = g_file_get_path (dst)),
|
||||||
error->message);
|
error->message);
|
||||||
g_clear_error (&error);
|
g_clear_error (&error);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue