com php-src: Fixes #65689. PDO_Firebrid / exec() do es not free allocated statement.: ext/pdo_fireb ird/firebird_driver.c
| From: | Sara Golemon | Date: | Mon, 26 Dec 2016 06:06:20 +0000 |
| Subject: | com php-src: Fixes #65689. PDO_Firebrid / exec() do es not free allocated statement.: ext/pdo_fireb ird/firebird_driver.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-96428@lists.php.net to get a copy of this message | ||
Commit: e926bf65076cb5c8da6bf8f32635f696de5ff9aa
Author: Dorin Marcoci <dorin.marcoci@marcodor.com> Sat, 24 Dec 2016 13:57:03 +0200
Committer: Sara Golemon <pollita@php.net> Sun, 25 Dec 2016 22:06:20 -0800
Parents: ac1372d811b06bd360337e38d93c6cfebd27f378
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e926bf65076cb5c8da6bf8f32635f696de5ff9aa
Log:
Fixes #65689. PDO_Firebrid / exec() does not free allocated statement.
Bugs:
https://bugs.php.net/65689
Changed paths:
M ext/pdo_firebird/firebird_driver.c
Diff:
diff --git a/ext/pdo_firebird/firebird_driver.c b/ext/pdo_firebird/firebird_driver.c
index b26939c..91cd359 100644
--- a/ext/pdo_firebird/firebird_driver.c
+++ b/ext/pdo_firebird/firebird_driver.c
@@ -238,14 +238,16 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t
sq
/* execute the statement */
if (isc_dsql_execute2(H->isc_status, &H->tr, &stmt, PDO_FB_SQLDA_VERSION,
&in_sqlda, &out_sqlda)) {
RECORD_ERROR(dbh);
- return -1;
+ ret = -1;
+ goto free_statement;
}
/* find out how many rows were affected */
if (isc_dsql_sql_info(H->isc_status, &stmt, sizeof(info_count), const_cast(info_count),
sizeof(result), result)) {
RECORD_ERROR(dbh);
- return -1;
+ ret = -1;
+ goto free_statement;
}
if (result[0] == isc_info_sql_records) {
@@ -265,6 +267,12 @@ static zend_long firebird_handle_doer(pdo_dbh_t *dbh, const char *sql, size_t
sq
RECORD_ERROR(dbh);
}
+free_statement:
+
+ if (isc_dsql_free_statement(H->isc_status, &stmt, DSQL_drop)) {
+ RECORD_ERROR(dbh);
+ }
+
return ret;
}
/* }}} */