summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/socket_wrapper.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 51422ea..e9af3e5 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1913,7 +1913,8 @@ static int swrap_socket(int family, int type, int protocol)
if (fd == -1) return -1;
- si = (struct socket_info *)calloc(1, sizeof(struct socket_info));
+ si = (struct socket_info *)malloc(sizeof(struct socket_info));
+ memset(si, 0, sizeof(struct socket_info));
if (si == NULL) {
errno = ENOMEM;
return -1;
@@ -2004,7 +2005,7 @@ static int swrap_accept(int s, struct sockaddr *addr, socklen_t *addrlen)
}
child_si = (struct socket_info *)malloc(sizeof(struct socket_info));
- memset(child_si, 0, sizeof(*child_si));
+ memset(child_si, 0, sizeof(struct socket_info));
child_fi = (struct socket_info_fd *)calloc(1, sizeof(struct socket_info_fd));
if (child_fi == NULL) {