static zend_class_entry *php_http_client_factory_find_class_entry(zval *this_ptr, const char *for_str, size_t for_len TSRMLS_DC)
{
/* stupid non-const api */
- char *sc = estrndup(for_str, for_len);
- zval *cn = zend_read_property(Z_OBJCE_P(getThis()), getThis(), sc, for_len, 0 TSRMLS_CC);
+ zval *cn = zend_read_property(Z_OBJCE_P(getThis()), getThis(), for_str, for_len, 0 TSRMLS_CC);
- efree(sc);
if (Z_TYPE_P(cn) == IS_STRING && Z_STRLEN_P(cn)) {
return zend_fetch_class(Z_STRVAL_P(cn), Z_STRLEN_P(cn), 0 TSRMLS_CC);
}
PHP_METHOD(HttpClientFactory, createPool)
{
int argc = 0;
- zval ***argv;
+ zval ***argv = NULL;
with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|*", &argv, &argc)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &argv, &argc)) {
with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
int i;
zval *zdriver;
php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_FACTORY, "pools are not supported by this driver");
}
} end_error_handling();
+
+ if (argv) {
+ efree(argv);
+ }
}
} end_error_handling();
}
PHP_METHOD(HttpClientFactory, createDataShare)
{
int argc = 0;
- zval ***argv;
+ zval ***argv = NULL;
with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|*", &argv, &argc)) {
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", &argv, &argc)) {
with_error_handling(EH_THROW, php_http_exception_get_class_entry()) {
int i;
zval *zdriver;
php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_FACTORY, "datashares are not supported by this driver");
}
} end_error_handling();
+ if (argv) {
+ efree(argv);
+ }
}
} end_error_handling();
}