Re: Streams segfault
| From: | Rasmus Lerdorf | Date: | Fri, 23 Aug 2002 17:53:36 +0000 |
| Subject: | Re: Streams segfault | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-87359@lists.php.net to get a copy of this message | ||
Can we call php_stream_error() on a closed stream?
On Fri, 23 Aug 2002, Wez Furlong wrote:
> On 08/23/02, "Rasmus Lerdorf" <rasmus@lerdorf.ca> wrote:
> > if (!n) {
> > php_stream_close(stream);
>
> Closing the stream here leaves stream undefined.
>
> > efree(font);
> > if (php_stream_eof(stream)) {
>
> And here it blows up.
>
> I've committed a fix for this by closing the stream a couple of
> lines later.
> I'm not sure why the code was like that; perhaps it was an error
> on my part when converting it all to streams.
>
> Anyway, should be fixed now - thanks for pointing it out!
>
> --Wez.
>