Skip to content

Commit

Permalink
Use calloc when allocating loop on Windows (#11409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored May 28, 2024
1 parent 34b02ad commit 3d11e50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/bun-usockets/src/eventing/libuv.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ struct us_loop_t *us_create_loop(void *hint,
void (*post_cb)(struct us_loop_t *loop),
unsigned int ext_size) {
struct us_loop_t *loop =
(struct us_loop_t *)malloc(sizeof(struct us_loop_t) + ext_size);
(struct us_loop_t *)calloc(1, sizeof(struct us_loop_t) + ext_size);

loop->uv_loop = hint ? hint : uv_loop_new();
loop->is_default = hint != 0;
Expand Down

0 comments on commit 3d11e50

Please sign in to comment.