diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:40:40 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-04-15 15:40:40 +0400 |
commit | 050d7e38ad4163e7fa65e26724d3516ce7b33601 (patch) | |
tree | 2bb49b1b73c37b35fc778e83d9353f0eb9cc12a3 /ext/pdo_dblib | |
parent | 93d3a613d82d32dd6f5499e211bfe194d60898b0 (diff) | |
download | php-git-050d7e38ad4163e7fa65e26724d3516ce7b33601.tar.gz |
Cleanup (1-st round)
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r-- | ext/pdo_dblib/dblib_driver.c | 6 | ||||
-rw-r--r-- | ext/pdo_dblib/dblib_stmt.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/ext/pdo_dblib/dblib_driver.c b/ext/pdo_dblib/dblib_driver.c index 0fa68900b0..350a3c670d 100644 --- a/ext/pdo_dblib/dblib_driver.c +++ b/ext/pdo_dblib/dblib_driver.c @@ -61,11 +61,13 @@ static int dblib_fetch_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info TSRMLS msg, einfo->dberr, einfo->severity, stmt ? stmt->active_query_string : ""); add_next_index_long(info, einfo->dberr); - add_next_index_string(info, message, 0); + // TODO: avoid reallocation ??? + add_next_index_string(info, message); + efree(message); add_next_index_long(info, einfo->oserr); add_next_index_long(info, einfo->severity); if (einfo->oserrstr) { - add_next_index_string(info, einfo->oserrstr, 1); + add_next_index_string(info, einfo->oserrstr); } return 1; diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 18e9e679cc..c13d58bd57 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -306,8 +306,8 @@ static int pdo_dblib_stmt_get_column_meta(pdo_stmt_t *stmt, long colno, zval *re add_assoc_long(return_value, "max_length", dbcollen(H->link, colno+1) ); add_assoc_long(return_value, "precision", (int) dbtypeinfo->precision ); add_assoc_long(return_value, "scale", (int) dbtypeinfo->scale ); - add_assoc_string(return_value, "column_source", dbcolsource(H->link, colno+1), 1); - add_assoc_string(return_value, "native_type", pdo_dblib_get_field_name(dbcoltype(H->link, colno+1)), 1); + add_assoc_string(return_value, "column_source", dbcolsource(H->link, colno+1)); + add_assoc_string(return_value, "native_type", pdo_dblib_get_field_name(dbcoltype(H->link, colno+1))); add_assoc_long(return_value, "native_type_id", dbcoltype(H->link, colno+1)); add_assoc_long(return_value, "native_usertype_id", dbcolutype(H->link, colno+1)); |