@@ -864,12 +864,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
864
864
}
865
865
if (!connection -> info -> lock .fp ) {
866
866
/* stream operation already wrote an error message */
867
- efree (resource_key );
868
- zend_string_release_ex (connection -> hash , persistent );
869
- dba_close_info (connection -> info );
870
- connection -> info = NULL ;
871
- zval_ptr_dtor (return_value );
872
- RETURN_FALSE ;
867
+ goto fail ;
873
868
}
874
869
if (!error && !php_stream_supports_lock (connection -> info -> lock .fp )) {
875
870
error = "Stream does not support locking" ;
@@ -888,12 +883,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
888
883
}
889
884
if (!connection -> info -> fp ) {
890
885
/* stream operation already wrote an error message */
891
- efree (resource_key );
892
- zend_string_release_ex (connection -> hash , persistent );
893
- dba_close_info (connection -> info );
894
- connection -> info = NULL ;
895
- zval_ptr_dtor (return_value );
896
- RETURN_FALSE ;
886
+ goto fail ;
897
887
}
898
888
if (hptr -> flags & (DBA_NO_APPEND |DBA_CAST_AS_FD )) {
899
889
/* Needed because some systems do not allow to write to the original
@@ -940,12 +930,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
940
930
php_error_docref (NULL , E_WARNING , "Driver initialization failed for handler: %s" , hptr -> name );
941
931
}
942
932
}
943
- efree (resource_key );
944
- zend_string_release_ex (connection -> hash , persistent );
945
- dba_close_info (connection -> info );
946
- connection -> info = NULL ;
947
- zval_ptr_dtor (return_value );
948
- RETURN_FALSE ;
933
+ goto fail ;
949
934
}
950
935
951
936
connection -> info -> hnd = hptr ;
@@ -962,6 +947,14 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
962
947
963
948
zend_hash_add_new (& DBA_G (connections ), connection -> hash , return_value );
964
949
efree (resource_key );
950
+ return ;
951
+ fail :
952
+ efree (resource_key );
953
+ zend_string_release_ex (connection -> hash , persistent );
954
+ dba_close_info (connection -> info );
955
+ connection -> info = NULL ;
956
+ zval_ptr_dtor (return_value );
957
+ RETURN_FALSE ;
965
958
}
966
959
/* }}} */
967
960
0 commit comments