From 1080bc5a83a02c86f168265862e1807c661b5a6e Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 7 Dec 2015 02:08:31 -0500 Subject: [PATCH] Fix two leaks found by Analyze. --- Source/ProtocolClient.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/ProtocolClient.m b/Source/ProtocolClient.m index 7508817..d2ae226 100644 --- a/Source/ProtocolClient.m +++ b/Source/ProtocolClient.m @@ -97,7 +97,7 @@ // Collect varargs and format command. va_list args; va_start(args, handler); - NSString* command = [[NSString alloc] initWithFormat:format arguments:args]; + NSString* command = [[[NSString alloc] initWithFormat:format arguments:args] autorelease]; va_end(args); int transaction = _nextID++; @@ -186,9 +186,9 @@ // Parse the XML and test for errors. NSError* error = nil; - NSXMLDocument* xml = [[NSXMLDocument alloc] initWithXMLString:message - options:NSXMLDocumentTidyXML - error:&error]; + NSXMLDocument* xml = [[[NSXMLDocument alloc] initWithXMLString:message + options:NSXMLDocumentTidyXML + error:&error] autorelease]; if (error) { [self messageQueue:queue error:error]; return; -- 2.43.5