--- src/LYCookie.c.orig 2013-11-28 18:52:56.000000000 -0600 +++ src/LYCookie.c 2014-11-27 08:27:02.453966314 -0600 @@ -716,13 +716,14 @@ char *header, int secure) { - HTList *hl; + HTList *hl, *next; cookie *co; time_t now = time(NULL); char crlftab[8]; sprintf(crlftab, "%c%c%c", CR, LF, '\t'); - for (hl = sublist; hl != NULL; hl = hl->next) { + for (hl = sublist; hl != NULL; hl = next) { + next = hl->next; co = (cookie *) hl->object; if (co == NULL) {