From 180b0ec2ff3e6224f5f7db7b6cf16fffe314f987 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Wed, 2 Aug 2023 13:50:46 -0700 Subject: [PATCH] use the right allocator in soon to be refactored function --- src/lambda.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lambda.zig b/src/lambda.zig index 471b226..254b207 100644 --- a/src/lambda.zig +++ b/src/lambda.zig @@ -175,7 +175,7 @@ pub fn run(allocator: ?std.mem.Allocator, event_handler: HandlerFn) !void { // T // TODO: We should catch these potential alloc errors too // TODO: This whole loop should be in another function so we can catch everything at once const response_url = try std.fmt.allocPrint(req_allocator, "{s}{s}{s}/{s}/response", .{ prefix, lambda_runtime_uri, postfix, req_id }); - defer alloc.free(response_url); + defer req_allocator.free(response_url); const response_uri = try std.Uri.parse(response_url); const response_content = try std.fmt.allocPrint(req_allocator, "{s} \"content\": \"{s}\" {s}", .{ "{", event_response, "}" }); var resp_req = try client.request(.POST, response_uri, empty_headers, .{});