11/*
22 * Copyright (c) 1994, Regents of the University of California
33 *
4- * $Id: password.c,v 1.26 1999/10 /2303:13:21 tgl Exp $
4+ * $Id: password.c,v 1.27 1999/11 /2301:04:38 tgl Exp $
55 *
66 */
77
@@ -45,6 +45,8 @@ verify_password(char *auth_arg, char *user, char *password)
4545return STATUS_ERROR ;
4646}
4747
48+ pfree (pw_file_fullname );
49+
4850while (!feof (pw_file ))
4951{
5052char pw_file_line [255 ],
@@ -67,15 +69,12 @@ verify_password(char *auth_arg, char *user, char *password)
6769
6870if (strcmp (user ,test_user )== 0 )
6971{
70- /* we're outta here one way or the other. */
72+ /* we're outta here one way or the other, so close file */
7173FreeFile (pw_file );
7274
7375if (strcmp (crypt (password ,test_pw ),test_pw )== 0 )
7476{
7577/* it matched. */
76-
77- pfree (pw_file_fullname );
78-
7978return STATUS_OK ;
8079}
8180
@@ -85,19 +84,17 @@ verify_password(char *auth_arg, char *user, char *password)
8584fputs (PQerrormsg ,stderr );
8685pqdebug ("%s" ,PQerrormsg );
8786
88- pfree (pw_file_fullname );
89-
9087return STATUS_ERROR ;
9188}
9289}
9390
91+ FreeFile (pw_file );
92+
9493snprintf (PQerrormsg ,PQERRORMSG_LENGTH ,
9594"verify_password: user '%s' not found in password file.\n" ,
9695user );
9796fputs (PQerrormsg ,stderr );
9897pqdebug ("%s" ,PQerrormsg );
9998
100- pfree (pw_file_fullname );
101-
10299return STATUS_ERROR ;
103100}