Ver código fonte

Merge pull request #65 from cheyiliu/patch-1

fix, need free the element which is from malloc
Troy D. Hanson 9 anos atrás
pai
commit
044474afe5
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      doc/utlist.txt

+ 1 - 0
doc/utlist.txt

@@ -228,6 +228,7 @@ int main(int argc, char *argv[]) {
     /* now delete each element, use the safe iterator */
     DL_FOREACH_SAFE(head,elt,tmp) {
       DL_DELETE(head,elt);
+      free(elt);
     }
 
     fclose(file);