Re-set FP after closing it
authorAlan T. DeKok <aland@freeradius.org>
Sat, 5 Dec 2009 14:54:08 +0000 (15:54 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 5 Dec 2009 14:54:08 +0000 (15:54 +0100)
src/modules/rlm_passwd/rlm_passwd.c

index 46e5a74..ad179fb 100644 (file)
@@ -308,7 +308,10 @@ static struct mypasswd * get_pw_nam(char * name, struct hashtable* ht)
                        }
                return NULL;
        }
-       if (ht->fp) fclose(ht->fp);
+       if (ht->fp) {
+               fclose(ht->fp);
+               ht->fp = NULL;
+       }
        if (!(ht->fp=fopen(ht->filename, "r"))) return NULL;
        return get_next(name, ht);
 }