aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-24 11:36:55 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-24 11:36:55 +0000
commitc6822f5a7f4b188dd09f9c0a582d8e76c63be7c3 (patch)
tree5e3af48c506e91c46e90d3ce1c26b66394e5453c
parent4e276b1b684664dc7a3379109f2b31e5eb567c4c (diff)
T. Bharath found this memory leak. It occurs when we replace an internally
already existing cookie with a new one.
-rw-r--r--lib/cookie.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 97330cbc7..bac0adb2f 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -374,6 +374,9 @@ Curl_cookie_add(struct CookieInfo *c,
free(clist->maxage);
*clist = *co; /* then store all the new data */
+
+ free(co); /* free the newly alloced memory */
+ co = clist; /* point to the previous struct instead */
}
}