Move allocation afer initial checks, fixing memory leak.

Sat Jul 26 10:52:20 2003  Owen Taylor  <otaylor@redhat.com>

        * pango/opentype/ftxgpos.c (Lookup_ContextPos2):
        * pango/opentype/ftxgsub.c (Lookup_ContextSubst2): Move
        allocation afer initial checks, fixing memory leak.

        * pango/opentype/ftxgsub.c (Lookup_ChainContextSubst2):
        Fix some more error return memory leaks that weren't
        fixed in the Qt changes.
This commit is contained in:
Owen Taylor 2003-07-26 15:02:13 +00:00 committed by Owen Taylor
parent f40b7c15e0
commit a7305ab262
2 changed files with 10 additions and 10 deletions

View File

@ -4020,9 +4020,6 @@
gdef = gpos->gdef; gdef = gpos->gdef;
if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) )
return error;
if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) ) if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) )
return error; return error;
@ -4032,7 +4029,10 @@
error = Coverage_Index( &cpf2->Coverage, in->string[in->pos], &index ); error = Coverage_Index( &cpf2->Coverage, in->string[in->pos], &index );
if ( error ) if ( error )
goto End; return error;
if ( ALLOC_ARRAY( classes, cpf2->MaxContextLength, FT_UShort ) )
return error;
error = Get_Class( &cpf2->ClassDef, in->string[in->pos], error = Get_Class( &cpf2->ClassDef, in->string[in->pos],
&classes[0], NULL ); &classes[0], NULL );

View File

@ -2206,9 +2206,6 @@
gdef = gsub->gdef; gdef = gsub->gdef;
if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) )
return error;
if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) ) if ( CHECK_Property( gdef, in->string[in->pos], flags, &property ) )
return error; return error;
@ -2218,7 +2215,10 @@
error = Coverage_Index( &csf2->Coverage, in->string[in->pos], &index ); error = Coverage_Index( &csf2->Coverage, in->string[in->pos], &index );
if ( error ) if ( error )
goto End; return error;
if ( ALLOC_ARRAY( classes, csf2->MaxContextLength, FT_UShort ) )
return error;
error = Get_Class( &csf2->ClassDef, in->string[in->pos], error = Get_Class( &csf2->ClassDef, in->string[in->pos],
&classes[0], NULL ); &classes[0], NULL );
@ -3646,7 +3646,7 @@
while ( CHECK_Property( gdef, s_in[j], flags, &property ) ) while ( CHECK_Property( gdef, s_in[j], flags, &property ) )
{ {
if ( error && error != TTO_Err_Not_Covered ) if ( error && error != TTO_Err_Not_Covered )
return error; goto End1;
if ( j > curr_pos ) if ( j > curr_pos )
j--; j--;
@ -3720,7 +3720,7 @@
while ( CHECK_Property( gdef, s_in[j], flags, &property ) ) while ( CHECK_Property( gdef, s_in[j], flags, &property ) )
{ {
if ( error && error != TTO_Err_Not_Covered ) if ( error && error != TTO_Err_Not_Covered )
return error; goto End1;
if ( curr_pos + j < in->length ) if ( curr_pos + j < in->length )
j++; j++;