Skip to content

Commit e9bdbce

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Don't leak peername if accept fails
2 parents 04ab4d0 + 912e490 commit e9bdbce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/standard/streamsfuncs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,9 @@ PHP_FUNCTION(stream_socket_accept)
281281
}
282282
php_stream_to_zval(clistream, return_value);
283283
} else {
284+
if (peername) {
285+
zend_string_release(peername);
286+
}
284287
php_error_docref(NULL, E_WARNING, "Accept failed: %s", errstr ? ZSTR_VAL(errstr) : "Unknown error");
285288
RETVAL_FALSE;
286289
}

0 commit comments

Comments
 (0)