Add null checking code just after allocating memory
It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/
I think my second comment is required to prevent memory leak.
I am not sure about my first and my third comments.
shouldn't the previously allocated "pi" be freed?
it seems that "first" and "last" should be freed.
free(first); free(last); return ret;
shouldn't the previously allocated "cpy" be freed?
Allocated "pi"s will be kept in the widget, and would be freed when it is invalidated.
I missed this - will update soon.
Allocated "cpy" would be kept inside the destination list, and the list would be handled manually by application side.