]> andersk Git - moira.git/commitdiff
redo this change that accidentally got undone during the code cleanup:
authordanw <danw>
Wed, 12 Mar 1997 02:45:46 +0000 (02:45 +0000)
committerdanw <danw>
Wed, 12 Mar 1997 02:45:46 +0000 (02:45 +0000)
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.

server/cache.pc

index fa155d3d2e74f3fa5b01050cdb65edf27ae439c3..2fe40354a0516ba8df6f952227ff4b5544733fff 100644 (file)
@@ -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--;
This page took 0.613815 seconds and 5 git commands to generate.