Skip to content

Commit

Permalink
Merge pull request #270 from lightpanda-io/loop-init-mem-leak
Browse files Browse the repository at this point in the history
loop: fix mem leak on init error
  • Loading branch information
krichprollsch authored Jan 22, 2025
2 parents 1b1b343 + 5274ff8 commit 7ea2731
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/loop.zig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pub const SingleThreaded = struct {

pub fn init(alloc: std.mem.Allocator) !Self {
const io = try alloc.create(IO);
errdefer alloc.destroy(io);

io.* = try IO.init(32, 0);
const events_nb = try alloc.create(usize);
events_nb.* = 0;
Expand Down

0 comments on commit 7ea2731

Please sign in to comment.