ref: 83b2bd4a1c90233331fe35203e555f738b192704
dir: /libc/llfree.c/
/* free all entries in a linked list, can, and will be dangrous */ #include <u.h> #include <libc.h> #include <mem.h> void llfree(ll_t *head) { ll_t *t, *p; p = head; t = (ll_t*)head->next; while(t != nil) { free(p); p = t; t = (ll_t*)head->next; } }