~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to src/modules/rlm_passwd/rlm_passwd.c

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2006-01-15 13:34:13 UTC
  • mto: (3.1.3 dapper) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060115133413-zo1dslttvdoalqym
Tags: upstream-1.1.0
ImportĀ upstreamĀ versionĀ 1.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
132
132
static void release_hash_table(struct hashtable * ht){
133
133
        int i;
134
134
 
135
 
        if (!ht) return;
136
 
        for (i=0; i<ht->tablesize; i++)
 
135
        if (ht == NULL) return;
 
136
        for (i = 0; i < ht->tablesize; i++)
137
137
                if (ht->table[i])
138
138
                        destroy_password(ht->table[i]);
139
 
        if (ht->table) free(ht->table);
140
 
        if (ht->fp) fclose(ht->fp);
 
139
        if (ht->table) {
 
140
                free(ht->table);
 
141
                ht->table = NULL;
 
142
        }
 
143
        if (ht->fp) {
 
144
                fclose(ht->fp);
 
145
                ht->fp = NULL;
 
146
        }
 
147
        ht->tablesize = 0;
141
148
}
142
149
 
143
150
static void release_ht(struct hashtable * ht){
194
201
                if(*buffer && *buffer!='\n' && (!ignorenis || (*buffer != '+' && *buffer != '-')) ){
195
202
                        if(!(hashentry = mypasswd_malloc(buffer, nfields, &len))){
196
203
                                release_hash_table(ht);
197
 
                                ht->tablesize = 0;
198
204
                                return ht;
199
205
                        }
200
206
                        len = string_to_entry(buffer, nfields, *ht->delimiter, hashentry, len);
219
225
                                        else nextlist = 0;
220
226
                                        if(!(hashentry1 = mypasswd_malloc("", nfields, &len))){
221
227
                                                release_hash_table(ht);
222
 
                                                ht->tablesize = 0;
223
228
                                                return ht;
224
229
                                        }
225
230
                                        for (i=0; i<nfields; i++) hashentry1->field[i] = hashentry->field[i];