save next node beforehand to delete node safely
Change-Id: I7d5d88f2bb8d2fb8959fc02f3b5f9134e1c39393
Signed-off-by: Sangyoon Jang <s89.jang@samsung.com>
const char *dbpath;
char *locale;
GList *tmp;
const char *dbpath;
char *locale;
GList *tmp;
locale = _get_system_locale();
if (locale == NULL)
locale = _get_system_locale();
if (locale == NULL)
/* remove duplicate element:
* since the list is sorted, we can remove duplicates in linear time
*/
/* remove duplicate element:
* since the list is sorted, we can remove duplicates in linear time
*/
- for (tmp = *list; tmp; tmp = tmp->next) {
+ for (tmp = *list, tmp2 = g_list_next(tmp); tmp;
+ tmp = tmp2, tmp2 = g_list_next(tmp)) {
if (tmp->prev == NULL || tmp->data == NULL)
continue;
if (strcmp((const char *)tmp->prev->data,
if (tmp->prev == NULL || tmp->data == NULL)
continue;
if (strcmp((const char *)tmp->prev->data,
}
static int _appinfo_get_label(sqlite3 *db, const char *appid,
}
static int _appinfo_get_label(sqlite3 *db, const char *appid,
const char *dbpath;
char *locale;
GList *tmp;
const char *dbpath;
char *locale;
GList *tmp;
locale = _get_system_locale();
if (locale == NULL)
locale = _get_system_locale();
if (locale == NULL)
/* remove duplicate element:
* since the list is sorted, we can remove duplicates in linear time
*/
/* remove duplicate element:
* since the list is sorted, we can remove duplicates in linear time
*/
- for (tmp = *list; tmp; tmp = tmp->next) {
+ for (tmp = *list, tmp2 = g_list_next(tmp); tmp;
+ tmp = tmp2, tmp2 = g_list_next(tmp)) {
if (tmp->prev == NULL || tmp->data == NULL)
continue;
if (strcmp((const char *)tmp->prev->data,
if (tmp->prev == NULL || tmp->data == NULL)
continue;
if (strcmp((const char *)tmp->prev->data,