]> granicus.if.org Git - php/commitdiff
add sanity checks
authorWez Furlong <wez@php.net>
Wed, 27 Jul 2005 14:18:01 +0000 (14:18 +0000)
committerWez Furlong <wez@php.net>
Wed, 27 Jul 2005 14:18:01 +0000 (14:18 +0000)
ext/pdo/pdo_stmt.c

index e3b517b3ef16902434fdc10d89db1f0d23555b79..4c81909897d791045d98c1e9822cd495a31a28f6 100755 (executable)
@@ -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;
        }