From: Ilia Alshanetsky Date: Tue, 3 Feb 2009 19:23:12 +0000 (+0000) Subject: MFB: Return empty string when recv() does not fetch any data X-Git-Tag: php-5.4.0alpha1~191^2~4334 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f902e8d2507a9cee18f6e7a8aa0de8cf975f0cbb;p=php MFB: Return empty string when recv() does not fetch any data --- diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 86be02eb5c..59f7b2b83f 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1036,6 +1036,9 @@ PHP_FUNCTION(socket_read) efree(tmpbuf); RETURN_FALSE; + } else if (!retval) { + efree(tmpbuf); + RETURN_EMPTY_STRING(); } tmpbuf = erealloc(tmpbuf, retval + 1);