瀏覽代碼

[ISSUE ZOMBIE]

Marino Faggiana 7 年之前
父節點
當前提交
0796bd6c4d
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      iOSClient/Security/NCEndToEndEncryption.m

+ 6 - 1
iOSClient/Security/NCEndToEndEncryption.m

@@ -450,6 +450,10 @@ cleanup:
     
     
     if (output)
     if (output)
         free(output);
         free(output);
+    free (bio);
+    free (x509);
+    free (evpkey);
+    free (rsa);
     
     
     return encryptData;
     return encryptData;
 }
 }
@@ -464,7 +468,6 @@ cleanup:
     RSA *rsa = PEM_read_bio_RSAPrivateKey(bio, NULL, 0, NULL);
     RSA *rsa = PEM_read_bio_RSAPrivateKey(bio, NULL, 0, NULL);
     if (rsa == NULL)
     if (rsa == NULL)
         return nil;
         return nil;
-    BIO_free(bio);
     
     
     unsigned char *decrypted = (unsigned char *) malloc([chiperData length]);
     unsigned char *decrypted = (unsigned char *) malloc([chiperData length]);
     
     
@@ -480,6 +483,8 @@ cleanup:
     
     
     if (decrypted)
     if (decrypted)
         free(decrypted);
         free(decrypted);
+    free (bio);
+    free (rsa);
     
     
     return decryptString;
     return decryptString;
 }
 }