Merge branch 'PHP-5.6'

* PHP-5.6:
  updated NEWS
  updated NEWS
  fix memory leak in pdo_pgsql closeCursor (bug 69752)
This commit is contained in:
Anatol Belski 2015-06-10 16:43:33 +02:00
commit 8ad5111d1c
2 changed files with 61 additions and 1 deletions

View file

@ -224,7 +224,7 @@ stmt_retry:
return 0;
}
if (!stmt->executed && !stmt->column_count) {
if (!stmt->executed && (!stmt->column_count || S->cols == NULL)) {
stmt->column_count = (int) PQnfields(S->result);
S->cols = ecalloc(stmt->column_count, sizeof(pdo_pgsql_column));
}
@ -618,6 +618,12 @@ done:
static int pdo_pgsql_stmt_cursor_closer(pdo_stmt_t *stmt)
{
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
if (S->cols != NULL){
efree(S->cols);
S->cols = NULL;
}
return 1;
}