Merge branch 'debian'
[hcoop/debian/courier-authlib.git] / authpgsqllib.c
index b66b4f1..924323b 100644 (file)
@@ -28,7 +28,6 @@
 #define                SV_BEGIN_LEN            ((sizeof(SV_BEGIN_MARK))-1)
 #define                SV_END_LEN              ((sizeof(SV_END_MARK))-1)
 
-static const char rcsid[]="$Id: authpgsqllib.c,v 1.19 2008/12/18 12:08:25 mrsam Exp $";
 
 /* tom@minnesota.com */
 struct var_data {                      
@@ -220,6 +219,7 @@ const       char *server_opt=0;
                                userid ? userid : "<null>",
                                database);
                err("%s", PQerrorMessage(pgconn));
+               PQfinish(pgconn);
                pgconn=0;
                return -1;
        }
@@ -619,7 +619,6 @@ struct authpgsqluserinfo *auth_pgsql_getuserinfo(const char *username,
                user_table, login_field, username_escaped, \
                where_pfix, where_clause, where_sfix
 
-
        if (do_connect())       return (0);
 
        initui();
@@ -995,7 +994,11 @@ void auth_pgsql_enumerate( void(*cb_func)(const char *name,
 
        int i,n;
 
-       if (do_connect())       return;
+       if (do_connect())
+       {
+               (*cb_func)(NULL, 0, 0, NULL, NULL, NULL, void_arg);
+               return;
+       }
 
        initui();