summaryrefslogtreecommitdiff
blob: 06f433c01e518066abf01b5ae123fa78c614f915 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- pdo_stmt.c	2005-07-27 04:06:11.000000000 +0200
+++ pdo_stmt.c	2005-08-06 20:50:17.000000000 +0200
@@ -18,7 +18,7 @@
   +----------------------------------------------------------------------+
 */
 
-/* $Id: pdo_stmt.c,v 1.116 2005/07/22 14:31:20 helly Exp $ */
+/* $Id: pdo_stmt.c,v 1.118 2005/08/03 18:26:16 iliaa Exp $ */
 
 /* The PDO Statement Handle Class */
 
@@ -1985,12 +1985,20 @@
 		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;
+	}
+
+	if (stmt->fetch.into && stmt->default_fetch_type == PDO_FETCH_INTO) {
+		FREE_ZVAL(stmt->fetch.into);
+		stmt->fetch.into = NULL;
 	}
 
-	
 	do_fetch_opt_finish(stmt, 1 TSRMLS_CC);
 
 	zend_objects_store_del_ref(&stmt->database_object_handle TSRMLS_CC);