]> granicus.if.org Git - php/commitdiff
Fix segfault reported by Rasmus.
authorWez Furlong <wez@php.net>
Fri, 23 Aug 2002 17:45:46 +0000 (17:45 +0000)
committerWez Furlong <wez@php.net>
Fri, 23 Aug 2002 17:45:46 +0000 (17:45 +0000)
ext/gd/gd.c

index cb602053fb868a5cc1c1f6cb601293ac39dfe62c..bb8e40645a772b114a047b9b5e4567022000a094 100644 (file)
@@ -514,13 +514,13 @@ PHP_FUNCTION(imageloadfont)
        while (b < hdr_size && (n = php_stream_read(stream, (char*)&font[b], hdr_size - b)))
                b += n;
        if (!n) {
-               php_stream_close(stream);
                efree(font);
                if (php_stream_eof(stream)) {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "End of file while reading header");
                } else {
                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error while reading header");
                }
+               php_stream_close(stream);
                RETURN_FALSE;
        }
        i = php_stream_tell(stream);