From aaf8617dd53676ea734a17661885504faabded10 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Tue, 28 Oct 2014 17:14:30 +0800 Subject: [PATCH] skynet_free(NULL) is ok --- skynet-src/skynet_socket.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/skynet-src/skynet_socket.c b/skynet-src/skynet_socket.c index b617418a..38ba4ea9 100644 --- a/skynet-src/skynet_socket.c +++ b/skynet-src/skynet_socket.c @@ -61,8 +61,7 @@ forward_message(int type, bool padding, struct socket_message * result) { if (skynet_context_push((uint32_t)result->opaque, &message)) { // todo: report somewhere to close socket // don't call skynet_socket_close here (It will block mainloop) - if (sm->buffer) - skynet_free(sm->buffer); + skynet_free(sm->buffer); skynet_free(sm); } }