Skip to content

Commit

Permalink
Comment out malloc checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakio815 committed Dec 4, 2023
1 parent 0030dae commit 72ec3d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/federated/network/lf_socket_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ static socket_priv_t *get_priv(netdrv_t *drv)
netdrv_t * socket_init(int protocol) {
//TODO: Should it be malloc? To support different network stacks operate simulatneously?
netdrv_t *drv = malloc(sizeof(*drv) + sizeof(socket_priv_t)); //Don't need to call malloc() twice.
if (!drv) {// check if malloc worked.
lf_print_error_and_exit("Falied to malloc netdrv_t.");
}
memset(drv, 0, sizeof(*drv));
// if (!drv) {// check if malloc worked.
// lf_print_error_and_exit("Falied to malloc netdrv_t.");
// }
// memset(drv, 0, sizeof(*drv));

socket_priv_t *priv = get_priv(drv); //drv+1 return.
priv->proto = protocol;
Expand Down

0 comments on commit 72ec3d5

Please sign in to comment.