From 537faa6beefe2fe562ed7d6c4921778166ef634f Mon Sep 17 00:00:00 2001 From: nishi Date: Tue, 30 Apr 2024 02:57:05 +0000 Subject: [PATCH] fixed git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@90 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- Serenade/interpreter.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Serenade/interpreter.c b/Serenade/interpreter.c index e4b3f30..acbfdb2 100644 --- a/Serenade/interpreter.c +++ b/Serenade/interpreter.c @@ -184,13 +184,10 @@ void sn_interpreter_free(struct sn_interpreter* sn) { if(sn->variables[i] != NULL){ free(sn->variables[i]->key); if(sn->variables[i]->value != NULL) sn_generic_free(sn, sn->variables[i]->value); - if(sn->variables[i] != NULL){ - sn->variables[i]->value = NULL; - free(sn->variables[i]); - } + sn->variables[i]->value = NULL; + free(sn->variables[i]); } } - free(sn->variables); for(i = 0; sn->generics[i] != NULL; i++) { int j; for(j = 0; sn->generics[i][j] != NULL; j++){ @@ -199,6 +196,7 @@ void sn_interpreter_free(struct sn_interpreter* sn) { free(sn->generics[i]); } free(sn->generics); + free(sn->variables); free(sn); } -- 2.43.0