- Add codes to append keynode to the list
- Reset list after all the list elements are freed
Change-Id: Iba1726e86f20838ca3ad93eb562de37c1dafdee0
Signed-off-by: Suchang Woo <suchang.woo@samsung.com>
return NULL;
}
+ keylist->list = g_list_append(keylist->list, keynode);
+
return keynode;
}
return -1;
}
- keynode = get_keynode(keylist, keyname);
- if (!keynode)
- return -1;
-
s = strdup(value);
if (!s)
return -1;
+ keynode = get_keynode(keylist, keyname);
+ if (!keynode) {
+ free(s);
+ return -1;
+ }
+
if (keynode->type == VCONF_TYPE_STRING)
free(keynode->value.s);
}
g_list_free_full(keylist->list, (GDestroyNotify)free_keynode);
+ keylist->list = NULL;
for (i = 0; i < len; i++) {
struct _keynode_t *keynode;