From 8bfe748fb0f58dfb21cbd1018e2e78457d354de1 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Mon, 16 Oct 2017 19:00:12 +0300 Subject: [PATCH] Prevent crash on ext/pdo_mysql/tests/bug_39858.phpt when built with libmysql --- ext/pdo/pdo_stmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index c2c65650c10..a2c8092478d 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2025,7 +2025,9 @@ static int pdo_stmt_do_next_rowset(pdo_stmt_t *stmt) struct pdo_column_data *cols = stmt->columns; for (i = 0; i < stmt->column_count; i++) { - zend_string_release(cols[i].name); + if (cols[i].name) { + zend_string_release(cols[i].name); + } } efree(stmt->columns); stmt->columns = NULL;