diff options
Diffstat (limited to 'tables')
-rw-r--r-- | tables/apr_tables.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tables/apr_tables.c b/tables/apr_tables.c index e86c1becc..da17e2867 100644 --- a/tables/apr_tables.c +++ b/tables/apr_tables.c @@ -1191,18 +1191,18 @@ static void apr_table_cat(apr_table_t *t, const apr_table_t *s) APR_DECLARE(void) apr_table_overlap(apr_table_t *a, const apr_table_t *b, unsigned flags) { - const int m = a->a.nelts; - const int n = b->a.nelts; - apr_pool_t *p = b->a.pool; - - if (m + n == 0) { + if (a->a.nelts + b->a.nelts == 0) { return; } - /* copy (extend) a using b's pool */ - if (a->a.pool != p) { - make_array_core(&a->a, p, m+n, sizeof(apr_table_entry_t), 0); +#if APR_POOL_DEBUG + /* Since the keys and values are not copied, it's required that + * b->a.pool has a lifetime at least as long as a->a.pool. */ + if (!apr_pool_is_ancestor(b->a.pool, a->a.pool)) { + fprintf(stderr, "apr_table_overlap: b's pool is not an ancestor of a's\n"); + abort(); } +#endif apr_table_cat(a, b); |