aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-01-07 14:56:15 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-01-07 14:56:15 +0000
commitd9a77730114b25f0d073208495c8702d9dc28161 (patch)
tree8e1f64d6d92b6f59e11c1311e3d6b901f9960131 /lib
parent2b149168139d9bb47ec5ca35f7e48ee35ee4bbfe (diff)
added precautions to not go insane when two matching cookies end up in the
cookie list, even though they're not supposed to do that...
Diffstat (limited to 'lib')
-rw-r--r--lib/cookie.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 697081117..9ffdd2abe 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -377,8 +377,15 @@ Curl_cookie_add(struct CookieInfo *c,
free(co); /* free the newly alloced memory */
co = clist; /* point to the previous struct instead */
- }
+ /* We have replaced a cookie, now skip the rest of the list but
+ make sure the 'lastc' pointer is properly set */
+ do {
+ lastc = clist;
+ clist = clist->next;
+ } while(clist);
+ break;
+ }
}
lastc = clist;
clist = clist->next;