summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2018-02-20 13:43:49 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2018-02-20 13:43:49 +0100
commit87b3a81ce18063eb3dbe5986ff8299fbe80e99b1 (patch)
tree7ac0dc0b61e920e08e9006981e22956457603204
parent5a316ca9e4392ecf517294c2695e5e7008750ee2 (diff)
downloadNetworkManager-bg/rh1543871.tar.gz
ovs: don't consume error in method callbackbg/rh1543871
The error should be freed by callback functions, but only _monitor_bridges_cb() actually does it. Simplify this by letting the caller own the error.
-rw-r--r--src/devices/ovs/nm-ovsdb.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c
index 08a8d2c1da..cd4f0be736 100644
--- a/src/devices/ovs/nm-ovsdb.c
+++ b/src/devices/ovs/nm-ovsdb.c
@@ -1299,15 +1299,13 @@ ovsdb_disconnect (NMOvsdb *self, gboolean is_disposing)
OvsdbMethodCall *call;
OvsdbMethodCallback callback;
gpointer user_data;
- GError *error;
+ gs_free_error GError *error = NULL;
_LOGD ("disconnecting from ovsdb");
+ nm_utils_error_set_cancelled (&error, is_disposing, "NMOvsdb");
while (priv->calls->len) {
- error = NULL;
call = &g_array_index (priv->calls, OvsdbMethodCall, priv->calls->len - 1);
- nm_utils_error_set_cancelled (&error, is_disposing, "NMOvsdb");
-
callback = call->callback;
user_data = call->user_data;
g_array_remove_index (priv->calls, priv->calls->len - 1);
@@ -1330,8 +1328,6 @@ _monitor_bridges_cb (NMOvsdb *self, json_t *result, GError *error, gpointer user
_LOGI ("%s", error->message);
ovsdb_disconnect (self, FALSE);
}
-
- g_clear_error (&error);
return;
}