diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2012-04-20 11:09:02 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2012-04-20 11:09:02 +0200 |
commit | 7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa (patch) | |
tree | 46bf833c57aaae9720084b107cd2f4f7e3a1fc84 /pool.c | |
parent | c6ed5885ba8841a746c98a79635998c8890e73f1 (diff) | |
download | pgfuse-7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa.tar.gz pgfuse-7b6fc96d7710b1467420a548a7ae7b1e9b7b56fa.tar.bz2 |
fixed some nasty bugs
Diffstat (limited to 'pool.c')
-rw-r--r-- | pool.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |