com php-src: Fixed memory leak (ext/standard/tests/file/strea m_002.phpt): ext/standard/streamsfuncs.c

From: Date: Wed, 05 Mar 2014 08:03:05 +0000
Subject: com php-src: Fixed memory leak (ext/standard/tests/file/strea m_002.phpt): ext/standard/streamsfuncs.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77748@lists.php.net to get a copy of this message
Commit: cb5e9eac9fa56978f1eb75939c19a253d3a7a6ab Author: Xinchen Hui <laruence@gmail.com> Wed, 5 Mar 2014 16:03:05 +0800 Parents: dc889b69ef8947a87a93a59a24013d972b313158 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb5e9eac9fa56978f1eb75939c19a253d3a7a6ab Log: Fixed memory leak (ext/standard/tests/file/stream_002.phpt) Changed paths: M ext/standard/streamsfuncs.c Diff: diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 39c0d17..8dfd08a 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -120,10 +120,12 @@ PHP_FUNCTION(stream_socket_client) tv.tv_usec = conv % 1000000; #endif if (zerrno) { + zerrno = Z_REFVAL_P(zerrno); zval_dtor(zerrno); ZVAL_LONG(zerrno, 0); } if (zerrstr) { + zerrstr = Z_REFVAL_P(zerrstr); zval_dtor(zerrstr); ZVAL_EMPTY_STRING(zerrstr); } @@ -156,6 +158,7 @@ PHP_FUNCTION(stream_socket_client) zval_dtor(zerrstr); //??? ZVAL_STRING(zerrstr, errstr, 0); ZVAL_STRING(zerrstr, errstr); + efree(errstr); } else if (errstr) { efree(errstr); }

« previous php.cvs (#77748) next »