summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-03-09 23:14:24 +0100
committerThomas Haller <thaller@redhat.com>2022-03-09 23:14:39 +0100
commit63664719bee096a350b4633fd6ba20c8a0377155 (patch)
tree8912405ae22abc0c9438daddfe81647d7b03d2e5
parentfd50323232a2f754d8b62c84354d3f781f9a4e69 (diff)
downloadNetworkManager-63664719bee096a350b4633fd6ba20c8a0377155.tar.gz
core/dhcp: use gs_free_error in NMDhcpDhcpcd's ip4_start()
It just seems less error prone. Use the cleanup attribute.
-rw-r--r--src/core/dhcp/nm-dhcp-dhcpcd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/core/dhcp/nm-dhcp-dhcpcd.c b/src/core/dhcp/nm-dhcp-dhcpcd.c
index 4b3429ef67..280d9ce6d1 100644
--- a/src/core/dhcp/nm-dhcp-dhcpcd.c
+++ b/src/core/dhcp/nm-dhcp-dhcpcd.c
@@ -70,7 +70,7 @@ ip4_start(NMDhcpClient *client, GError **error)
const NMDhcpClientConfig *client_config;
gs_unref_ptrarray GPtrArray *argv = NULL;
pid_t pid;
- GError *local = NULL;
+ gs_free_error GError *local = NULL;
gs_free char *cmd_str = NULL;
const char *dhcpcd_path;
@@ -143,7 +143,6 @@ ip4_start(NMDhcpClient *client, GError **error)
NM_UTILS_ERROR_UNKNOWN,
"dhcpcd failed to start: %s",
local->message);
- g_error_free(local);
return FALSE;
}