summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2019-09-02 12:26:42 +0200
committerLubomir Rintel <lkundrak@v3.sk>2019-09-02 14:58:43 +0200
commitb76da15dbf0851552d422566b9722f6c65d3e072 (patch)
treea18ed785fcaa87a9b041fca12c5e18498c43cc78
parent576a1289546d0bc03e543ee33aa9529145365e1a (diff)
downloadNetworkManager-b76da15dbf0851552d422566b9722f6c65d3e072.tar.gz
clients: avoid clearing a structure pointer when we're still using it
We're dereferencing the info pointer in the argument list in the call to nm_client_activate_connection_async(). Stealing it at that point causes a crash. This reverts a chunk of commit b298f2e6058a ('cli: use cleanup macro for freeing AddAndActivateInfo').
-rw-r--r--clients/cli/devices.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/clients/cli/devices.c b/clients/cli/devices.c
index 6338f05e9e..8fc5198b8c 100644
--- a/clients/cli/devices.c
+++ b/clients/cli/devices.c
@@ -3153,7 +3153,7 @@ static void
activate_update2_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
{
NMRemoteConnection *remote_con = NM_REMOTE_CONNECTION (source_object);
- nm_auto_free_add_and_activate_info AddAndActivateInfo *info = user_data;
+ AddAndActivateInfo *info = user_data;
NmCli *nmc = info->nmc;
gs_unref_variant GVariant *ret = NULL;
GError *error = NULL;
@@ -3165,6 +3165,7 @@ activate_update2_cb (GObject *source_object, GAsyncResult *res, gpointer user_da
nmc->return_value = NMC_RESULT_ERROR_UNKNOWN;
g_error_free (error);
quit ();
+ add_and_activate_info_free (info);
return;
}
@@ -3174,7 +3175,7 @@ activate_update2_cb (GObject *source_object, GAsyncResult *res, gpointer user_da
info->specific_object,
NULL,
add_and_activate_cb,
- g_steal_pointer (&info));
+ info);
}
static NMCResultCode