cairo-output-stream: Don't dereference a NULL pointer due to OOM.

This close bug #6176:

	Null pointer dereference on OOM in _cairo_output_stream_create_for_file()
	https://bugs.freedesktop.org/show_bug.cgi?id=6176
This commit is contained in:
Carl Worth 2006-03-13 12:05:13 -08:00
parent 92e09ee72f
commit c780f4a562

View file

@ -305,9 +305,11 @@ _cairo_output_stream_create_for_file (const char *filename)
return NULL;
stream = _cairo_output_stream_create (stdio_write, fp);
if (stream == NULL)
if (stream)
stream->owns_closure_is_file = TRUE;
else
fclose (fp);
stream->owns_closure_is_file = TRUE;
return stream;
}