mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-13 12:37:46 +02:00
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:
@@ -626,7 +626,7 @@ create_certificate_chain_from_list (GSList *pem_list,
|
|||||||
|
|
||||||
/* root will point to the last certificate in the file. */
|
/* root will point to the last certificate in the file. */
|
||||||
if (!root)
|
if (!root)
|
||||||
root = cert;
|
root = g_object_ref (cert);
|
||||||
|
|
||||||
pem = g_slist_next (pem);
|
pem = g_slist_next (pem);
|
||||||
}
|
}
|
||||||
@@ -641,6 +641,8 @@ create_certificate_chain_from_list (GSList *pem_list,
|
|||||||
g_clear_object (&cert);
|
g_clear_object (&cert);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_clear_object (&root);
|
||||||
|
|
||||||
return cert;
|
return cert;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user