Forráskód Böngészése

Update NCEndToEndEncryption.m

Marino Faggiana 1 éve
szülő
commit
2e28a5826b
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      iOSClient/Networking/E2EE/NCEndToEndEncryption.m

+ 3 - 1
iOSClient/Networking/E2EE/NCEndToEndEncryption.m

@@ -856,12 +856,13 @@
     }
 
     NSInputStream *inStream = [NSInputStream inputStreamWithFileAtPath:fileName];
-    NSOutputStream *outStream = [NSOutputStream outputStreamToFileAtPath:fileNameCipher append:false];
     [inStream open];
+    NSOutputStream *outStream = [NSOutputStream outputStreamToFileAtPath:fileNameCipher append:false];
     [outStream open];
 
     Byte buffer[streamBuffer];
     NSInteger totalNumberOfBytesWritten = 0;
+
     int cCipherLen = 0;
     unsigned char *cCipher;
 
@@ -876,6 +877,7 @@
             if (status <= 0) {
                 [inStream close];
                 [outStream close];
+                EVP_CIPHER_CTX_free(ctx);
                 return NO;
             }