mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fixed bug #75402 Possible Memory Leak using PDO::CURSOR_SCROLL option
This commit is contained in:
commit
093cb1d7c6
2 changed files with 119 additions and 0 deletions
|
@ -163,6 +163,7 @@ static int pgsql_stmt_execute(pdo_stmt_t *stmt)
|
|||
pdo_pgsql_error_stmt(stmt, status, pdo_pgsql_sqlstate(S->result));
|
||||
return 0;
|
||||
}
|
||||
PQclear(S->result);
|
||||
|
||||
/* the cursor was declared correctly */
|
||||
S->is_prepared = 1;
|
||||
|
@ -432,6 +433,11 @@ static int pgsql_stmt_fetch(pdo_stmt_t *stmt,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if(S->result) {
|
||||
PQclear(S->result);
|
||||
S->result = NULL;
|
||||
}
|
||||
|
||||
spprintf(&q, 0, "FETCH %s FROM %s", ori_str, S->cursor_name);
|
||||
efree(ori_str);
|
||||
S->result = PQexec(S->H->server, q);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue