summaryrefslogtreecommitdiff
path: root/ext/dbx
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-01-18 19:49:28 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-01-18 19:49:28 +0000
commita7b91019e9b551ff48dd91587674784b7020673f (patch)
treecfa8e9cb23f2e0a71364f747f2e3debcb508a5f5 /ext/dbx
parenta395304c7245ec411e8c735c82734e1fd0c27725 (diff)
downloadphp-git-a7b91019e9b551ff48dd91587674784b7020673f.tar.gz
Removed pointless memory allocation checks.
Diffstat (limited to 'ext/dbx')
-rw-r--r--ext/dbx/dbx.c26
-rw-r--r--ext/dbx/dbx_odbc.c6
2 files changed, 5 insertions, 27 deletions
diff --git a/ext/dbx/dbx.c b/ext/dbx/dbx.c
index 9c6fa208a8..fc780a0b9c 100644
--- a/ext/dbx/dbx.c
+++ b/ext/dbx/dbx.c
@@ -437,20 +437,12 @@ ZEND_FUNCTION(dbx_query)
/* init info property as array and add to return_value as a property */
if (result_flags & DBX_RESULT_INFO) {
MAKE_STD_ZVAL(info);
- if (array_init(info) != SUCCESS) {
- zend_error(E_ERROR, "dbx_query: unable to create info-array for results...");
- FREE_ZVAL(info);
- RETURN_LONG(0);
- }
+ array_init(info);
zend_hash_update(Z_OBJPROP_P(return_value), "info", 5, (void *)&(info), sizeof(zval *), NULL);
}
/* init data property as array and add to return_value as a property */
MAKE_STD_ZVAL(data);
- if (array_init(data) != SUCCESS) {
- zend_error(E_ERROR, "dbx_query: unable to create data-array for results...");
- FREE_ZVAL(data);
- RETURN_LONG(0);
- }
+ array_init(data);
zend_hash_update(Z_OBJPROP_P(return_value), "data", 5, (void *)&(data), sizeof(zval *), NULL);
/* get columncount and add to returnvalue as property */
MAKE_STD_ZVAL(rv_column_count);
@@ -468,18 +460,8 @@ ZEND_FUNCTION(dbx_query)
zval *info_row_type;
MAKE_STD_ZVAL(info_row_name);
MAKE_STD_ZVAL(info_row_type);
- if (array_init(info_row_name) != SUCCESS) {
- zend_error(E_ERROR, "dbx_query: unable to create info_row_name-array for results...");
- FREE_ZVAL(info_row_name);
- FREE_ZVAL(info_row_type);
- RETURN_LONG(0);
- }
- if (array_init(info_row_type) != SUCCESS) {
- zend_error(E_ERROR, "dbx_query: unable to create info_row_type-array for results...");
- FREE_ZVAL(info_row_name);
- FREE_ZVAL(info_row_type);
- RETURN_LONG(0);
- }
+ array_init(info_row_name);
+ array_init(info_row_type);
for (col_index=0; col_index<Z_LVAL_P(rv_column_count); ++col_index) {
zval *rv_column_name;
zval *rv_column_type;
diff --git a/ext/dbx/dbx_odbc.c b/ext/dbx/dbx_odbc.c
index f05a3f267b..235ee1f123 100644
--- a/ext/dbx/dbx_odbc.c
+++ b/ext/dbx/dbx_odbc.c
@@ -233,11 +233,7 @@ int dbx_odbc_getrow(zval **rv, zval **result_handle, long row_number, INTERNAL_F
zval_ptr_dtor(&fetch_row_result_zval);
/* fill array with field results... */
MAKE_STD_ZVAL(returned_zval);
- if (array_init(returned_zval) != SUCCESS) {
- zend_error(E_ERROR, "dbx_odbc_getrow: unable to create result-array...");
- FREE_ZVAL(returned_zval);
- return 0;
- }
+ array_init(returned_zval);
MAKE_STD_ZVAL(field_index_zval);
ZVAL_LONG(field_index_zval, 0);
number_of_arguments=2;