RESOLVED INVALID 225312
Transfer ownership to ARC in speechSynthesisGetDefaultVoiceIdentifierForLocale
https://bugs.webkit.org/show_bug.cgi?id=225312
Summary Transfer ownership to ARC in speechSynthesisGetDefaultVoiceIdentifierForLocale
Sihui Liu
Reported 2021-05-03 09:40:47 PDT
...
Attachments
Patch (1.70 KB, patch)
2021-05-03 09:43 PDT, Sihui Liu
no flags
[fast-cq] Patch (1.63 KB, patch)
2021-05-03 13:20 PDT, Sihui Liu
no flags
Radar WebKit Bug Importer
Comment 1 2021-05-03 09:40:56 PDT
Sihui Liu
Comment 2 2021-05-03 09:43:52 PDT
EWS
Comment 3 2021-05-03 11:51:13 PDT
Committed r276913 (237257@main): <https://commits.webkit.org/237257@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427569 [details].
Darin Adler
Comment 4 2021-05-03 12:20:26 PDT
Comment on attachment 427569 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=427569&action=review > Source/WebCore/platform/mac/PlatformSpeechSynthesizerMac.mm:230 > + return adoptCF(GetIdentifierStringForPreferredVoiceInListWithLocale(speechSynthesisGetVoiceIdentifiers().get(), (__bridge CFLocaleRef)userLocale)).bridgingAutorelease(); This looks wrong and looks like an overrelease which could introduce a security bug. A function named GetIdentifierStringForPreferredVoiceInListWithLocale will *not* return a retained CFStringRef that should be released or adopted. There’s something deeper going on here. If there’s a memory leak, then the is not the correct fix for that cause.
Sihui Liu
Comment 5 2021-05-03 13:20:48 PDT
Reopening to attach new patch.
Sihui Liu
Comment 6 2021-05-03 13:20:49 PDT
Created attachment 427591 [details] [fast-cq] Patch
EWS
Comment 7 2021-05-03 13:23:07 PDT
Committed r276921 (237263@main): <https://commits.webkit.org/237263@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427591 [details].
Sihui Liu
Comment 8 2021-05-03 13:25:06 PDT
Revert the change as GetIdentifierStringForPreferredVoiceInListWithLocale does not actually returns a copy like Darin said, so it's not on us to release it.
Note You need to log in before you can comment on or make changes to this bug.