summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoohye Shin <soohye.shin@samsung.com>2015-10-12 19:49:44 +0900
committerSoohye Shin <soohye.shin@samsung.com>2015-10-12 20:07:32 +0900
commit24f227045dae7c87409e7ad99915d5c9a765de54 (patch)
treec4e7148f85f33a14c2b6cc714d9a60f1137fafe7
parent72f945bd0a887407459759df7ba1128c8d8543ec (diff)
downloadair_home-24f227045dae7c87409e7ad99915d5c9a765de54.tar.gz
air_home-24f227045dae7c87409e7ad99915d5c9a765de54.tar.bz2
air_home-24f227045dae7c87409e7ad99915d5c9a765de54.zip
memory leak fix - missed user data which is passed from g_object_get
Change-Id: I7e6b81114b2cd473c3b55012df7a3d7838360b1b Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r--src/data/data_user.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/data/data_user.c b/src/data/data_user.c
index b348ca3..140ba52 100644
--- a/src/data/data_user.c
+++ b/src/data/data_user.c
@@ -287,11 +287,16 @@ static bool _load_login_user(Eina_List **list)
(char *)utils_get_focus_icon_from_icon(icon),
ITEM_SELECT_ACTION_POP, NULL, type);
if (!di) {
+ g_free(name);
+ g_free(icon);
g_object_unref(user);
return false;
}
*list = eina_list_append(*list, di);
+
+ g_free(name);
+ g_free(icon);
g_object_unref(user);
return true;
@@ -362,12 +367,18 @@ static bool _load_users(Eina_List **list)
g_object_get(G_OBJECT(user), GUM_ATTR_NAME, &name,
GUM_ATTR_ICON, &icon, GUM_ATTR_UID, &uid,
GUM_ATTR_USERTYPE, &type, NULL);
- if (uid == user_uid)
+ if (uid == user_uid) {
+ g_free(name);
+ g_free(icon);
continue;
+ }
di = _pack_user(name, icon,
(char *)utils_get_focus_icon_from_icon(icon),
ITEM_SELECT_ACTION_SWITCH, NULL, type);
+ g_free(name);
+ g_free(icon);
+
if (!di)
continue;