Skip to content

Commit

Permalink
Merge pull request #3037 from Emantor/topic/gluon-adv-filterd-alloc
Browse files Browse the repository at this point in the history
gluon-radv-filterd: replace malloc with calloc
  • Loading branch information
neocturne authored Oct 30, 2023
2 parents c2fc4e5 + 56cde73 commit d35305b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions package/gluon-radv-filterd/src/gluon-radv-filterd.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,16 +306,13 @@ static struct router *router_find_orig(const struct ether_addr *orig) {
static struct router *router_add(const struct ether_addr *mac) {
struct router *router;

router = malloc(sizeof(*router));
router = calloc(1, sizeof(*router));
if (!router)
return NULL;

router->src = *mac;
router->next = G.routers;
G.routers = router;
router->eol.tv_sec = 0;
router->eol.tv_nsec = 0;
memset(&router->originator, 0, sizeof(router->originator));

return router;
}
Expand Down

0 comments on commit d35305b

Please sign in to comment.