summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsdefresne <sdefresne@chromium.org>2016-09-21 09:24:52 (GMT)
committerCommit bot <commit-bot@chromium.org>2016-09-21 09:28:35 (GMT)
commit5e5f2f83e084fd34138ed1bf96bf9e39c3f83be2 (patch)
treea2c54253c9c791fa08941f79922020720eeb3269
parent1dfeab55f101d05538c80cb1b3228dfa14f9db9e (diff)
downloadchromium-5e5f2f83e084fd34138ed1bf96bf9e39c3f83be2.tar.gz
chromium-5e5f2f83e084fd34138ed1bf96bf9e39c3f83be2.tar.xz
Fix a memory leak found by clang static analyzer.
The function CFUUIDCreate respect the "Create Rule" for ownership of the returned reference, so it need to be released by a call to CFRelease. BUG=648210 Review-Url: https://codereview.chromium.org/2357463003 Cr-Commit-Position: refs/heads/master@{#420020}
-rw-r--r--ios/web/navigation/crw_session_controller.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index c5078c9..ff1093b 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -843,6 +843,8 @@ NSString* const kXCallbackParametersKey = @"xCallbackParameters";
- (NSString*)uniqueID {
CFUUIDRef uuidRef = CFUUIDCreate(NULL);
CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef);
+ CFRelease(uuidRef);
+
NSString* uuid =
[NSString stringWithString:base::mac::ObjCCastStrict<NSString>(
CFBridgingRelease(uuidStringRef))];