Skip to content
Snippets Groups Projects
Commit a2b2ff73 authored by Simon McVittie's avatar Simon McVittie
Browse files

check-xdg-portal: Allocate and free one GVariant per loop iteration


Previously we allocated one GVariant per loop, but only freed the last.
When building with AddressSanitizer, this caused a crash which is reported
to systemd-coredump if used (but the JSON output was valid, and the test
suite can't assert that check-xdg-portal succeeds because on some test
systems it might not, so the crash did not cause a test failure).

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent f88f941c
No related branches found
No related tags found
1 merge request!634pv-wrap: Fix minor issues caught by the test suite
......@@ -57,7 +57,6 @@ main (int argc,
g_autoptr(FILE) original_stdout = NULL;
g_autoptr(JsonBuilder) builder = NULL;
g_autoptr(GDBusConnection) connection = NULL;
g_autoptr(GVariant) variant_version = NULL;
g_autoptr(GError) local_error = NULL;
g_autoptr(GOptionContext) option_context = NULL;
guint32 version;
......@@ -126,7 +125,9 @@ main (int argc,
for (i = 0; portal_interface_name[i] != NULL; i++)
{
g_autoptr(GDBusProxy) portal_proxy = NULL;
g_autoptr(GVariant) variant_version = NULL;
g_autofree gchar *name_owner = NULL;
portal_proxy = g_dbus_proxy_new_sync (connection,
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
NULL,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment