mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 21:48:08 +02:00
ovs: fix dispose()
input and output must be freed only when not NULL. Also, ovsdb_disconnect() should do nothing if there is no client. Fixes:830a5a14cb(cherry picked from commit29984c07cd)
This commit is contained in:
parent
9d291821f2
commit
583a2a2cee
1 changed files with 11 additions and 5 deletions
|
|
@ -1292,6 +1292,9 @@ ovsdb_disconnect (NMOvsdb *self, gboolean is_disposing)
|
||||||
gpointer user_data;
|
gpointer user_data;
|
||||||
gs_free_error GError *error = NULL;
|
gs_free_error GError *error = NULL;
|
||||||
|
|
||||||
|
if (!priv->client)
|
||||||
|
return;
|
||||||
|
|
||||||
_LOGD ("disconnecting from ovsdb");
|
_LOGD ("disconnecting from ovsdb");
|
||||||
nm_utils_error_set_cancelled (&error, is_disposing, "NMOvsdb");
|
nm_utils_error_set_cancelled (&error, is_disposing, "NMOvsdb");
|
||||||
|
|
||||||
|
|
@ -1528,11 +1531,14 @@ dispose (GObject *object)
|
||||||
|
|
||||||
ovsdb_disconnect (self, TRUE);
|
ovsdb_disconnect (self, TRUE);
|
||||||
|
|
||||||
g_string_free (priv->input, TRUE);
|
if (priv->input) {
|
||||||
priv->input = NULL;
|
g_string_free (priv->input, TRUE);
|
||||||
g_string_free (priv->output, TRUE);
|
priv->input = NULL;
|
||||||
priv->output = NULL;
|
}
|
||||||
|
if (priv->output) {
|
||||||
|
g_string_free (priv->output, TRUE);
|
||||||
|
priv->output = NULL;
|
||||||
|
}
|
||||||
if (priv->calls) {
|
if (priv->calls) {
|
||||||
g_array_free (priv->calls, TRUE);
|
g_array_free (priv->calls, TRUE);
|
||||||
priv->calls = NULL;
|
priv->calls = NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue