Skip to content

Commit 912e490

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Don't leak peername if accept fails
2 parents 2a46f3e + b56fb90 commit 912e490

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
@@ -283,6 +283,9 @@ PHP_FUNCTION(stream_socket_accept)
283283
}
284284
php_stream_to_zval(clistream, return_value);
285285
} else {
286+
if (peername) {
287+
zend_string_release(peername);
288+
}
286289
php_error_docref(NULL, E_WARNING, "accept failed: %s", errstr ? ZSTR_VAL(errstr) : "Unknown error");
287290
RETVAL_FALSE;
288291
}

0 commit comments

Comments
 (0)