@@ -865,6 +865,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
865
865
if (!connection -> info -> lock .fp ) {
866
866
/* stream operation already wrote an error message */
867
867
efree (resource_key );
868
+ zend_string_release_ex (connection -> hash , persistent );
869
+ dba_close_info (connection -> info );
870
+ connection -> info = NULL ;
868
871
zval_ptr_dtor (return_value );
869
872
RETURN_FALSE ;
870
873
}
@@ -886,6 +889,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
886
889
if (!connection -> info -> fp ) {
887
890
/* stream operation already wrote an error message */
888
891
efree (resource_key );
892
+ zend_string_release_ex (connection -> hash , persistent );
893
+ dba_close_info (connection -> info );
894
+ connection -> info = NULL ;
889
895
zval_ptr_dtor (return_value );
890
896
RETURN_FALSE ;
891
897
}
@@ -896,6 +902,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
896
902
if (SUCCESS != php_stream_cast (connection -> info -> fp , PHP_STREAM_AS_FD , (void * )& connection -> info -> fd , 1 )) {
897
903
php_error_docref (NULL , E_WARNING , "Could not cast stream" );
898
904
efree (resource_key );
905
+ zend_string_release_ex (connection -> hash , persistent );
906
+ dba_close_info (connection -> info );
907
+ connection -> info = NULL ;
899
908
zval_ptr_dtor (return_value );
900
909
RETURN_FALSE ;
901
910
#ifdef F_SETFL
@@ -932,6 +941,9 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
932
941
}
933
942
}
934
943
efree (resource_key );
944
+ zend_string_release_ex (connection -> hash , persistent );
945
+ dba_close_info (connection -> info );
946
+ connection -> info = NULL ;
935
947
zval_ptr_dtor (return_value );
936
948
RETURN_FALSE ;
937
949
}
@@ -942,6 +954,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
942
954
if (zend_register_persistent_resource (resource_key , resource_key_len , connection -> info , le_pdb ) == NULL ) {
943
955
php_error_docref (NULL , E_WARNING , "Could not register persistent resource" );
944
956
efree (resource_key );
957
+ dba_close_connection (connection );
945
958
zval_ptr_dtor (return_value );
946
959
RETURN_FALSE ;
947
960
}
0 commit comments