When flushing a name from the cache, clear it from the transaction
chain as well, or you could end up reading free'ed memory later.
char *name;
enum tables type;
{
- int h;
register struct item *i;
- h = hashname(name, type);
+ /* first clear it out of the transaction chain */
+ for (i = &cachehead; i && i->trans; i = i->trans) {
+ if (!strcmp(name, i->trans->name) && type==i->trans->type) {
+ i->trans = i->trans->trans;
+ }
+ }
+ /* now remove it */
for (i = cachehead.next; i != &cachehead; i = i->next) {
if (!strcmp(name, i->name) && type==i->type) {
cachesize--;