]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fix double free in out-of-mem situation
authorStefan Fritsch <sf@apache.org>
Tue, 26 Apr 2011 19:17:16 +0000 (19:17 +0000)
committerStefan Fritsch <sf@apache.org>
Tue, 26 Apr 2011 19:17:16 +0000 (19:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1096855 13f79535-47bb-0310-9956-ffa450edef68

modules/ldap/util_ldap_cache_mgr.c

index 2f1d844bbafa7bc4e6d6248b6ac574b2d3e77b18..1998c13e0bc32e19a177abe668f9d35cab53b49b 100644 (file)
@@ -365,15 +365,8 @@ util_ald_cache_t *util_ald_create_cache(util_ldap_state_t *st,
 
     cache->nodes = (util_cache_node_t **)util_ald_alloc(cache, cache->size * sizeof(util_cache_node_t *));
     if (!cache->nodes) {
+        /* This frees cache in the right way even if !APR_HAS_SHARED_MEMORY or !st->cache_rmm */
         util_ald_free(cache, cache);
-#if APR_HAS_SHARED_MEMORY
-        if (!st->cache_rmm)
-            free(cache);
-        else
-            apr_rmm_free(st->cache_rmm, block);
-#else
-        free(cache);
-#endif
         return NULL;
     }