apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r1367050 - /apr/apr/trunk/tables/apr_tables.c
Date Mon, 30 Jul 2012 09:47:03 GMT
Author: rpluem
Date: Mon Jul 30 09:47:03 2012
New Revision: 1367050

URL: http://svn.apache.org/viewvc?rev=1367050&view=rev
Log:
* Prevent apr_table_mergen from aborting when APR_POOL_DEBUG is set and key or
  value are static literals not stored in pool managed memory.

Modified:
    apr/apr/trunk/tables/apr_tables.c

Modified: apr/apr/trunk/tables/apr_tables.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/tables/apr_tables.c?rev=1367050&r1=1367049&r2=1367050&view=diff
==============================================================================
--- apr/apr/trunk/tables/apr_tables.c (original)
+++ apr/apr/trunk/tables/apr_tables.c Mon Jul 30 09:47:03 2012
@@ -730,15 +730,18 @@ APR_DECLARE(void) apr_table_mergen(apr_t
     apr_table_entry_t *next_elt;
     apr_table_entry_t *end_elt;
     apr_uint32_t checksum;
+    apr_pool_t *pool;
     int hash;
 
 #if APR_POOL_DEBUG
     {
-	if (!apr_pool_is_ancestor(apr_pool_find(key), t->a.pool)) {
+	pool = apr_pool_find(key);
+	if ((pool != key) && (!apr_pool_is_ancestor(pool, t->a.pool))) {
 	    fprintf(stderr, "apr_table_mergen: key not in ancestor pool of t\n");
 	    abort();
 	}
-	if (!apr_pool_is_ancestor(apr_pool_find(val), t->a.pool)) {
+	pool = apr_pool_find(val);
+	if ((pool != val) && (!apr_pool_is_ancestor(pool, t->a.pool))) {
 	    fprintf(stderr, "apr_table_mergen: val not in ancestor pool of t\n");
 	    abort();
 	}



Mime
View raw message