authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 18:25:45 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 18:25:45 -07:00
logc20de5ff5a7211007b57f8ae8914319debb473c4
treead4e5a8875eb5221a5204a30f2c181975faaffce
parent5d1f855a2c560a2fc10a05ce9cb59e0865e8bff4
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

fix another memory leak on error


3 files changed, 33 insertions(+), 0 deletions(-)

fuzz/crashes/id:000002,sig:06,src:000000,time:12249,execs:9637,op:int8,pos:0,val:+32 created+31
...@@ -0,0 +1,31 @@
1 d: g982zq6e8wsvnmduerpbf8787hu85brugmngn8wf
2name: yaml
3main: yaml.zig
4license: MIT
5description: A Yaml parser built on top of libyaml
6dependencies:
7 - src: git https://github.com/yaml/libyaml tag-0.2.5
8 id: 8mdbh0zuneb0i3hs5jby5je0heem1i6yxusl7c8y8qx68hqc
9 license: MIT
10 c_include_dirs:
11 - include
12 c_source_flags:
13 - -DYAML_VERSION_MAJOR=0
14 - -DYAML_VERSION_MINOR=2
15 - -DYAML_VERSION_PATCH=5
16 - -DYAML_VERSION_STRING="0.2.5"
17 - -DYAML_DECLARE_STATIC=1
18 c_source_files:
19 - src/api.c
20 - src/dumper.c
21 - src/emitter.c
22 - src/loader.c
23 - src/parser.c
24 - src/reader.c
25 - src/scanner.c
26 - src/writer.c
27
28 - src: git https://github.com/nektro/zig-extras
29
30root_dependencies:
31 - src: git https://github.com/nektro/zig-expect
test.zig+1
...@@ -23,6 +23,7 @@ test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:2049...@@ -23,6 +23,7 @@ test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:2049
23test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:6342,execs:4701,op:arith8,pos:55,val:+3")); }23test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:6342,execs:4701,op:arith8,pos:55,val:+3")); }
24test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1310,execs:717,op:quick,pos:97")); }24test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1310,execs:717,op:quick,pos:97")); }
25test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1399,execs:755,op:quick,pos:149")); }25test { fuzzCase(@embedFile("./fuzz/crashes/id:000000,sig:06,src:000000,time:1399,execs:755,op:quick,pos:149")); }
26test { fuzzCase(@embedFile("./fuzz/crashes/id:000002,sig:06,src:000000,time:12249,execs:9637,op:int8,pos:0,val:+32")); }
26// zig fmt: on27// zig fmt: on
2728
28fn parseTest(comptime basename: [:0]const u8) !void {29fn parseTest(comptime basename: [:0]const u8) !void {
yaml.zig+1
...@@ -284,6 +284,7 @@ fn parse_item(p: *Parser, start: ?Token) Error!Item {...@@ -284,6 +284,7 @@ fn parse_item(p: *Parser, start: ?Token) Error!Item {
284fn parse_stream(p: *Parser) Error!Stream {284fn parse_stream(p: *Parser) Error!Stream {
285 var res = std.ArrayList(Document).init(p.alloc);285 var res = std.ArrayList(Document).init(p.alloc);
286 errdefer res.deinit();286 errdefer res.deinit();
287 errdefer for (res.items) |k| k.deinit(p.alloc);
287288
288 while (true) {289 while (true) {
289 const tok = try p.next();290 const tok = try p.next();