diff --git a/vlib/x/json2/decoder.v b/vlib/x/json2/decoder.v index f06ecabdce..1c749f06b0 100644 --- a/vlib/x/json2/decoder.v +++ b/vlib/x/json2/decoder.v @@ -311,7 +311,7 @@ fn (mut p Parser) decode_string() ?Any { } p.next() defer { - strwr.free() + unsafe { strwr.free() } } str := strwr.str() return Any(str) diff --git a/vlib/x/json2/encoder.v b/vlib/x/json2/encoder.v index f107d5dd36..c929c7e160 100644 --- a/vlib/x/json2/encoder.v +++ b/vlib/x/json2/encoder.v @@ -30,7 +30,7 @@ pub fn (flds map[string]Any) str() string { } wr.write_b(`}`) defer { - wr.free() + unsafe { wr.free() } } res := wr.str() return res @@ -45,7 +45,7 @@ pub fn (flds []Any) str() string { } wr.write_b(`]`) defer { - wr.free() + unsafe { wr.free() } } res := wr.str() return res