From 8475fe5287e4d20aa2fdd55c6e5d10b6a8d9fa58 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 8 Aug 2012 02:00:50 -0700 Subject: [PATCH] alloc/init the pipe instead of using an autoreleased object --- DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m index e2f038f..1ea7eec 100644 --- a/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m +++ b/DNSCrypt-Preference-Pane/DNSCrypt/DNSCrypt.m @@ -34,7 +34,7 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; - (NSString *) fromCommand: (NSString *) launchPath withArguments: (NSArray *) arguments { - NSPipe *pipe = [NSPipe pipe]; + NSPipe *pipe = [[NSPipe alloc] init]; NSTask *task = [[NSTask alloc] init]; NSData *data; NSString *result; @@ -45,6 +45,7 @@ DNSConfigurationState currentState = kDNS_CONFIGURATION_UNKNOWN; data = [[pipe fileHandleForReading] readDataToEndOfFile]; [task waitUntilExit]; [task release]; + [pipe release]; result = [[[NSString alloc] initWithData: data encoding: NSUTF8StringEncoding] autorelease]; if ([result hasSuffix: @"\n"]) { result = [result substringToIndex: result.length - 1];