ハッシュのfreeの方法を修正 v0.5p2
authorj8takagi <j8takagi@nifty.com>
Sat, 1 Sep 2018 09:14:08 +0000 (18:14 +0900)
committerj8takagi <j8takagi@nifty.com>
Sat, 1 Sep 2018 09:14:08 +0000 (18:14 +0900)
VERSION
src/label.c
src/struct.c

diff --git a/VERSION b/VERSION
index 8338111..be4999b 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-v0.5p1
+v0.5p2
 
index 63b6fe5..e88cc90 100644 (file)
@@ -166,10 +166,8 @@ void freelabel()
             FREE(p->label->prog);
             FREE(p->label->label);
             FREE(p->label);
-            if(p == labels[i]) {
-                labels[i] = NULL;
-            }
             FREE(p);
         }
+        labels[i] = NULL;
     }
 }
index f6d4128..22a7df3 100644 (file)
@@ -141,9 +141,9 @@ void free_cmdtable(CMDTAB_HASH hash)
     for(i = 0; i < CMDTABSIZE; i++) {
         for(p = cmdtab[hash][i]; p != NULL; p = q) {
             q = p->next;
-            cmdtab[hash][i] = NULL;
             FREE(p);
         }
+        cmdtab[hash][i] = NULL;
     }
 }