mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-08 04:28:02 +02:00
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:
parent
92e09ee72f
commit
c780f4a562
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue