summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <andreas.kling@nokia.com>2010-06-22 09:09:32 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-22 12:13:44 +0200
commit009a7e76ad2a96b33a45ca48ee724bbf2de71efa (patch)
tree8258ac0064b77cb03c61bff2cc0e05763129f9f4
parent04bf97ef1227e15b65ba18a7b74ace790df69903 (diff)
Make sure ValueRecord's DeviceTables are cleaned up on failure
Cleanup was a missing for the case where loading an X placement device table failed. Signed-off-by: Simon Hausmann <simon.hausmann@nokia.com>
-rw-r--r--src/harfbuzz-gpos.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/harfbuzz-gpos.c b/src/harfbuzz-gpos.c
index 0236271..d6f9207 100644
--- a/src/harfbuzz-gpos.c
+++ b/src/harfbuzz-gpos.c
@@ -273,7 +273,7 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
{
if ( ACCESS_Frame( 2L ) )
- return error;
+ goto Fail4;
new_offset = GET_UShort();
@@ -287,7 +287,7 @@ static HB_Error Load_ValueRecord( HB_ValueRecord* vr,
if ( FILE_Seek( new_offset ) ||
( error = _HB_OPEN_Load_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE],
stream ) ) != HB_Err_Ok )
- return error;
+ goto Fail4;
(void)FILE_Seek( cur_offset );
}
}
@@ -444,6 +444,7 @@ Fail3:
if ( vr->DeviceTables )
_HB_OPEN_Free_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] );
+Fail4:
FREE( vr->DeviceTables );
return error;
}