T. Bharath found this memory leak. It occurs when we replace an internally
authorDaniel Stenberg <daniel@haxx.se>
Wed, 24 Oct 2001 11:36:55 +0000 (11:36 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 24 Oct 2001 11:36:55 +0000 (11:36 +0000)
already existing cookie with a new one.

lib/cookie.c

index 97330cb..bac0adb 100644 (file)
@@ -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 */
       }
 
     }