Commit 93d7bf89 authored by Max Lv's avatar Max Lv

fix bugs reported by valgrind

parent b16ac605
No preview for this file type
......@@ -38,7 +38,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := shadowsocks
LOCAL_SRC_FILES := shadowsocks/local.c shadowsocks/encrypt.c
LOCAL_CFLAGS := -Wall -O2 -I$(LOCAL_PATH)/libev/ -I$(LOCAL_PATH)/openssl/include -std=c99
LOCAL_CFLAGS := -Wall -O2 -fno-strict-aliasing -I$(LOCAL_PATH)/libev/ -I$(LOCAL_PATH)/openssl/include
LOCAL_STATIC_LIBRARIES := libev libcrypto
......
......@@ -446,6 +446,7 @@ struct remote* new_remote(int fd) {
remote->recv_ctx->connected = 0;
remote->send_ctx->remote = remote;
remote->send_ctx->connected = 0;
remote->buf_len = 0;
return remote;
}
......@@ -490,6 +491,7 @@ struct server* new_server(int fd) {
server->e_ctx = NULL;
server->d_ctx = NULL;
}
server->buf_len = 0;
return server;
}
void free_server(struct server *server) {
......
No preview for this file type
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment