close fd when error

This commit is contained in:
云风
2013-08-13 11:28:19 +08:00
parent 41ee1aae4f
commit 461bab4d0b

View File

@@ -256,6 +256,7 @@ mread_create(uint32_t addr, int port , int max , int buffer_size) {
return NULL;
}
if ( -1 == _set_nonblocking(listen_fd) ) {
close(listen_fd);
return NULL;
}