summaryrefslogtreecommitdiff
path: root/pool.c
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2012-04-20 11:09:02 +0200
committerAndreas Baumann <abaumann@yahoo.com>2012-04-20 11:09:02 +0200
commit7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa (patch)
tree46bf833c57aaae9720084b107cd2f4f7e3a1fc84 /pool.c
parentc6ed5885ba8841a746c98a79635998c8890e73f1 (diff)
downloadpgfuse-7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa.tar.gz
pgfuse-7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa.tar.bz2
fixed some nasty bugs
Diffstat (limited to 'pool.c')
-rw-r--r--pool.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pool.c b/pool.c
index 5ad56c5..7f85ae7 100644
--- a/pool.c
+++ b/pool.c
@@ -109,6 +109,7 @@ int psql_pool_destroy( PgConnPool *pool )
}
free( pool->conns );
+ free( pool->avail );
res1 = pthread_cond_destroy( &pool->cond );
res2 = pthread_mutex_destroy( &pool->lock );
@@ -166,7 +167,7 @@ int psql_pool_release( PgConnPool *pool, PGconn *conn )
res = pthread_mutex_lock( &pool->lock );
if( res < 0 ) return res;
- for( i = pool->size; i >= 0; i-- ) {
+ for( i = pool->size-1; i >= 0; i-- ) {
if( pool->conns[i] == conn ) {
break;
}