Skip to content

Commit

Permalink
ARC Support
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitsan committed Sep 12, 2012
1 parent 107c52e commit 280eef2
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions NSData+CommonCrypto.m
Expand Up @@ -98,7 +98,9 @@ + (NSError *) errorWithCCCryptorStatus: (CCCryptorStatus) status
[userInfo setObject: reason forKey: NSLocalizedFailureReasonErrorKey];

NSError * result = [NSError errorWithDomain: kCommonCryptoErrorDomain code: status userInfo: userInfo];
[userInfo release];
#if !__has_feature(objc_arc)
[userInfo release];
#endif

return ( result );
}
Expand Down Expand Up @@ -414,9 +416,10 @@ - (NSData *) dataEncryptedUsingAlgorithm: (CCAlgorithm) algorithm
else
ivData = (NSMutableData *) [iv mutableCopy]; // data or nil

[keyData autorelease];
[ivData autorelease];

#if !__has_feature(objc_arc)
[keyData autorelease];
[ivData autorelease];
#endif
// ensure correct lengths for key and iv data, based on algorithms
FixKeyLengths( algorithm, keyData, ivData );

Expand Down Expand Up @@ -486,8 +489,10 @@ - (NSData *) decryptedDataUsingAlgorithm: (CCAlgorithm) algorithm
else
ivData = (NSMutableData *) [iv mutableCopy]; // data or nil

[keyData autorelease];
[ivData autorelease];
#if !__has_feature(objc_arc)
[keyData autorelease];
[ivData autorelease];
#endif

// ensure correct lengths for key and iv data, based on algorithms
FixKeyLengths( algorithm, keyData, ivData );
Expand Down

0 comments on commit 280eef2

Please sign in to comment.