Bug 82432

Summary: FcConfigSetCurrent doesn't call FcConfigReference() in new config
Product: fontconfig Reporter: Behdad Esfahbod <freedesktop>
Component: libraryAssignee: Akira TAGOH <akira>
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, fontconfig-bugs, freedesktop
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Behdad Esfahbod 2014-08-10 21:19:01 UTC
Ouch!

As reported here:
https://code.google.com/p/chromium/issues/detail?id=402209

I *think* it's safe to fix.
Comment 1 Akira TAGOH 2014-08-11 03:38:18 UTC
I agree with you however it causes introducing the memory leak on applications after fixing it, which uses FcConfigSetCurrent() right?
Comment 2 Behdad Esfahbod 2014-08-11 16:06:01 UTC
That's why I said I "*think*".  That API doesn't have too many users, and a small leak that apps can fix in the future is better than the broken behavior it currently has.
Comment 3 Akira TAGOH 2014-08-12 07:09:11 UTC
gotcha. makes sense.
Comment 4 Akira TAGOH 2014-08-12 09:55:03 UTC
Fixed in git.
Comment 5 Behdad Esfahbod 2014-08-12 15:49:02 UTC
Please add a note to documentation saying that this function retrains a reference including the version number that this changed.

Alternative would have been to document it as claiming ownership of the referenced passed in.  I'm not sure which one I actually prefer!  At any rate, as long as it's documented, it's ok.
Comment 6 Akira TAGOH 2014-08-13 02:40:19 UTC
Thanks. done.

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.