summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2013-06-30 20:26:51 +0900
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>2013-07-01 12:16:51 +0000
commit89bf804c60a46a102df2b59fdf59d7b88b689105 (patch)
tree266d4b8ecf8377e26c325e3afceeec7d353ee35e
parent4a25d9bf38f72a387ab08002739d4ae267ddfd78 (diff)
downloaddata-provider-master-89bf804c60a46a102df2b59fdf59d7b88b689105.tar.gz
data-provider-master-89bf804c60a46a102df2b59fdf59d7b88b689105.tar.bz2
data-provider-master-89bf804c60a46a102df2b59fdf59d7b88b689105.zip
Fix the invalid list item handling code.
List doesn't remove the released item. So it can generate the crash while crawling the list. Change-Id: I27eb10482353d690dca5380a70937adaebf4e798
-rw-r--r--src/pkgmgr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pkgmgr.c b/src/pkgmgr.c
index 49f0a86..316148f 100644
--- a/src/pkgmgr.c
+++ b/src/pkgmgr.c
@@ -208,7 +208,6 @@ static int start_cb(const char *pkgname, const char *val, void *data)
}
item->status = PKGMGR_STATUS_START;
- s_info.item_list = eina_list_append(s_info.item_list, item);
if (!strcasecmp(val, "download")) {
item->type = PKGMGR_EVENT_DOWNLOAD;
@@ -227,6 +226,8 @@ static int start_cb(const char *pkgname, const char *val, void *data)
return LB_STATUS_ERROR_INVALID;
}
+ s_info.item_list = eina_list_append(s_info.item_list, item);
+
invoke_callback(pkgname, item, 0.0f);
return LB_STATUS_SUCCESS;
}