@@ -156,6 +156,7 @@ static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */
156
156
_php_ibase_free_xsqlda (ib_result -> out_sqlda );
157
157
if (ib_result -> stmt_res != NULL ) {
158
158
zend_list_delete (ib_result -> stmt_res );
159
+ ib_result -> stmt_res == NULL ;
159
160
}
160
161
efree (ib_result );
161
162
}
@@ -174,6 +175,7 @@ static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
174
175
}
175
176
if (ib_query -> stmt_res != NULL ) {
176
177
zend_list_delete (ib_query -> stmt_res );
178
+ ib_query -> stmt_res == NULL ;
177
179
}
178
180
if (ib_query -> in_array ) {
179
181
efree (ib_query -> in_array );
@@ -340,7 +342,6 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
340
342
ib_query -> link = link ;
341
343
ib_query -> trans = trans ;
342
344
ib_query -> result_res = NULL ;
343
- ib_query -> result = NULL ;
344
345
ib_query -> stmt = 0 ;
345
346
ib_query -> stmt_res = NULL ;
346
347
ib_query -> in_array = NULL ;
@@ -1010,10 +1011,8 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
1010
1011
res -> link = ib_query -> link ;
1011
1012
res -> trans = ib_query -> trans ;
1012
1013
res -> stmt = ib_query -> stmt ;
1013
- res -> stmt_res = ib_query -> stmt_res ;
1014
- ++ GC_REFCOUNT (res -> stmt_res ); // Addref the resource for the result
1015
-
1016
- ib_query -> result = res ;
1014
+ GC_ADDREF (res -> stmt_res = ib_query -> stmt_res );
1015
+
1017
1016
res -> statement_type = ib_query -> statement_type ;
1018
1017
res -> has_more_rows = 1 ;
1019
1018
0 commit comments