]> granicus.if.org Git - php/commitdiff
fix CS and prevent NULL dereference
authorAntony Dovgal <tony2001@php.net>
Thu, 13 Apr 2006 18:14:14 +0000 (18:14 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 13 Apr 2006 18:14:14 +0000 (18:14 +0000)
main/streams/filter.c

index 57a780986e53e30e41a7439b7aa289b8672da197..106e2c63e1469032697d87242a89b50ed5a713a5 100644 (file)
@@ -338,10 +338,12 @@ PHPAPI php_stream_filter *php_stream_filter_create(const char *filtername, zval
 
        if (filter == NULL) {
                /* TODO: these need correct docrefs */
-               if (factory == NULL)
+               if (factory == NULL) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to locate filter \"%s\"", filtername);
-               else
+               } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to create or locate filter \"%s\"", filtername);
+               }
+               return NULL;
        }
 
        filter->name = pestrdup(filtername, filter->is_persistent);