summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-12-16 17:39:17 +0100
committerThomas Haller <thaller@redhat.com>2019-12-16 17:42:23 +0100
commit4a3ca7115aabbbe9dfb649d116b06e3af73d4bdf (patch)
treeb12b081f6dff104a6fa0d91cb3890ed24a541235
parentec0adbfaf0175fc7f54b3f4a6035240a837651e6 (diff)
downloadNetworkManager-4a3ca7115aabbbe9dfb649d116b06e3af73d4bdf.tar.gz
all: fix wrong "gs_free GError *" declarations
This is a bug and leads either to a leak or a crash.
-rw-r--r--clients/cli/connections.c2
-rw-r--r--shared/nm-test-utils-impl.c2
-rw-r--r--src/devices/bluetooth/nm-bluez-manager.c4
-rw-r--r--src/devices/bluetooth/nm-bluez5-dun.c4
4 files changed, 6 insertions, 6 deletions
diff --git a/clients/cli/connections.c b/clients/cli/connections.c
index 25751c10dd..a4fbf6df3a 100644
--- a/clients/cli/connections.c
+++ b/clients/cli/connections.c
@@ -7649,7 +7649,7 @@ editor_menu_main (NmCli *nmc, NMConnection *connection, const char *connection_t
}
} else {
gs_free char *prop_name = NULL;
- gs_free GError *tmp_err = NULL;
+ gs_free_error GError *tmp_err = NULL;
prop_name = is_property_valid (ss, cmd_arg_p, &tmp_err);
if (prop_name) {
diff --git a/shared/nm-test-utils-impl.c b/shared/nm-test-utils-impl.c
index 6923238efc..0805d0b946 100644
--- a/shared/nm-test-utils-impl.c
+++ b/shared/nm-test-utils-impl.c
@@ -435,7 +435,7 @@ _nmtstc_client_new_cb (GObject *source_object,
static NMClient *
_nmtstc_client_new (gboolean sync)
{
- gs_free GError *error = NULL;
+ gs_free_error GError *error = NULL;
NMClient *client;
/* Create a NMClient instance synchronously, and arbitrarily use either
diff --git a/src/devices/bluetooth/nm-bluez-manager.c b/src/devices/bluetooth/nm-bluez-manager.c
index 0b606f0fb3..ef087d83e9 100644
--- a/src/devices/bluetooth/nm-bluez-manager.c
+++ b/src/devices/bluetooth/nm-bluez-manager.c
@@ -287,7 +287,7 @@ _network_server_register_req_data_complete (NetworkServerRegisterReqData *r_req_
nm_clear_g_cancellable (&r_req_data->int_cancellable);
if (r_req_data->callback) {
- gs_free GError *error_cancelled = NULL;
+ gs_free_error GError *error_cancelled = NULL;
if (g_cancellable_set_error_if_cancelled (r_req_data->ext_cancellable, &error_cancelled))
error = error_cancelled;
@@ -314,7 +314,7 @@ _device_connect_req_data_complete (DeviceConnectReqData *c_req_data,
nm_clear_g_source (&c_req_data->timeout_wait_connect_id);
if (c_req_data->callback) {
- gs_free GError *error_cancelled = NULL;
+ gs_free_error GError *error_cancelled = NULL;
if (g_cancellable_set_error_if_cancelled (c_req_data->ext_cancellable, &error_cancelled)) {
error = error_cancelled;
diff --git a/src/devices/bluetooth/nm-bluez5-dun.c b/src/devices/bluetooth/nm-bluez5-dun.c
index 063c3db575..3ddfb0ef44 100644
--- a/src/devices/bluetooth/nm-bluez5-dun.c
+++ b/src/devices/bluetooth/nm-bluez5-dun.c
@@ -268,7 +268,7 @@ _connect_socket_connect_cb (GIOChannel *stream,
gpointer user_data)
{
NMBluez5DunContext *context = user_data;
- gs_free GError *error = NULL;
+ gs_free_error GError *error = NULL;
int errsv = 0;
socklen_t slen = sizeof(errsv);
int r;
@@ -471,7 +471,7 @@ _connect_sdp_search_io_cb (GIOChannel *io_channel,
gpointer user_data)
{
NMBluez5DunContext *context = user_data;
- gs_free GError *error = NULL;
+ gs_free_error GError *error = NULL;
int errsv;
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {