]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - mp.c
mood.c: Remove row_is_admissible().
[paraslash.git] / mp.c
diff --git a/mp.c b/mp.c
index b5fa9cacaa6dcf9f3e2ef6f99fd025757f12097c..fb5a0c07472c46bb7d5ca42fcb4061d54755f96b 100644 (file)
--- a/mp.c
+++ b/mp.c
@@ -90,7 +90,7 @@ unsigned parse_quoted_string(const char *src, const char quote_chars[2],
 
        assert(len >= 2);
        assert(src[0] == quote_chars[0]);
-       p = dst = para_malloc(len - 1);
+       p = dst = alloc(len - 1);
        backslash = false;
        for (n = 1;; n++) {
                char c;
@@ -518,7 +518,7 @@ int mp_init(const char *definition, int nbytes, struct mp_context **result,
                        *errmsg = NULL;
                return 0;
        }
-       ctx = para_calloc(sizeof(*ctx));
+       ctx = zalloc(sizeof(*ctx));
        ctx->errmsg = NULL;
        ctx->ast = NULL;
 
@@ -531,6 +531,7 @@ int mp_init(const char *definition, int nbytes, struct mp_context **result,
        mp_yy_delete_buffer(buffer_state, scanner);
        mp_yylex_destroy(scanner);
        if (ctx->errmsg) { /* parse error */
+               mp_free_ast(ctx->ast);
                if (errmsg)
                        *errmsg = ctx->errmsg;
                else