summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/expression.c1
-rw-r--r--src/hash.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/expression.c b/src/expression.c
index 0edc1d22..eece12e4 100644
--- a/src/expression.c
+++ b/src/expression.c
@@ -1097,6 +1097,7 @@ static void set_elem_expr_destroy(struct expr *expr)
{
xfree(expr->comment);
expr_free(expr->key);
+ stmt_free(expr->stmt);
}
static void set_elem_expr_clone(struct expr *new, const struct expr *expr)
diff --git a/src/hash.c b/src/hash.c
index 208f4b6b..08e09099 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -56,6 +56,11 @@ static void hash_expr_clone(struct expr *new, const struct expr *expr)
new->hash.type = expr->hash.type;
}
+static void hash_expr_destroy(struct expr *expr)
+{
+ expr_free(expr->hash.expr);
+}
+
const struct expr_ops hash_expr_ops = {
.type = EXPR_HASH,
.name = "hash",
@@ -63,6 +68,7 @@ const struct expr_ops hash_expr_ops = {
.json = hash_expr_json,
.cmp = hash_expr_cmp,
.clone = hash_expr_clone,
+ .destroy = hash_expr_destroy,
};
struct expr *hash_expr_alloc(const struct location *loc,