mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-14 19:55:12 +01:00
tls-interaction test: use a weak pointer instead of a deliberate use-after-free
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666115 Reviewed-by: Dan Winship <danw@gnome.org>
This commit is contained in:
parent
0a7930d048
commit
a1bd6e0717
@ -384,10 +384,15 @@ static void
|
||||
teardown_without_loop (Test *test,
|
||||
gconstpointer unused)
|
||||
{
|
||||
gpointer weak_pointer = test->interaction;
|
||||
|
||||
g_object_add_weak_pointer (weak_pointer, &weak_pointer);
|
||||
|
||||
g_object_unref (test->password);
|
||||
|
||||
g_object_unref (test->interaction);
|
||||
g_assert (!G_IS_OBJECT (test->interaction));
|
||||
|
||||
g_assert (weak_pointer == NULL);
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user