Bug 31994 - Resource leak ::Lookup_ChainContextPos2
Summary: Resource leak ::Lookup_ChainContextPos2
Status: RESOLVED FIXED
Alias: None
Product: HarfBuzz
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Behdad Esfahbod
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-30 02:20 UTC by Juuso Pakarinen
Modified: 2012-07-30 14:52 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Juuso Pakarinen 2010-11-30 02:20:38 UTC
Code analyser tool runned against QT including HarfBuzz reveiled resource leak
::Lookup_ChainContextPos2
Fix proposal:

diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
index a216005..75e30ae 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c
@@ -5172,8 +5172,11 @@ static HB_Error  Lookup_ChainContextPos2(
     return error;
   known_backtrack_classes = 0;
 
-  if (ccpf2->MaxInputLength < 1)
+  if (ccpf2->MaxInputLength < 1) 
+  {
+    FREE( backtrack_classes );
     return HB_Err_Not_Covered;
+  }
 
   if ( ALLOC_ARRAY( input_classes, ccpf2->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.