Index: src/OFString.m ================================================================== --- src/OFString.m +++ src/OFString.m @@ -617,32 +617,35 @@ encoding: (enum of_string_encoding)encoding { self = [super init]; @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFFile *file; char *tmp; struct stat s; if (stat([path cString], &s) == -1) @throw [OFInitializationFailedException newWithClass: isa]; - tmp = [self allocMemoryWithSize: s.st_size]; - file = [OFFile fileWithPath: path - mode: @"rb"]; - [file readExactlyNBytes: s.st_size - intoBuffer: tmp]; - - self = [self initWithCString: tmp - encoding: encoding - length: s.st_size]; - - [self freeMemory: tmp]; - - [pool release]; + file = [[OFFile alloc] initWithPath: path + mode: @"rb"]; + + @try { + tmp = [self allocMemoryWithSize: s.st_size]; + + [file readExactlyNBytes: s.st_size + intoBuffer: tmp]; + + self = [self initWithCString: tmp + encoding: encoding + length: s.st_size]; + + [self freeMemory: tmp]; + } @finally { + [file release]; + } } @catch (id e) { [self release]; @throw e; }