]> Nishi Git Mirror - serenade.git/commitdiff
fixed
authornishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Tue, 30 Apr 2024 02:57:05 +0000 (02:57 +0000)
committernishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Tue, 30 Apr 2024 02:57:05 +0000 (02:57 +0000)
git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@90 0f02c867-ac3d-714e-8a88-971ba1f6efcf

Serenade/interpreter.c

index e4b3f30a7b5897e870670e1ad23a2a6b1d0d50d3..acbfdb2fc9af2bbed449d0be82ba4098652f18cc 100644 (file)
@@ -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);
 }