Memset 0 server in addition to client
This commit is contained in:
parent
a4c3018c79
commit
4a4611f20d
1 changed files with 2 additions and 0 deletions
|
@ -68,6 +68,7 @@ void serv_init_udp_socket(char* port, struct donar_server_ctx* ctx) {
|
|||
fdinfo.cat->name = "udp-read";
|
||||
fdinfo.other = malloc(sizeof(struct udp_target));
|
||||
if (fdinfo.other == NULL) goto socket_failed;
|
||||
memset(fdinfo.other, 0, sizeof(struct udp_target));
|
||||
sprintf(fdinfo.url, "udp:read:127.0.0.1:%s", port);
|
||||
evt_core_add_fd (&(ctx->evts), &fdinfo);
|
||||
|
||||
|
@ -75,6 +76,7 @@ void serv_init_udp_socket(char* port, struct donar_server_ctx* ctx) {
|
|||
fdinfo.cat->name = "udp-write";
|
||||
fdinfo.other = malloc(sizeof(struct udp_target));
|
||||
if (fdinfo.other == NULL) goto socket_failed;
|
||||
memset(fdinfo.other, 0, sizeof(struct udp_target));
|
||||
sprintf(fdinfo.url, "udp:write:127.0.0.1:%s", port);
|
||||
evt_core_add_fd (&(ctx->evts), &fdinfo);
|
||||
|
||||
|
|
Loading…
Reference in a new issue