Issue 128539

Summary: a rtl_UnicodeToTextContext is wrongly freed with rtl_destroyTextToUnicodeConverter() instead of rtl_destroyTextToUnicodeContext()
Product: General Reporter: damjan
Component: codeAssignee: AOO issues mailing list <issues>
Status: RESOLVED FIXED QA Contact:
Severity: Normal    
Priority: P5 (lowest) CC: mseidel
Version: 3.3.0 or older (OOo)   
Target Milestone: 4.1.14   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---

Description damjan 2022-10-21 01:30:28 UTC
http://opengrok.openoffice.org/xref/trunk/main/vcl/source/gdi/impfont.cxx?r=43ad51ff#553

The "rtl_UnicodeToTextContext aCvtContext" variable is freed with rtl_destroyTextToUnicodeConverter() instead of rtl_destroyTextToUnicodeContext().

The reason this isn't caught by the compiler is because both types are void *:
typedef void* rtl_TextToUnicodeConverter;
typedef void* rtl_TextToUnicodeContext;

The consequence is a memory leak.
Comment 1 damjan 2022-10-21 01:39:14 UTC
Fixed by commit fb3d7646562a8e2f3f690b2fdbc7faaa1b30aa42, resolving fixed.
Comment 2 Matthias Seidel 2022-10-22 09:34:03 UTC
Hi Damjan,

would this be something we want to cherry-pick for AOO42X and AOO41X?
Comment 3 damjan 2022-10-22 11:19:02 UTC
(In reply to Matthias Seidel from comment #2)
> Hi Damjan,
> 
> would this be something we want to cherry-pick for AOO42X and AOO41X?

Yes. Most of my changes should be in AOO42X, and wouldn't hurt in AOO41X (though I would prefer AOO41X to be discontinued already).

This also applies for bugs 128540, 128541 and 128542.
Comment 4 Matthias Seidel 2022-10-22 11:23:23 UTC
(In reply to damjan from comment #3)
> (In reply to Matthias Seidel from comment #2)
> > Hi Damjan,
> > 
> > would this be something we want to cherry-pick for AOO42X and AOO41X?
> 
> Yes. Most of my changes should be in AOO42X, and wouldn't hurt in AOO41X
> (though I would prefer AOO41X to be discontinued already).
> 
> This also applies for bugs 128540, 128541 and 128542.

I would also like to discontinue AOO41X, but AOO42X isn't ready to be released and will not until the release blocker bugs are solved...

I will start to cherry-pick then.