[vlc-commits] keychain: fix leak

Thomas Guillem git at videolan.org
Thu Nov 14 15:24:07 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Nov  4 16:30:54 2019 +0100| [428e88a1c89c5e6f021357598b12c93840bc7ca1] | committer: Thomas Guillem

keychain: fix leak

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=428e88a1c89c5e6f021357598b12c93840bc7ca1
---

 modules/keystore/keychain.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 6afd11a8df..f92c30a583 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -94,10 +94,11 @@ static NSMutableDictionary * CreateQuery(vlc_keystore *p_keystore)
 
     [dictionary setObject:@"VLC-Password-Service" forKey:(__bridge id)kSecAttrService];
 
-    const char * psz_access_group = var_InheritString(p_keystore, "keychain-access-group");
+    char * psz_access_group = var_InheritString(p_keystore, "keychain-access-group");
     if (psz_access_group) {
         [dictionary setObject:[NSString stringWithUTF8String:psz_access_group] forKey:(__bridge id)kSecAttrAccessGroup];
     }
+    free(psz_access_group);
 
     id syncValue;
     int syncMode = var_InheritInteger(p_keystore, "keychain-synchronize");



More information about the vlc-commits mailing list