Skip to content

Commit

Permalink
std.compress.zstandard: free allocated result on error
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiller committed Feb 2, 2023
1 parent 2189811 commit ea82ec2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/std/compress/zstandard/decompress.zig
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ pub fn decodeZstandardFrameAlloc(
window_size_max: usize,
) (error{OutOfMemory} || FrameContext.Error || FrameError)!DecodeResult {
var result = std.ArrayList(u8).init(allocator);
errdefer result.deinit();
assert(readInt(u32, src[0..4]) == frame.Zstandard.magic_number);
var consumed_count: usize = 4;

Expand Down

0 comments on commit ea82ec2

Please sign in to comment.