mirror of
https://github.com/php/php-src.git
synced 2024-11-29 12:53:37 +08:00
MFB: first check stream for NULL, then dereference
This commit is contained in:
parent
2c750d7f84
commit
a4f9c8efc2
@ -988,10 +988,12 @@ PHPAPI php_stream *_php_stream_sock_open_from_socket(php_socket_t socket, const
|
||||
sock->socket = socket;
|
||||
|
||||
stream = php_stream_alloc_rel(&php_stream_generic_socket_ops, sock, persistent_id, "r+");
|
||||
stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING;
|
||||
|
||||
if (stream == NULL)
|
||||
if (stream == NULL) {
|
||||
pefree(sock, persistent_id ? 1 : 0);
|
||||
} else {
|
||||
stream->flags |= PHP_STREAM_FLAG_AVOID_BLOCKING;
|
||||
}
|
||||
|
||||
return stream;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user