Skip to content

Commit

Permalink
[Bun.serve] Fix crash on invalid certificate file path for SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Aug 12, 2022
1 parent 66869f2 commit 2ac8c83
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/bun.js/api/server.zig
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ pub const ServerConfig = struct {
};

inline for (fields) |field| {
const slice = std.mem.span(@field(this, field));
if (slice.len > 0) {
bun.default_allocator.free(slice);
if (@field(this, field) != null) {
const slice = std.mem.span(@field(this, field));
if (slice.len > 0) {
bun.default_allocator.free(slice);
}
}
}
}
Expand Down

0 comments on commit 2ac8c83

Please sign in to comment.