(list->nr - index)
* sizeof(struct path_list_item));
list->items[index].path = list->strdup_paths ?
- strdup(path) : (char *)path;
+ xstrdup(path) : (char *)path;
list->items[index].util = NULL;
list->nr++;
int index = add_entry(list, path);
if (index < 0)
- index = 1 - index;
+ index = -1 - index;
return list->items + index;
}
for (i = 0; i < list->nr; i++) {
if (list->strdup_paths)
free(list->items[i].path);
- if (list->items[i].util)
- free(list->items[i].util);
+ free(list->items[i].util);
}
free(list->items);
}