Fixed missed free of soup_date.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 2 Nov 2013 23:04:19 +0000 (00:04 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 2 Nov 2013 23:04:19 +0000 (00:04 +0100)
src/session.c

index 7c3516c..643e562 100644 (file)
@@ -87,8 +87,11 @@ static SoupCookieJar *cookiejar_new(const char *file, gboolean ro)
 static void cookiejar_changed(SoupCookieJar *self, SoupCookie *old_cookie, SoupCookie *new_cookie)
 {
     flock(COOKIEJAR(self)->lock, LOCK_EX);
+    SoupDate *expire;
     if (new_cookie && !new_cookie->expires && vb.config.cookie_timeout) {
-        soup_cookie_set_expires(new_cookie, soup_date_new_from_now(vb.config.cookie_timeout));
+        expire = soup_date_new_from_now(vb.config.cookie_timeout);
+        soup_cookie_set_expires(new_cookie, expire);
+        soup_date_free(expire);
     }
     SOUP_COOKIE_JAR_CLASS(cookiejar_parent_class)->changed(self, old_cookie, new_cookie);
     flock(COOKIEJAR(self)->lock, LOCK_UN);