From: danw Date: Wed, 12 Mar 1997 02:45:46 +0000 (+0000) Subject: redo this change that accidentally got undone during the code cleanup: X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/7f5495cfefa86f983e97e2b1df28bdae4be4460e redo this change that accidentally got undone during the code cleanup: 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. --- diff --git a/server/cache.pc b/server/cache.pc index fa155d3d..2fe40354 100644 --- a/server/cache.pc +++ b/server/cache.pc @@ -329,11 +329,16 @@ void flush_name(name, type) 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--;