mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-01-03 04:40:14 +01:00
[pdf] Fixup a couple of inverted tests.
Check for NULL returns from malloc, instead of reporting errors and leaking on success.
This commit is contained in:
parent
7ffd8bbcb0
commit
2dfee9986c
1 changed files with 3 additions and 3 deletions
|
|
@ -4783,8 +4783,8 @@ _cairo_pdf_surface_show_text_glyphs (void *abstract_surface,
|
|||
group->source_res = pattern_res;
|
||||
|
||||
if (utf8_len) {
|
||||
group->utf8 = malloc(utf8_len);
|
||||
if (group->utf8) {
|
||||
group->utf8 = malloc (utf8_len);
|
||||
if (group->utf8 == NULL) {
|
||||
_cairo_pdf_smask_group_destroy (group);
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
|
@ -4804,7 +4804,7 @@ _cairo_pdf_surface_show_text_glyphs (void *abstract_surface,
|
|||
|
||||
if (num_clusters) {
|
||||
group->clusters = _cairo_malloc_ab (num_clusters, sizeof (cairo_text_cluster_t));
|
||||
if (group->clusters) {
|
||||
if (group->clusters == NULL) {
|
||||
_cairo_pdf_smask_group_destroy (group);
|
||||
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue