Fix a memory leak

This commit is contained in:
Max Lv
2017-02-17 12:31:22 +08:00
parent 97ac602dbf
commit d434cd20ec
8 changed files with 32 additions and 24 deletions
+2 -2
View File
@@ -1201,8 +1201,8 @@ new_server(int fd, listen_ctx_t *listener)
server->listen_ctx = listener;
server->remote = NULL;
server->e_ctx = ss_malloc(sizeof(cipher_ctx_t));
server->d_ctx = ss_malloc(sizeof(cipher_ctx_t));
server->e_ctx = ss_align(sizeof(cipher_ctx_t));
server->d_ctx = ss_align(sizeof(cipher_ctx_t));
crypto->ctx_init(crypto->cipher, server->e_ctx, 1);
crypto->ctx_init(crypto->cipher, server->d_ctx, 0);