@@ -51,17 +51,23 @@ - (instancetype)initWithConfigPath: (OFString *)configPath { self = [super init]; @try { + void *pool = objc_autoreleasePoolPush(); + OFFile *configFile = [OFFile fileWithPath: configPath + mode: @"r"]; + OFXMLElement *config = [[OFXMLElement alloc] - initWithFile: configPath]; + initWithStream: configFile]; @try { [self _parseConfig: config]; } @finally { [config release]; } + + objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; } @@ -110,11 +116,11 @@ @" is missing port attribute"]; listenConfig.host = host; @try { - intmax_t port = portString.decimalValue; + long long port = portString.longLongValue; if (port < 0 || port > 65535) @throw [OFInvalidFormatException exception]; listenConfig.port = port; } @catch (OFInvalidFormatException *e) { @@ -167,9 +173,9 @@ _modules = [modules copy]; } - (void)_invalidConfig: (OFString *)message { - [of_stderr writeFormat: @"Error parsing config: %@", message]; + [OFStdErr writeFormat: @"Error parsing config: %@", message]; [OFApplication terminateWithStatus: 1]; } @end