Update ls_new API
In radare source coude there was a bad usage of ls_* because of this
#define LS_MERGE_DEPTH 50
SDB_API SdbList *ls_newf(SdbListFree freefn) {
- SdbList *list = R_NEW (SdbList);
- if (!list) {
- return NULL;
- }
- list->head = NULL;
- list->tail = NULL;
- list->free = freefn; // HACK
- list->length = 0;
+ SdbList *list = ls_new ();
+ list->free = freefn;
return list;
}
SDB_API SdbList *ls_new() {
- return ls_newf (free /*XXX HACK*/);
+ SdbList *list = R_NEW0 (SdbList);
+ if (!list) {
+ return NULL;
+ }
+ return list;
}
static void ls_insertion_sort(SdbList *list, SdbListComparator cmp) {
