From 208438236cbe3af82252f51417e3bad5da0cc736 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Mon, 10 Apr 2023 08:29:02 +0200 Subject: [PATCH] sip-provider: Don't leak keyfile The reference taken in new_origin_from_keyfile_secret() was never released in the async callback. --- plugins/provider/sip/calls-sip-provider.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/provider/sip/calls-sip-provider.c b/plugins/provider/sip/calls-sip-provider.c index d9d3f05..6fc89cd 100644 --- a/plugins/provider/sip/calls-sip-provider.c +++ b/plugins/provider/sip/calls-sip-provider.c @@ -164,6 +164,8 @@ on_origin_pw_looked_up (GObject *source, media_encryption = (SipMediaEncryption) g_key_file_get_integer (data->key_file, data->name, "MediaEncryption", NULL); + g_key_file_unref (data->key_file); + /* PW */ password = secret_password_lookup_finish (result, &error); if (!direct_mode && error) { @@ -218,8 +220,7 @@ new_origin_from_keyfile_secret (CallsSipProvider *self, data = g_new0 (SipOriginLoadData, 1); data->provider = self; - g_key_file_ref (key_file); - data->key_file = key_file; + data->key_file = g_key_file_ref (key_file); data->name = g_strdup (name); secret_password_lookup (calls_secret_get_schema (), NULL,