]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
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 97330cbc78a4de2e1f8e911eb31ac10bcb4d4e0d..bac0adb2fc11605d77a9b4cb3b89decc9d723d6e 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 */
       }
 
     }