@property(nonatomic, retain) NSMutableArray* playerList;
...
team.playerList = [[NSMutableArray alloc] initWithArray:self.playerList];
This is a memory leak right?
So why couldn't the static analysier pick this up?
Just go to Product and choose Analyze, or use the keyboard shortcut Command-Shift-B. You can see the analyzer running in the status bar of Xcode.
Definition. Static application security testing (SAST), or static analysis, is a testing methodology that analyzes source code to find security vulnerabilities that make your organization's applications susceptible to attack. SAST scans an application before the code is compiled. It's also known as white box testing.
Xcode 13 includes SDKs for iOS 15, iPadOS 15, tvOS 15, watchOS 8, and macOS Big Sur 11.3. The Xcode 13 release supports on-device debugging for iOS 9 and later, tvOS 9 and later, and watchOS 2 and later.
Yes, that's a memory leak; you need to either autorelease that array or manually release it after setting the property. I'm not sure why the static analyzer missed it—you might consider filing a bug against the developer tools.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With