diff options
| -rwxr-xr-x | ext/pdo/pdo_stmt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index e3b517b3ef..4c81909897 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -1985,9 +1985,13 @@ static void free_statement(pdo_stmt_t *stmt TSRMLS_DC) struct pdo_column_data *cols = stmt->columns; for (i = 0; i < stmt->column_count; i++) { - efree(cols[i].name); + if (cols[i].name) { + efree(cols[i].name); + cols[i].name = NULL; + } } efree(stmt->columns); + stmt->columns = NULL; } |
