Fix uninitialized values and leaks.

This commit is contained in:
Nate Weaver 2012-07-04 23:50:57 -05:00
parent abbced3d0d
commit 609d3fda54
3 changed files with 3 additions and 3 deletions

View File

@ -65,7 +65,7 @@
#endif
+ (NSCharacterSet *)tabCharacterSet
{
unsigned char bitmapRep[8192];
unsigned char bitmapRep[8192] = { 0 };
bitmapRep[0x09 >> 3] |= (((unsigned int)1) << (0x09 & 7));
bitmapRep[0x0B >> 3] |= (((unsigned int)1) << (0x0B & 7));
NSData *data = [NSData dataWithBytesNoCopy:bitmapRep length:8192 freeWhenDone:YES];

View File

@ -59,7 +59,7 @@
- (NSAttributedString *)attributedStringForObjectValue:(id)obj withDefaultAttributes:(NSDictionary *)attrs
{
NSString *string = [self stringForObjectValue:obj];
return [[NSAttributedString alloc] initWithString:string attributes:attrs];
return [[[NSAttributedString alloc] initWithString:string attributes:attrs] autorelease];
}
- (NSString *)editingStringForObjectValue:(id)obj

View File

@ -154,7 +154,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType";
- (id)copyWithZone:(NSZone *)zone
{
Resource *copy = [[Resource alloc] initWithType:type andID:resID withName:name andAttributes:attributes data:[data copy]];
Resource *copy = [[Resource alloc] initWithType:type andID:resID withName:name andAttributes:attributes data:[[data copy] autorelease]];
[copy setDocumentName:_docName];
return copy;
}