Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Possible memory leak #284

Closed
wants to merge 1 commit into from

3 participants

@pypt

Reported by static analyzer. Shouldn't break things as much as I've tried.

@ekscrypto

I would like to second this fix; the sslProperties object created if a clientCertificateIdentity is present in the startRequest method creates an autoreleased NSDictionary object, whereas the one created if no valid SSL Certificate is present is not autoreleased.

I tested this exact same change here on my side and it worked flawlessly.

@jogu
Collaborator

Thanks for suggesting this fix - several different fixes for this had built up in the pull queue, so I've applied one and am closing the rest.

@jogu jogu closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 8, 2011
  1. @pypt
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 Classes/ASIHTTPRequest.m
View
4 Classes/ASIHTTPRequest.m
@@ -1204,12 +1204,12 @@ - (void)startRequest
if (![self validatesSecureCertificate]) {
// see: http://iphonedevelopment.blogspot.com/2010/05/nsstream-tcp-and-ssl.html
- NSDictionary *sslProperties = [[NSDictionary alloc] initWithObjectsAndKeys:
+ NSDictionary *sslProperties = [[[NSDictionary alloc] initWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kCFStreamSSLAllowsExpiredCertificates,
[NSNumber numberWithBool:YES], kCFStreamSSLAllowsAnyRoot,
[NSNumber numberWithBool:NO], kCFStreamSSLValidatesCertificateChain,
kCFNull,kCFStreamSSLPeerName,
- nil];
+ nil] autorelease];
CFReadStreamSetProperty((CFReadStreamRef)[self readStream],
kCFStreamPropertySSLSettings,
Something went wrong with that request. Please try again.