[webkit-changes] [WebKit/WebKit] c0a285: Avoid overreleasing NSNumbers in CoreIPCNSURLCrede...
Wenson Hsieh
noreply at github.com
Mon Nov 11 15:57:35 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c0a285660ab18ace28599908325482914c6f7b72
https://github.com/WebKit/WebKit/commit/c0a285660ab18ace28599908325482914c6f7b72
Author: Wenson Hsieh <wenson_hsieh at apple.com>
Date: 2024-11-11 (Mon, 11 Nov 2024)
Changed paths:
M Source/WebKit/Shared/Cocoa/CoreIPCNSURLCredential.mm
Log Message:
-----------
Avoid overreleasing NSNumbers in CoreIPCNSURLCredential::toID() after 286450 at main
https://bugs.webkit.org/show_bug.cgi?id=282950
Reviewed by Aditya Keerthi and Abrar Rahman Protyasha.
The results of `+[NSNumber numberWithInt:]` are incorrectly adopted here, since `+numberWithInt:`
does not return a +1 object. As a result, we'll end up calling `-release` when the `RetainPtr` falls
out of scope, without a matching `-retain`.
Fix this by just using the normal `RetainPtr` constructor, which retains the given instance (and
also deploy the more modern Objective-C `@()` syntax).
* Source/WebKit/Shared/Cocoa/CoreIPCNSURLCredential.mm:
(WebKit::CoreIPCNSURLCredential::toID const):
Canonical link: https://commits.webkit.org/286458@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list