diff options
Diffstat (limited to 'libopkg/void_list.c')
-rw-r--r-- | libopkg/void_list.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libopkg/void_list.c b/libopkg/void_list.c index f749016..8d61fbb 100644 --- a/libopkg/void_list.c +++ b/libopkg/void_list.c @@ -160,6 +160,15 @@ void *void_list_remove_elt(void_list_t *list, const void *target_data, void_list void_list_elt_t *old_elt = NULL; void *old_data = NULL; + if (!list) { + fprintf(stderr, "Error: void_list_remove_elt list is NULL\n"); + return NULL; + } + if (!target_data) { + fprintf(stderr, "Error: void_list_remove_elt target_data is NULL\n"); + return NULL; + } + /* first element */ if (list->head && list->head->data && (cmp(list->head->data, target_data) == 0)) { old_elt = list->head; |