~lkundrak/network-manager/launchpad-stable-1.8

« back to all changes in this revision

Viewing changes to src/dhcp/nm-dhcp-dhclient.c

  • Committer: Thomas Haller
  • Date: 2018-09-10 12:39:41 UTC
  • Revision ID: git-v1:091ca562f2c3370defcd574ed380e693eecd7993
dhcp: fix leak in dhclient's dhclient_start()

Fixes: 5d6d5cd136e36ed2815b7c719ada32bc6d22b481
(cherry picked from commit c87faf07a10900804b914057a2673e0e070b0af4)
(cherry picked from commit 8f9240de966e431c2b7623e88a4e37700086d355)
(cherry picked from commit c740726b570c004635c43bc50c5dbbcde10cfd2e)
(cherry picked from commit 0a69572cae6c2154a178de17c82674b14565cfaa)

Show diffs side-by-side

added added

removed removed

Lines of Context:
386
386
                if (g_file_copy (src, dst, G_FILE_COPY_OVERWRITE, NULL, NULL, NULL, &error)) {
387
387
                        /* Success; use the preferred leasefile path */
388
388
                        g_free (priv->lease_file);
389
 
                        priv->lease_file = g_strdup (g_file_get_path (dst));
 
389
                        priv->lease_file = g_file_get_path (dst);
390
390
                } else {
 
391
                        gs_free char *s_path = NULL;
 
392
                        gs_free char *d_path = NULL;
 
393
 
391
394
                        /* Failure; just use the existing leasefile */
392
395
                        _LOGW ("failed to copy leasefile %s to %s: %s",
393
 
                               g_file_get_path (src), g_file_get_path (dst),
 
396
                               (s_path = g_file_get_path (src)),
 
397
                               (d_path = g_file_get_path (dst)),
394
398
                               error->message);
395
399
                        g_clear_error (&error);
396
400
                }