From 36fd68c818c72e8cd802dd524e9464577d3be7cf Mon Sep 17 00:00:00 2001
From: manuroe <manu@matrix.org>
Date: Tue, 26 Jun 2018 07:52:23 +0200
Subject: [PATCH] OLMAccount: Fix use of object after its memory was released

---
 xcode/OLMKit/OLMAccount.m | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xcode/OLMKit/OLMAccount.m b/xcode/OLMKit/OLMAccount.m
index af1e308..058b389 100644
--- a/xcode/OLMKit/OLMAccount.m
+++ b/xcode/OLMKit/OLMAccount.m
@@ -133,6 +133,7 @@
         const char *error = olm_account_last_error(_account);
         NSLog(@"error getting id keys: %s", error);
         free(otkBytes);
+        return nil;
     }
     NSData *otk = [NSData dataWithBytesNoCopy:otkBytes length:otkLength freeWhenDone:YES];
     NSError *error = nil;
-- 
GitLab