ovs: don't consume error in method callback

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.

Fixes: 830a5a14cb
(cherry picked from commit 878a3a4125)
This commit is contained in:
Beniamino Galvani 2018-02-20 13:43:49 +01:00
parent f05f12f53b
commit e4d237d86b

View file

@ -1316,15 +1316,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);
@ -1347,8 +1345,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;
}