aboutsummaryrefslogtreecommitdiffstats
path: root/edify/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'edify/main.c')
-rw-r--r--edify/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/edify/main.c b/edify/main.c
index a2b74ad..8557043 100644
--- a/edify/main.c
+++ b/edify/main.c
@@ -42,11 +42,12 @@ int expect(const char* expr_str, const char* expected, int* errors) {
State state;
state.cookie = NULL;
- state.script = expr_str;
+ state.script = strdup(expr_str);
state.errmsg = NULL;
result = Evaluate(&state, e);
free(state.errmsg);
+ free(state.script);
if (result == NULL && expected != NULL) {
fprintf(stderr, "error evaluating \"%s\"\n", expr_str);
++*errors;