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:
Beniamino Galvani 2025-09-05 14:37:17 +02:00 committed by Íñigo Huguet
parent 5ad712974e
commit d559f61423

View file

@ -1434,7 +1434,7 @@ test_client_wait_shutdown(void)
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;