Fix r_list_set_n() to allow empty element (#15820) ##util

This commit is contained in:
Jeong Jihoon 2020-01-17 07:23:08 +09:00 committed by radare
parent 9ddfafcd65
commit 6928ae192d
1 changed files with 1 additions and 1 deletions

View File

@ -416,7 +416,7 @@ R_API int r_list_set_n(RList *list, int n, void *p) {
int i;
r_return_val_if_fail (list, false);
for (it = list->head, i = 0; it && it->data; it = it->n, i++) {
for (it = list->head, i = 0; it ; it = it->n, i++) {
if (i == n) {
if (list->free) {
list->free (it->data);