Prevent a crash when expand_filepath() fails.

This commit is contained in:
Ilia Alshanetsky 2003-08-27 01:10:10 +00:00
parent 3560cd83c0
commit a326bde2e8

View File

@ -100,7 +100,9 @@ PHPAPI php_stream *_php_stream_fopen(const char *filename, const char *mode, cha
return NULL;
}
realpath = expand_filepath(filename, NULL TSRMLS_CC);
if ((realpath = expand_filepath(filename, NULL TSRMLS_CC)) == NULL) {
return NULL;
}
if (persistent) {
spprintf(&persistent_id, 0, "streams_stdio_%d_%s", open_flags, realpath);