diff options
Diffstat (limited to 'src/common/socket.c')
-rw-r--r-- | src/common/socket.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index a039006f0..ea8a2cfcc 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -592,6 +592,7 @@ static int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseF session[fd]->func_send = func_send; session[fd]->func_parse = func_parse; session[fd]->rdata_tick = last_tick; + session[fd]->session_data = NULL; return 0; } @@ -605,7 +606,8 @@ static void delete_session(int fd) #endif aFree(session[fd]->rdata); aFree(session[fd]->wdata); - aFree(session[fd]->session_data); + if( session[fd]->session_data ) + aFree(session[fd]->session_data); aFree(session[fd]); session[fd] = NULL; } |