diff options
author | 2022-08-11 19:28:23 -0700 | |
---|---|---|
committer | 2022-08-12 01:18:31 -0700 | |
commit | 2ac8c83be0fce4f56af3621d637d34f3fc1c39f5 (patch) | |
tree | 92e59172538d9e674096640ebadf5ee82fc7bd6f | |
parent | 66869f223967d212a488d4f22d3152b65f29506a (diff) | |
download | bun-2ac8c83be0fce4f56af3621d637d34f3fc1c39f5.tar.gz bun-2ac8c83be0fce4f56af3621d637d34f3fc1c39f5.tar.zst bun-2ac8c83be0fce4f56af3621d637d34f3fc1c39f5.zip |
[Bun.serve] Fix crash on invalid certificate file path for SSL
-rw-r--r-- | src/bun.js/api/server.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bun.js/api/server.zig b/src/bun.js/api/server.zig index 2419a9e55..df99aef71 100644 --- a/src/bun.js/api/server.zig +++ b/src/bun.js/api/server.zig @@ -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); + } } } } |