char *passwd;
if (hash != NULL) {
hashFreeItems(hash, my_free);
+ hashFreeMemory(hash);
}
/* initial setup */
hash = hash_create((HASHCMP *) strcmp, 7921, hash_string);
}
rfc1738_unescape(user);
rfc1738_unescape(passwd);
- u = (user_data *)hash_lookup(hash, user);
+ u = (user_data *) hash_lookup(hash, user);
if (u == NULL) {
printf("ERR No such user\n");
} else if (strcmp(u->passwd, (char *) crypt(passwd, u->passwd)) == 0) {
printf("ERR Wrong password\n");
}
}
+ if (hash != NULL) {
+ hashFreeItems(hash, my_free);
+ hashFreeMemory(hash);
+ }
exit(0);
}