Fix several error-case leaks on the Mac found by clang analysis

Review URL: http://breakpad.appspot.com/325001


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@884 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
stuartmorgan 2011-11-14 13:16:19 +00:00
parent 06cede988b
commit b2196565bd
2 changed files with 8 additions and 2 deletions

View file

@ -135,14 +135,19 @@ void MinidumpGenerator::GatherSystemInformation() {
CFURLCreateDataAndPropertiesFromResource(NULL, sys_vers, &data, NULL, NULL,
&error);
if (!data)
if (!data) {
CFRelease(sys_vers);
return;
}
CFDictionaryRef list = static_cast<CFDictionaryRef>
(CFPropertyListCreateFromXMLData(NULL, data, kCFPropertyListImmutable,
NULL));
if (!list)
if (!list) {
CFRelease(sys_vers);
CFRelease(data);
return;
}
CFStringRef build_version = static_cast<CFStringRef>
(CFDictionaryGetValue(list, CFSTR("ProductBuildVersion")));

View file

@ -475,6 +475,7 @@ NSString *const kDefaultServerType = @"google";
NSMutableDictionary *uploadParameters = [NSMutableDictionary dictionary];
if (![self populateServerDictionary:uploadParameters]) {
[upload release];
return;
}