summaryrefslogtreecommitdiff
path: root/ext/odbc/php_odbc.c
diff options
context:
space:
mode:
authorDan Kalowsky <kalowsky@php.net>2001-06-08 15:31:29 +0000
committerDan Kalowsky <kalowsky@php.net>2001-06-08 15:31:29 +0000
commitc3a3d5c8539b356298058090596c66ee170df673 (patch)
treef8b694973eec786f49893b0242edc52b03310d3f /ext/odbc/php_odbc.c
parentb31801b24910fdd8e1076072f99543328996d110 (diff)
downloadphp-git-c3a3d5c8539b356298058090596c66ee170df673.tar.gz
added in a bit more checking on the persistent connection checks...
Diffstat (limited to 'ext/odbc/php_odbc.c')
-rw-r--r--ext/odbc/php_odbc.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index cff774a2c4..ee7a76f4cf 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1883,6 +1883,16 @@ PHP_FUNCTION(odbc_free_result)
}
ZEND_FETCH_RESOURCE(result, odbc_result *, pv_res, -1, "ODBC result", le_result);
+ if (result->values) {
+ for (i = 0; i < result->numcols; i++) {
+ if (result->values[i].value) {
+ efree(result->values[i].value);
+ }
+ }
+ efree(result->values);
+ result->values = NULL;
+ }
+
zend_list_delete(result->id);
RETURN_TRUE;
@@ -2125,7 +2135,7 @@ try_and_get_another_connection:
SQL_DATA_SOURCE_READ_ONLY,
d_name, sizeof(d_name), &len);
- if(ret != SQL_SUCCESS){
+ if(ret != SQL_SUCCESS || len == 0) {
zend_hash_del(&EG(persistent_list), hashed_details, hashed_len + 1);
safe_odbc_disconnect(db_conn->hdbc);
SQLFreeConnect(db_conn->hdbc);