core/dhcp: use gs_free_error in NMDhcpDhcpcd's ip4_start()

It just seems less error prone. Use the cleanup attribute.
This commit is contained in:
Thomas Haller 2022-03-09 23:14:24 +01:00
parent fd50323232
commit 63664719be
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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;
}