mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
dtlsdec: Avoid duplicate ref when passing certificate property
The agent itself will take a ref on the property setter, so we'll be left with two references to the certificate object, when actually there should be only one
This commit is contained in:
parent
a93bf98245
commit
8317112883
1 changed files with 10 additions and 4 deletions
|
@ -588,9 +588,12 @@ get_agent_by_pem (const gchar * pem)
|
|||
if (!pem) {
|
||||
if (g_once_init_enter (&generated_cert_agent)) {
|
||||
GstDtlsAgent *new_agent;
|
||||
GObject *certificate;
|
||||
|
||||
certificate = g_object_new (GST_TYPE_DTLS_CERTIFICATE, NULL);
|
||||
new_agent = g_object_new (GST_TYPE_DTLS_AGENT, "certificate",
|
||||
g_object_new (GST_TYPE_DTLS_CERTIFICATE, NULL), NULL);
|
||||
certificate, NULL);
|
||||
g_object_unref (certificate);
|
||||
|
||||
GST_DEBUG_OBJECT (generated_cert_agent,
|
||||
"no agent with generated cert found, creating new");
|
||||
|
@ -613,9 +616,12 @@ get_agent_by_pem (const gchar * pem)
|
|||
agent = GST_DTLS_AGENT (g_hash_table_lookup (agent_table, pem));
|
||||
|
||||
if (!agent) {
|
||||
agent = g_object_new (GST_TYPE_DTLS_AGENT,
|
||||
"certificate", g_object_new (GST_TYPE_DTLS_CERTIFICATE, "pem", pem,
|
||||
NULL), NULL);
|
||||
GObject *certificate;
|
||||
|
||||
certificate = g_object_new (GST_TYPE_DTLS_CERTIFICATE, "pem", pem, NULL);
|
||||
agent = g_object_new (GST_TYPE_DTLS_AGENT, "certificate", certificate,
|
||||
NULL);
|
||||
g_object_unref (certificate);
|
||||
|
||||
g_object_weak_ref (G_OBJECT (agent), (GWeakNotify) agent_weak_ref_notify,
|
||||
(gpointer) g_strdup (pem));
|
||||
|
|
Loading…
Reference in a new issue