[dovecot-cvs] dovecot/src/lib mempool-alloconly.c,1.40,1.41
tss at dovecot.org
tss at dovecot.org
Sun Feb 25 15:40:41 UTC 2007
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv23908
Modified Files:
mempool-alloconly.c
Log Message:
alloconly pool: pool_unref() shouldn't set the pool pointer to NULL unless
refcount=0.
Index: mempool-alloconly.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/mempool-alloconly.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- mempool-alloconly.c 18 Jan 2007 15:33:36 -0000 1.40
+++ mempool-alloconly.c 25 Feb 2007 15:40:38 -0000 1.41
@@ -183,12 +183,14 @@
{
struct alloconly_pool *apool = (struct alloconly_pool *)*pool;
+ if (--apool->refcount > 0)
+ return;
+
/* erase the pointer before freeing anything, as the pointer may
exist inside the pool's memory area */
*pool = NULL;
- if (--apool->refcount == 0)
- pool_alloconly_destroy(apool);
+ pool_alloconly_destroy(apool);
}
static void block_alloc(struct alloconly_pool *apool, size_t size)
More information about the dovecot-cvs
mailing list