Bug 31993

Summary: Resource leak ::Lookup_ChainContextSubst2
Product: HarfBuzz Reporter: Juuso Pakarinen <juuso.pakarinen>
Component: srcAssignee: Behdad Esfahbod <freedesktop>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: freedesktop
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Juuso Pakarinen 2010-11-30 02:17:58 UTC
Code analyser tool runned against QT including HarfBuzz reveiled resource leak ::Lookup_ChainContextSubst2
Fix proposal:

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.c b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.c
index 21fec51..906544e 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gsub.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gsub.c
@@ -3163,7 +3163,10 @@ static HB_Error  Lookup_ChainContextSubst2( HB_GSUBHeader*               gsub,
   known_backtrack_classes = 0;
 
   if (ccsf2->MaxInputLength < 1)
+  {
+    FREE( backtrack_classes );
     return HB_Err_Not_Covered;
+  }
 
   if ( ALLOC_ARRAY( input_classes, ccsf2->MaxInputLength, HB_UShort ) )
     goto End3;

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.