]> granicus.if.org Git - php/commitdiff
stream closing bug here too
authorRasmus Lerdorf <rasmus@php.net>
Fri, 23 Aug 2002 17:53:03 +0000 (17:53 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Fri, 23 Aug 2002 17:53:03 +0000 (17:53 +0000)
ext/gd/gd.c

index bb8e40645a772b114a047b9b5e4567022000a094..a07cc31c948b6c88655618ffa92d59f02218f3c3 100644 (file)
@@ -545,7 +545,6 @@ PHP_FUNCTION(imageloadfont)
        while (b < body_size && (n = php_stream_read(stream, &font->data[b], body_size - b)))
                b += n;
        if (!n) {
-               php_stream_close(stream);
                efree(font->data);
                efree(font);
                if (php_stream_eof(stream)) {
@@ -553,6 +552,7 @@ PHP_FUNCTION(imageloadfont)
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading body");
                }
+               php_stream_close(stream);
                RETURN_FALSE;
        }
        php_stream_close(stream);