summaryrefslogtreecommitdiff
path: root/lib/command_match.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/command_match.c')
-rw-r--r--lib/command_match.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/command_match.c b/lib/command_match.c
index ca2135a1c2..75780de2c5 100644
--- a/lib/command_match.c
+++ b/lib/command_match.c
@@ -94,7 +94,7 @@ command_match (struct graph *cmdgraph,
// prepend a dummy token to match that pesky start node
vector vvline = vector_init (vline->alloced + 1);
- vector_set_index (vvline, 0, (void *) "dummy");
+ vector_set_index (vvline, 0, (void *) XSTRDUP (MTYPE_TMP, "dummy"));
memcpy (vvline->index + 1, vline->index, sizeof (void *) * vline->alloced);
vvline->active = vline->active + 1;
@@ -114,6 +114,11 @@ command_match (struct graph *cmdgraph,
assert (*el);
}
+ // free the leader token we alloc'd
+ XFREE (MTYPE_TMP, vector_slot (vvline, 0));
+ // free vector
+ vector_free (vvline);
+
return matcher_rv;
}