Issue 128539 - a rtl_UnicodeToTextContext is wrongly freed with rtl_destroyTextToUnicodeConverter() instead of rtl_destroyTextToUnicodeContext()
Summary: a rtl_UnicodeToTextContext is wrongly freed with rtl_destroyTextToUnicodeConv...
Status: RESOLVED FIXED
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P5 (lowest) Normal (vote)
Target Milestone: 4.1.14
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-21 01:30 UTC by damjan
Modified: 2022-10-22 13:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
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.