Skip to content

Commit

Permalink
Cherry-pick b1fa824. rdar://124247709
Browse files Browse the repository at this point in the history
    Fix memory leak under [WKKeyedCoder initWithDictionary]
    https://bugs.webkit.org/show_bug.cgi?id=270734
    rdar://124247709

    Reviewed by Darin Adler.

    Make sure we adopt the result of `[NSDictionary mutableCopy]`.

    * Source/WebKit/Shared/Cocoa/WKKeyedCoder.mm:
    (-[WKKeyedCoder initWithDictionary:]):

    Canonical link: https://commits.webkit.org/275875@main

Identifier: 273664.1391@safari-7619.1.5-branch
  • Loading branch information
cdumez authored and MyahCobbs committed Mar 11, 2024
1 parent 9823284 commit b399b39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebKit/Shared/Cocoa/WKKeyedCoder.mm
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionary
if (!(self = [super init]))
return nil;

m_dictionary = [dictionary mutableCopy];
m_dictionary = adoptNS([dictionary mutableCopy]);
return self;
}

Expand Down

0 comments on commit b399b39

Please sign in to comment.