Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed memleak

  • Loading branch information...
commit 47a7f740c794b0e97b457574c3003dbc7c50665d 1 parent 753f945
Jolly aka Patrick Stein authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 Categories/NSData+RSAAddition.m
8 Categories/NSData+RSAAddition.m
View
@@ -128,25 +128,31 @@ - (bool) RSAcheckSignature:(NSData *)signature withPublicKey:(NSString *)public
if( NULL == newRSA )
{
JLog(@"couldn't create rsa object");
+ BIO_free(publickeymemory);
return nil;
}
}
-
+ BIO_free(publickeymemory);
+
switch( type )
{
case NID_ripemd160: {
if( 1 == verify_ripemd160( (unsigned char *)[self bytes], [self length],(unsigned char *)[signature bytes], [signature length],newRSA) )
{
+ RSA_free(newRSA);
return YES;
}
}break;
case NID_sha1: {
if( 1 == verify_sha1( (unsigned char *)[self bytes], [self length],(unsigned char *)[signature bytes], [signature length],newRSA) )
{
+ RSA_free(newRSA);
return YES;
}
}break;
default: JLog(@"type %d not supported.",type);
+ RSA_free(newRSA);
+
}
DJLog(@"signature did not match");
return NO;
Please sign in to comment.
Something went wrong with that request. Please try again.