Skip to content

Commit

Permalink
quartz-font: Do not leak CFDataRef's
Browse files Browse the repository at this point in the history
CFData is allocated and thus needs to be freed.
  • Loading branch information
Andrea Canciani committed Nov 1, 2010
1 parent 947d35c commit 852e789
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cairo-quartz-font.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ _cairo_quartz_load_truetype_table (void *abstract_font,
if (length) {
if (*length == 0) {
*length = CFDataGetLength (data);
CFRelease (data);
return CAIRO_STATUS_SUCCESS;
}

Expand All @@ -788,6 +789,8 @@ _cairo_quartz_load_truetype_table (void *abstract_font,
if (buffer)
CFDataGetBytes (data, CFRangeMake (offset, len), buffer);

CFRelease (data);

return CAIRO_STATUS_SUCCESS;
}

Expand Down

0 comments on commit 852e789

Please sign in to comment.