projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix leak
[m6w6/ext-http]
/
php_http_message.c
diff --git
a/php_http_message.c
b/php_http_message.c
index 07f793b6d1f99e7510381e6882e3d3f021b507e4..066deca86566b3e640d6e92e0d9ab2f112e39c49 100644
(file)
--- a/
php_http_message.c
+++ b/
php_http_message.c
@@
-12,10
+12,6
@@
#include "php_http_api.h"
#include "php_http_api.h"
-#include <SAPI.h>
-#include <ext/spl/spl_iterators.h>
-#include <zend_interfaces.h>
-
PHP_HTTP_API zend_bool php_http_message_info_callback(php_http_message_t **message, HashTable **headers, php_http_info_t *info TSRMLS_DC)
{
php_http_message_t *old = *message;
PHP_HTTP_API zend_bool php_http_message_info_callback(php_http_message_t **message, HashTable **headers, php_http_info_t *info TSRMLS_DC)
{
php_http_message_t *old = *message;
@@
-1157,18
+1153,16
@@
static zval *php_http_message_object_read_prop(zval *object, zval *member, int t
zval *return_value, *copy = php_http_ztyp(IS_STRING, member);
if (SUCCESS == php_http_message_object_get_prophandler(Z_STRVAL_P(copy), Z_STRLEN_P(copy), &handler)) {
zval *return_value, *copy = php_http_ztyp(IS_STRING, member);
if (SUCCESS == php_http_message_object_get_prophandler(Z_STRVAL_P(copy), Z_STRLEN_P(copy), &handler)) {
- if (type == BP_VAR_W) {
- zval_ptr_dtor(©);
+ if (type == BP_VAR_R) {
+ ALLOC_ZVAL(return_value);
+ Z_SET_REFCOUNT_P(return_value, 0);
+ Z_UNSET_ISREF_P(return_value);
+
+ handler->read(obj, return_value TSRMLS_CC);
+ } else {
zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index");
zend_error(E_ERROR, "Cannot access HttpMessage properties by reference or array key/index");
- return NULL;
+ return
_value =
NULL;
}
}
-
- ALLOC_ZVAL(return_value);
- Z_SET_REFCOUNT_P(return_value, 0);
- Z_UNSET_ISREF_P(return_value);
-
- handler->read(obj, return_value TSRMLS_CC);
-
} else {
return_value = zend_get_std_object_handlers()->read_property(object, member, type, literal_key TSRMLS_CC);
}
} else {
return_value = zend_get_std_object_handlers()->read_property(object, member, type, literal_key TSRMLS_CC);
}