mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00
Fixed bug #64511 - pdo_dblib segfaults or leaks on nextRowset()
This commit is contained in:
parent
fe8577efb1
commit
83144a7281
1 changed files with 6 additions and 12 deletions
|
@ -103,9 +103,6 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC)
|
||||||
/* Cancel any pending results */
|
/* Cancel any pending results */
|
||||||
dbcancel(H->link);
|
dbcancel(H->link);
|
||||||
|
|
||||||
efree(stmt->columns);
|
|
||||||
stmt->columns = NULL;
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,9 +110,6 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC)
|
||||||
{
|
{
|
||||||
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
|
pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data;
|
||||||
|
|
||||||
efree(stmt->columns);
|
|
||||||
stmt->columns = NULL;
|
|
||||||
|
|
||||||
efree(S);
|
efree(S);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -204,7 +198,7 @@ static int pdo_dblib_stmt_describe(pdo_stmt_t *stmt, int colno TSRMLS_DC)
|
||||||
|
|
||||||
struct pdo_column_data *col = &stmt->columns[colno];
|
struct pdo_column_data *col = &stmt->columns[colno];
|
||||||
|
|
||||||
col->name = (char*)dbcolname(H->link, colno+1);
|
col->name = estrdup(dbcolname(H->link, colno+1));
|
||||||
col->maxlen = dbcollen(H->link, colno+1);
|
col->maxlen = dbcollen(H->link, colno+1);
|
||||||
col->namelen = strlen(col->name);
|
col->namelen = strlen(col->name);
|
||||||
col->param_type = PDO_PARAM_STR;
|
col->param_type = PDO_PARAM_STR;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue