Commit e88e67fa authored by David Zeuthen's avatar David Zeuthen

Plug a couple of memory leaks

parent 8cd6ae8b
......@@ -72,11 +72,22 @@ polkit_unix_session_init (PolkitUnixSession *unix_session)
{
}
static void
polkit_unix_session_finalize (GObject *object)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
g_free (session->session_id);
if (G_OBJECT_CLASS (polkit_unix_session_parent_class)->finalize != NULL)
G_OBJECT_CLASS (polkit_unix_session_parent_class)->finalize (object);
}
static void
polkit_unix_session_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
......@@ -94,9 +105,9 @@ polkit_unix_session_get_property (GObject *object,
static void
polkit_unix_session_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
PolkitUnixSession *session = POLKIT_UNIX_SESSION (object);
......@@ -117,6 +128,7 @@ polkit_unix_session_class_init (PolkitUnixSessionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = polkit_unix_session_finalize;
gobject_class->get_property = polkit_unix_session_get_property;
gobject_class->set_property = polkit_unix_session_set_property;
......
......@@ -367,8 +367,8 @@ polkit_backend_action_pool_get_action (PolkitBackendActionPool *pool,
PolkitActionDescription *ret;
_PolkitActionDescription *real;
ParsedAction *parsed_action;
gchar *description;
gchar *message;
const gchar *description;
const gchar *message;
g_return_val_if_fail (POLKIT_BACKEND_IS_ACTION_POOL (pool), NULL);
......@@ -386,12 +386,12 @@ polkit_backend_action_pool_get_action (PolkitBackendActionPool *pool,
goto out;
}
description = g_strdup (_localize (parsed_action->localized_description,
parsed_action->description,
locale));
message = g_strdup (_localize (parsed_action->localized_message,
parsed_action->message,
locale));
description = _localize (parsed_action->localized_description,
parsed_action->description,
locale);
message = _localize (parsed_action->localized_message,
parsed_action->message,
locale);
real = _polkit_action_description_new (action_id,
description,
......
......@@ -812,6 +812,7 @@ check_auth_cb (GObject *source_object,
_PolkitAuthorizationResult *real_result;
real_result = polkit_authorization_result_get_real (result);
_polkit_authority_handle_check_authorization_finish (method_invocation, real_result);
g_object_unref (real_result);
g_object_unref (result);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment