From a0d12999615d01b231b5c876638198acbf7c5b93 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Wed, 21 Jan 2015 20:37:40 +0800 Subject: [PATCH] fix #232 --- src/local.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/local.c b/src/local.c index ae7bdb69..522ac40e 100644 --- a/src/local.c +++ b/src/local.c @@ -363,10 +363,11 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents) close_and_free_server(EV_A_ server); return; } else { - char *ss_addr_to_send = malloc(BUF_SIZE); + char host[256], port[16]; + char ss_addr_to_send[320]; + ssize_t addr_len = 0; ss_addr_to_send[addr_len++] = request->atyp; - char host[256], port[16]; // get remote addr and port if (request->atyp == 1) {