summaryrefslogtreecommitdiff
path: root/ext/standard/streamsfuncs.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2014-03-05 16:03:05 +0800
committerXinchen Hui <laruence@gmail.com>2014-03-05 16:03:05 +0800
commitcb5e9eac9fa56978f1eb75939c19a253d3a7a6ab (patch)
tree56c9af35b2eeaa134c9f109ae8da6d74b868ba7f /ext/standard/streamsfuncs.c
parentdc889b69ef8947a87a93a59a24013d972b313158 (diff)
downloadphp-git-cb5e9eac9fa56978f1eb75939c19a253d3a7a6ab.tar.gz
Fixed memory leak (ext/standard/tests/file/stream_002.phpt)
Diffstat (limited to 'ext/standard/streamsfuncs.c')
-rw-r--r--ext/standard/streamsfuncs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index 39c0d17bc2..8dfd08a347 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);
}