From 48f01b610dbc39677622fd46b636de4939bfd84b Mon Sep 17 00:00:00 2001 From: rfm Date: Thu, 6 Feb 2025 20:11:08 +0000 Subject: [PATCH] Fix yet another leak --- Source/NSURLSessionTask.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Source/NSURLSessionTask.m b/Source/NSURLSessionTask.m index 10e54ee5a..0f0ccef62 100644 --- a/Source/NSURLSessionTask.m +++ b/Source/NSURLSessionTask.m @@ -139,9 +139,8 @@ errorForCURLcode(CURL *handle, CURLcode code, char errorBuffer[CURL_ERROR_SIZE]) return NULL; } - errorString = [[NSString alloc] initWithCString: errorBuffer]; - curlErrorString = - [[NSString alloc] initWithCString: curl_easy_strerror(code)]; + errorString = [NSString stringWithCString: errorBuffer]; + curlErrorString = [NSString stringWithCString: curl_easy_strerror(code)]; /* Get errno number from the last connect failure. * @@ -267,9 +266,6 @@ errorForCURLcode(CURL *handle, CURLcode code, char errorBuffer[CURL_ERROR_SIZE]) code: urlError userInfo: userInfo]; - [curlErrorString release]; - [errorString release]; - return error; } /* errorForCURLcode */ @@ -1344,8 +1340,8 @@ write_callback(char *ptr, size_t size, size_t nmemb, void *userdata) if (_properties & GSURLSessionUpdatesDelegate) { - if (_properties & GSURLSessionWritesDataToFile && - [_delegate respondsToSelector: didFinishDownloadingToURLSel]) + if (_properties & GSURLSessionWritesDataToFile + && [_delegate respondsToSelector: didFinishDownloadingToURLSel]) { NSURL *url = [_taskData objectForKey: taskTemporaryFileLocationKey];