memory leak fix - missed user data which is passed from g_object_get 95/49295/2
authorSoohye Shin <soohye.shin@samsung.com>
Mon, 12 Oct 2015 10:49:44 +0000 (19:49 +0900)
committerSoohye Shin <soohye.shin@samsung.com>
Mon, 12 Oct 2015 11:07:32 +0000 (20:07 +0900)
Change-Id: I7e6b81114b2cd473c3b55012df7a3d7838360b1b
Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
src/data/data_user.c

index b348ca3..140ba52 100644 (file)
@@ -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;