mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-18 18:08:10 +00:00
cdp: fix memory leak in msg parsing of the JSON
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -23,6 +23,7 @@ const Ctx = server.Ctx;
|
||||
const cdp = @import("cdp.zig");
|
||||
const result = cdp.result;
|
||||
const IncomingMessage = @import("msg.zig").IncomingMessage;
|
||||
const Input = @import("msg.zig").Input;
|
||||
const stringify = cdp.stringify;
|
||||
|
||||
const log_cdp = std.log.scoped(.cdp);
|
||||
@@ -50,7 +51,8 @@ fn enable(
|
||||
msg: *IncomingMessage,
|
||||
_: *Ctx,
|
||||
) ![]const u8 {
|
||||
const input = try msg.getInput(alloc, void);
|
||||
const input = try Input(void).get(alloc, msg);
|
||||
defer input.deinit();
|
||||
log_cdp.debug("Req > id {d}, method {s}", .{ input.id, "log.enable" });
|
||||
|
||||
return result(alloc, input.id, null, null, input.sessionId);
|
||||
|
||||
Reference in New Issue
Block a user