@@ -30,7 +30,7 @@ actual open class KVault(
30
30
* If the bundle identifier is nil, it will fallback to `com.liftric.KVault`.
31
31
*/
32
32
@Deprecated(" Will be removed in a future version, please use the primary constructor. Check your service name before migrating." )
33
- constructor (): this (Constants .BundleIdentifier , null )
33
+ constructor () : this (Constants .BundleIdentifier , null )
34
34
35
35
// ===============
36
36
// SET OPERATIONS
@@ -255,7 +255,6 @@ actual open class KVault(
255
255
CFDictionaryAddValue (query, kSecClass, kSecClassGenericPassword)
256
256
CFDictionaryAddValue (query, kSecAttrAccount, CFBridgingRetain (key))
257
257
CFDictionaryAddValue (query, kSecValueData, CFBridgingRetain (value))
258
-
259
258
return if (existsObject(key)) {
260
259
update(value, key)
261
260
} else {
@@ -269,14 +268,12 @@ actual open class KVault(
269
268
CFDictionaryAddValue (query, kSecAttrAccount, CFBridgingRetain (forKey))
270
269
CFDictionaryAddValue (query, kSecReturnData, kCFBooleanTrue)
271
270
CFDictionaryAddValue (query, kSecMatchLimit, kSecMatchLimitOne)
272
-
273
271
memScoped {
274
272
val result = alloc<CFTypeRefVar >()
275
273
if (perform(Operation .Get , query, result)) {
276
274
return CFBridgingRelease (result.value) as NSData
277
275
}
278
276
}
279
-
280
277
return null
281
278
}
282
279
@@ -315,6 +312,8 @@ actual open class KVault(
315
312
Operation .Update -> SecItemUpdate (query, updateQuery)
316
313
Operation .Delete -> SecItemDelete (query)
317
314
}
315
+ CFRelease (query)
316
+ updateQuery?.let { CFRelease (it) }
318
317
319
318
return if (status.toUInt() == noErr) {
320
319
true
0 commit comments