diff options
author | Antony Dovgal <tony2001@php.net> | 2005-10-27 17:26:19 +0000 |
---|---|---|
committer | Antony Dovgal <tony2001@php.net> | 2005-10-27 17:26:19 +0000 |
commit | 7c01510b950a46b53fccc4d58a03cd9d4a2189cd (patch) | |
tree | 056f689da61704cec399458399b1714d0b3f1b9f | |
parent | 3a9cdbfd41397fc942a556be7079bc362e95b850 (diff) | |
download | php-git-7c01510b950a46b53fccc4d58a03cd9d4a2189cd.tar.gz |
MFH: free && set to NULL S->stmt
-rwxr-xr-x | ext/pdo_mysql/mysql_statement.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c index 98d3990fd6..db96a43ef3 100755 --- a/ext/pdo_mysql/mysql_statement.c +++ b/ext/pdo_mysql/mysql_statement.c @@ -241,6 +241,12 @@ static int pdo_mysql_stmt_next_rowset(pdo_stmt_t *stmt TSRMLS_DC) int ret; /* ensure that we free any previous unfetched results */ +#if HAVE_MYSQL_STMT_PREPARE + if (S->stmt) { + mysql_stmt_free_result(S->stmt); + S->stmt = NULL; + } +#endif if (S->result) { mysql_free_result(S->result); S->result = NULL; @@ -567,7 +573,9 @@ static int pdo_mysql_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) pdo_mysql_stmt *S = (pdo_mysql_stmt*)stmt->driver_data; #if HAVE_MYSQL_STMT_PREPARE if (S->stmt) { - return mysql_stmt_free_result(S->stmt); + int retval = mysql_stmt_free_result(S->stmt); + S->stmt = NULL; + return retval ? 0 : 1; } #endif if (S->result) { |