summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoohye Shin <soohye.shin@samsung.com>2015-10-12 15:50:15 +0900
committerSoohye Shin <soohye.shin@samsung.com>2015-10-12 15:51:17 +0900
commitf0f994e726d1d4fb3ff6a6fa77182462f107ddc6 (patch)
tree6a34b08809b91689bc0f4dd0c0ac9d8797269df0
parent65aec55278684a52cc74269a94a3cfbf14ba4e5e (diff)
downloadair_home-f0f994e726d1d4fb3ff6a6fa77182462f107ddc6.tar.gz
air_home-f0f994e726d1d4fb3ff6a6fa77182462f107ddc6.tar.bz2
air_home-f0f994e726d1d4fb3ff6a6fa77182462f107ddc6.zip
memory leak fix - missed the string to free
Change-Id: I1c507bbe9a3ce25db1decf65180ec398d96a69fa Signed-off-by: Soohye Shin <soohye.shin@samsung.com>
-rw-r--r--src/data/data_home.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/data/data_home.c b/src/data/data_home.c
index be234bc..f0cc1d6 100644
--- a/src/data/data_home.c
+++ b/src/data/data_home.c
@@ -270,7 +270,6 @@ static Eina_List *_get_items(struct datamgr *dm)
static void _notification_cb(void *data, notification_type_e type)
{
- char *noti = NULL;
Eina_List *l;
struct datamgr *dm;
struct datamgr_item *di;
@@ -283,13 +282,15 @@ static void _notification_cb(void *data, notification_type_e type)
dm = data;
- snprintf(buf, sizeof(buf), "%d", utils_get_notification_count());
- noti = strdup(buf);
-
- viewmgr_update_view(VIEW_HOME, UPDATE_TYPE_NOTI, noti);
EINA_LIST_FOREACH(dm->list, l, di) {
- if (di->noti)
- di->subtitle = noti;
+ if (!di->noti)
+ continue;
+
+ snprintf(buf, sizeof(buf), "%d",
+ utils_get_notification_count());
+ viewmgr_update_view(VIEW_HOME, UPDATE_TYPE_NOTI, buf);
+ free(di->subtitle);
+ di->subtitle = strdup(buf);
}
}