diff options
| -rw-r--r-- | ext/pdo_dblib/dblib_stmt.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index 387648244f..2830272b82 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -104,10 +104,16 @@ static int pdo_dblib_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) dbcancel(H->link); if (stmt->columns) { + int i = 0; + for (; i < stmt->column_count; i++) { + if (stmt->columns[i].name) { + efree(stmt->columns[i].name); + } + } efree(stmt->columns); stmt->columns = NULL; } - + return 1; } @@ -115,8 +121,16 @@ static int pdo_dblib_stmt_dtor(pdo_stmt_t *stmt TSRMLS_DC) { pdo_dblib_stmt *S = (pdo_dblib_stmt*)stmt->driver_data; - efree(stmt->columns); - stmt->columns = NULL; + if (stmt->columns) { + int i = 0; + for (; i < stmt->column_count; i++) { + if (stmt->columns[i].name) { + efree(stmt->columns[i].name); + } + } + efree(stmt->columns); + stmt->columns = NULL; + } efree(S); |
