Merge branch 'tls-certificate-refs' into 'main'

gtlscertificate: Hold a ref on the root certificate when building chains

See merge request GNOME/glib!2761
This commit is contained in:
Emmanuele Bassi 2022-06-21 12:09:22 +00:00
commit 55a5a82655

View File

@ -626,7 +626,7 @@ create_certificate_chain_from_list (GSList *pem_list,
/* root will point to the last certificate in the file. */
if (!root)
root = cert;
root = g_object_ref (cert);
pem = g_slist_next (pem);
}
@ -641,6 +641,8 @@ create_certificate_chain_from_list (GSList *pem_list,
g_clear_object (&cert);
}
g_clear_object (&root);
return cert;
}