File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ int zend_load_extension(char *path)
63
63
extension_version_info -> required_zend_version ,
64
64
ZEND_VERSION ,
65
65
ZEND_EXTENSION_API_NO );
66
+ DL_UNLOAD (handle );
66
67
return FAILURE ;
67
68
} else if (extension_version_info -> zend_extension_api_no < ZEND_EXTENSION_API_NO ) {
68
69
/* we may be able to allow for downwards compatability in some harmless cases. */
@@ -73,17 +74,22 @@ int zend_load_extension(char *path)
73
74
ZEND_EXTENSION_API_NO ,
74
75
new_extension -> author ,
75
76
new_extension -> URL );
77
+ DL_UNLOAD (handle );
76
78
return FAILURE ;
77
79
} else if (ZTS_V != extension_version_info -> thread_safe ) {
78
80
zend_printf ("Cannot load %s - it %s thread safe, whereas Zend %s\n" ,
79
81
new_extension -> name ,
80
82
(extension_version_info -> thread_safe ?"is" :"isn't" ),
81
83
(ZTS_V ?"is" :"isn't" ));
84
+ DL_UNLOAD (handle );
82
85
return FAILURE ;
83
86
}
84
87
85
88
if (new_extension -> startup ) {
86
- new_extension -> startup (new_extension );
89
+ if (new_extension -> startup (new_extension )!= SUCCESS ) {
90
+ DL_UNLOAD (handle );
91
+ return FAILURE ;
92
+ }
87
93
}
88
94
extension = * new_extension ;
89
95
extension .handle = handle ;
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ struct _zend_extension {
37
37
char * URL ;
38
38
char * copyright ;
39
39
40
- void (* startup )(zend_extension * extension );
40
+ int (* startup )(zend_extension * extension );
41
41
void (* shutdown )(zend_extension * extension );
42
42
void (* activate )();
43
43
void (* deactivate )();
You can’t perform that action at this time.
0 commit comments