aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/root.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/root.zig b/src/root.zig
index e61ed1f..e2152d3 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -12,6 +12,7 @@ pub fn run(allocator: std.mem.Allocator, input: []const u8, query: []const u8) !
try runtime.compileFromSlice(query);
try runtime.start(json);
const result = try runtime.next() orelse return error.NoResult;
+ defer result.deinit(allocator);
const output = try jv.stringify(allocator, result);
return output;
}
@@ -34,6 +35,7 @@ fn testRunMultiple(expected: []const []const u8, input: []const u8, query: []con
for (expected) |ex| {
const result_value = try runtime.next() orelse return error.NoResult;
+ defer result_value.deinit(allocator);
const result = try jv.stringify(allocator, result_value);
defer allocator.free(result);
try std.testing.expectEqualStrings(ex, result);