@@ -156,6 +156,7 @@ static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */
156156		_php_ibase_free_xsqlda (ib_result -> out_sqlda );
157157		if  (ib_result -> stmt_res  !=  NULL ) {
158158			zend_list_delete (ib_result -> stmt_res );
159+ 			ib_result -> stmt_res  ==  NULL ;
159160		}
160161		efree (ib_result );
161162	}
@@ -174,6 +175,7 @@ static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */
174175	}
175176	if  (ib_query -> stmt_res  !=  NULL ) {
176177		zend_list_delete (ib_query -> stmt_res );
178+ 		ib_query -> stmt_res  ==  NULL ;
177179	}
178180	if  (ib_query -> in_array ) {
179181		efree (ib_query -> in_array );
@@ -340,7 +342,6 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /*
340342	ib_query -> link  =  link ;
341343	ib_query -> trans  =  trans ;
342344	ib_query -> result_res  =  NULL ;
343- 	ib_query -> result  =  NULL ;
344345	ib_query -> stmt  =  0 ;
345346	ib_query -> stmt_res  =  NULL ;
346347	ib_query -> in_array  =  NULL ;
@@ -1010,10 +1011,8 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul
10101011		res -> link  =  ib_query -> link ;
10111012		res -> trans  =  ib_query -> trans ;
10121013		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+ 		
10171016		res -> statement_type  =  ib_query -> statement_type ;
10181017		res -> has_more_rows  =  1 ;
10191018
0 commit comments