Permalink
Browse files

Fixed a crash that could occur when an appcast failed to parse due to…

… a double-release.
  • Loading branch information...
1 parent 0a4bc65 commit cbaa635a893e95932ba62e0cb2af4df61bce7fd9 @andymatuschak andymatuschak committed Jul 1, 2008
Showing with 4 additions and 4 deletions.
  1. +4 −4 SUAppcast.m
View
@@ -40,17 +40,19 @@ - (void)feedDidFinishLoading:(RSS *)aFeed
BOOL success = YES;
while ((current = [enumerator nextObject]))
{
- SUAppcastItem *item = [[[SUAppcastItem alloc] initWithDictionary:current] autorelease];
+ SUAppcastItem *item = [[SUAppcastItem alloc] initWithDictionary:current];
if (item)
{
- [(NSMutableArray *)tempItems addObject:item];
+ [(NSMutableArray *)tempItems addObject:[item autorelease]];
}
else
{
success = NO;
break;
}
}
+ [feed release];
+ feed = nil;
if (success)
{
items = [tempItems copy]; // Make the items list immutable.
@@ -62,8 +64,6 @@ - (void)feedDidFinishLoading:(RSS *)aFeed
{
[self reportError:[NSError errorWithDomain:SUSparkleErrorDomain code:SUAppcastParseError userInfo:[NSDictionary dictionaryWithObjectsAndKeys:SULocalizedString(@"An error occurred while parsing the update feed.", nil), NSLocalizedDescriptionKey, nil]]];
}
- [feed release];
- feed = nil;
}
- (void)feed:(RSS *)aFeed didFailWithError:(NSError *)error

0 comments on commit cbaa635

Please sign in to comment.