[gnome-control-center] user-panel: Fix possible invalid free
- From: Felipe Borges <felipeborges src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-panel: Fix possible invalid free
- Date: Wed, 17 Aug 2022 08:26:35 +0000 (UTC)
commit 38d62974b6845197a66f5191fcb05c40f8c112e7
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date: Sat Aug 13 10:49:21 2022 +0530
user-panel: Fix possible invalid free
The selected_user variable is unref on dispose(), and show_user()
is likely executed with self->selected_user already set to user,
but it's inconsistent, and so to be on the safer side, use
g_set_object()
panels/user-accounts/cc-user-panel.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/panels/user-accounts/cc-user-panel.c b/panels/user-accounts/cc-user-panel.c
index 52c15b5e0..9b980e80e 100644
--- a/panels/user-accounts/cc-user-panel.c
+++ b/panels/user-accounts/cc-user-panel.c
@@ -828,7 +828,7 @@ show_user (ActUser *user, CcUserPanel *self)
g_autofree gchar *malcontent_control_path = NULL;
#endif
- self->selected_user = user;
+ g_set_object (&self->selected_user, user);
setup_avatar_for_user (self->user_avatar, user);
cc_avatar_chooser_set_user (self->avatar_chooser, user);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]