soup-cache: free params hash list
authorXan Lopez <xlopez@igalia.com>
Thu, 5 May 2011 20:42:20 +0000 (13:42 -0700)
committerXan Lopez <xlopez@igalia.com>
Thu, 5 May 2011 20:42:20 +0000 (13:42 -0700)
There's one code path where we can exit the method without freeing
it. Plug the leak.

libsoup/soup-cache.c

index 5b64575..ca9108a 100644 (file)
@@ -1343,8 +1343,10 @@ soup_cache_has_response (SoupCache *cache, SoupMessage *msg)
                        max_age = (int)MIN (g_ascii_strtoll (value, NULL, 10), G_MAXINT32);
                        /* Forcing cache revalidaton
                         */
-                       if (!max_age)
+                       if (!max_age) {
+                               soup_header_free_param_list (hash);
                                return SOUP_CACHE_RESPONSE_NEEDS_VALIDATION;
+                       }
                }
 
                /* max-stale can have no value set, we need to use _extended */