From: j8takagi Date: Sat, 1 Sep 2018 09:14:08 +0000 (+0900) Subject: ハッシュのfreeの方法を修正 X-Git-Tag: v0.5p2 X-Git-Url: https://j8takagi.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a18fa159a8b538ca0e6513a0c2051ac178302bd6;p=YACASL2.git ハッシュのfreeの方法を修正 --- diff --git a/VERSION b/VERSION index 8338111..be4999b 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -v0.5p1 +v0.5p2 diff --git a/src/label.c b/src/label.c index 63b6fe5..e88cc90 100644 --- a/src/label.c +++ b/src/label.c @@ -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; } } diff --git a/src/struct.c b/src/struct.c index f6d4128..22a7df3 100644 --- a/src/struct.c +++ b/src/struct.c @@ -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; } }