[dovecot-cvs] dovecot/src/lib mempool-alloconly.c, 1.35.2.5, 1.35.2.6

tss at dovecot.org tss at dovecot.org
Sun Feb 25 15:40:36 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv23899

Modified Files:
      Tag: branch_1_0
	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.35.2.5
retrieving revision 1.35.2.6
diff -u -d -r1.35.2.5 -r1.35.2.6
--- mempool-alloconly.c	18 Jan 2007 15:33:34 -0000	1.35.2.5
+++ mempool-alloconly.c	25 Feb 2007 15:40:34 -0000	1.35.2.6
@@ -167,12 +167,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