Use calloc
This commit is contained in:
2
mud.c
2
mud.c
@@ -119,7 +119,7 @@ void mud_new_addr (struct mud *mud, struct sockaddr_storage *addr, socklen_t add
|
|||||||
static
|
static
|
||||||
void mud_new_sock (struct mud *mud, int fd, int family)
|
void mud_new_sock (struct mud *mud, int fd, int family)
|
||||||
{
|
{
|
||||||
struct sock *sock = malloc(sizeof(struct sock));
|
struct sock *sock = calloc(1, sizeof(struct sock));
|
||||||
|
|
||||||
if (!sock)
|
if (!sock)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user