Skip to content

Commit ea82ec2

Browse files
author
dweiller
committed
std.compress.zstandard: free allocated result on error
1 parent 2189811 commit ea82ec2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/std/compress/zstandard/decompress.zig

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ pub fn decodeZstandardFrameAlloc(
266266
window_size_max: usize,
267267
) (error{OutOfMemory} || FrameContext.Error || FrameError)!DecodeResult {
268268
var result = std.ArrayList(u8).init(allocator);
269+
errdefer result.deinit();
269270
assert(readInt(u32, src[0..4]) == frame.Zstandard.magic_number);
270271
var consumed_count: usize = 4;
271272

0 commit comments

Comments
 (0)