From bf85bf515ea57f0b6e6fec98025029d1fb73405c Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Wed, 27 Jul 2005 14:18:01 +0000 Subject: [PATCH] add sanity checks --- ext/pdo/pdo_stmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.50.1