diff options
author | erwin <erwin@FreeBSD.org> | 2013-07-24 07:12:55 +0000 |
---|---|---|
committer | erwin <erwin@FreeBSD.org> | 2013-07-24 07:12:55 +0000 |
commit | dc235a59431db02e1a04d85de49af9e278510ac8 (patch) | |
tree | e392027bf54f7a1fd2a6f3a16ecb4487844b44e9 /lib/isc/taskpool.c | |
parent | 9ef4e0591273b7d40b98ef46084442638150b2fc (diff) | |
download | FreeBSD-src-dc235a59431db02e1a04d85de49af9e278510ac8.zip FreeBSD-src-dc235a59431db02e1a04d85de49af9e278510ac8.tar.gz |
Vendor import of Bind 9.8.5-P1
Approved by: delphij (mentor)
Sponsored by: DK Hostmaster A/S
Diffstat (limited to 'lib/isc/taskpool.c')
-rw-r--r-- | lib/isc/taskpool.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/isc/taskpool.c b/lib/isc/taskpool.c index 936732c..7324cfa 100644 --- a/lib/isc/taskpool.c +++ b/lib/isc/taskpool.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2011, 2012 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2011-2013 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -52,13 +52,15 @@ alloc_pool(isc_taskmgr_t *tmgr, isc_mem_t *mctx, unsigned int ntasks, pool = isc_mem_get(mctx, sizeof(*pool)); if (pool == NULL) return (ISC_R_NOMEMORY); - pool->mctx = mctx; + + pool->mctx = NULL; + isc_mem_attach(mctx, &pool->mctx); pool->ntasks = ntasks; pool->quantum = quantum; pool->tmgr = tmgr; pool->tasks = isc_mem_get(mctx, ntasks * sizeof(isc_task_t *)); if (pool->tasks == NULL) { - isc_mem_put(mctx, pool, sizeof(*pool)); + isc_mem_putanddetach(&pool->mctx, pool, sizeof(*pool)); return (ISC_R_NOMEMORY); } for (i = 0; i < ntasks; i++) @@ -169,7 +171,7 @@ isc_taskpool_destroy(isc_taskpool_t **poolp) { } isc_mem_put(pool->mctx, pool->tasks, pool->ntasks * sizeof(isc_task_t *)); - isc_mem_put(pool->mctx, pool, sizeof(*pool)); + isc_mem_putanddetach(&pool->mctx, pool, sizeof(*pool)); *poolp = NULL; } |