Skip to content

Commit 79574ed

Browse files
committed
Use defer to free hashed_pass
1 parent aae8909 commit 79574ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

demo/src/app/views/login.zig

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ test "setup" {
4141
var app = try jetzig.testing.app(std.testing.allocator, @import("routes"));
4242
defer app.deinit();
4343
const hashed_pass = try auth.hashPassword(app.allocator, "test");
44+
defer app.allocator.free(hashed_pass);
4445
try app.repo.insert(.User, .{
4546
.id = 1,
4647
.email = "[email protected]",
4748
.password_hash = hashed_pass,
4849
});
49-
app.allocator.free(hashed_pass);
5050
}
5151

5252
test "post" {

0 commit comments

Comments
 (0)