Skip to content

Commit

Permalink
scheduler: use calloc instead of malloc
Browse files Browse the repository at this point in the history
This is fixing a use-after-free if multiple schedulers are used in a
single run.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=60089

Signed-off-by: David Korczynski <[email protected]>
  • Loading branch information
DavidKorczynski committed Sep 22, 2023
1 parent 2631ca1 commit a225804
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flb_scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ struct flb_sched *flb_sched_create(struct flb_config *config,
struct flb_sched *sched;
struct flb_sched_timer *timer;

sched = flb_malloc(sizeof(struct flb_sched));
sched = flb_calloc(1, sizeof(struct flb_sched));
if (!sched) {
flb_errno();
return NULL;
Expand Down

0 comments on commit a225804

Please sign in to comment.