$OpenBSD: patch-db_database_cpp,v 1.2 2013/05/09 01:50:12 landry Exp $
Backport c3d5d52ad084a98cc161
Fix crash when connection to postgres fails.
--- db/database.cpp.orig	Wed Mar 10 13:17:56 2010
+++ db/database.cpp	Thu May  9 03:37:13 2013
@@ -339,6 +339,8 @@ void Database::removeHandle( Database * d )
         return;
 
     handles->remove( d );
+    if ( !totalDbConnections )
+        totalDbConnections = new GraphableNumber( "total-db-connections" );
     totalDbConnections->setValue( handles->count() );
     if ( !handles->isEmpty() )
         return;
