mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-20 08:10:06 +01:00
libnm-client: fix memory leak
The test calls g_main_context_ref() on client_context, which must then
be unreferenced.
Fixes: 88724ff169 ('libnm: add nm_client_wait_shutdown() function for cleaning up NMClient')
This commit is contained in:
parent
5ad712974e
commit
d559f61423
1 changed files with 7 additions and 7 deletions
|
|
@ -1432,13 +1432,13 @@ test_client_wait_shutdown(void)
|
||||||
nmtst_assert_success(dbus_connection, error);
|
nmtst_assert_success(dbus_connection, error);
|
||||||
|
|
||||||
for (i_run = 0; i_run < N_RUN; i_run++) {
|
for (i_run = 0; i_run < N_RUN; i_run++) {
|
||||||
gs_unref_object GCancellable *init_cancellable = g_cancellable_new();
|
gs_unref_object GCancellable *init_cancellable = g_cancellable_new();
|
||||||
gs_unref_object NMClient *nmc = NULL;
|
gs_unref_object NMClient *nmc = NULL;
|
||||||
nm_auto_pop_gmaincontext GMainContext *client_context = NULL;
|
nm_auto_pop_and_unref_gmaincontext GMainContext *client_context = NULL;
|
||||||
gboolean b;
|
gboolean b;
|
||||||
gboolean context_integrated = FALSE;
|
gboolean context_integrated = FALSE;
|
||||||
gs_unref_object GCancellable *cancellable_1 = NULL;
|
gs_unref_object GCancellable *cancellable_1 = NULL;
|
||||||
GMainContext *ctx;
|
GMainContext *ctx;
|
||||||
|
|
||||||
/* Choose a random context for the client. */
|
/* Choose a random context for the client. */
|
||||||
ctx = contexts->pdata[nmtst_get_rand_uint32() % contexts->len];
|
ctx = contexts->pdata[nmtst_get_rand_uint32() % contexts->len];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue