diff options
Diffstat (limited to 'lib/llist.c')
-rw-r--r-- | lib/llist.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/llist.c b/lib/llist.c index 8b4bc7f20..a302e32d5 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -22,9 +22,6 @@ #include "setup.h" -#include <string.h> -#include <stdlib.h> - #include "llist.h" #include "curl_memory.h" @@ -49,7 +46,7 @@ Curl_llist_alloc(curl_llist_dtor dtor) struct curl_llist *list; list = malloc(sizeof(struct curl_llist)); - if(NULL == list) + if(!list) return NULL; llist_init(list, dtor); @@ -134,6 +131,10 @@ Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e, list->dtor(user, e->ptr); + e->ptr = NULL; + e->prev = NULL; + e->next = NULL; + free(e); --list->size; |