[vlc-commits] macOS keychain: Remove write only variable and redundant line

David Fuhrmann git at videolan.org
Thu Apr 12 22:54:59 CEST 2018


vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Apr 12 20:20:42 2018 +0200| [fe75693f216fb7ce39704c65dceda82f9fa79176] | committer: David Fuhrmann

macOS keychain: Remove write only variable and redundant line

(cherry picked from commit bdb34e604cdaa21dd644a34ba0051a971db268b6)
Signed-off-by: David Fuhrmann <dfuhrmann at videolan.org>

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

 modules/keystore/keychain.m | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/modules/keystore/keychain.m b/modules/keystore/keychain.m
index 917b0dc8af..0099b4c099 100644
--- a/modules/keystore/keychain.m
+++ b/modules/keystore/keychain.m
@@ -371,8 +371,6 @@ static unsigned int Find(vlc_keystore *p_keystore,
         SecKeychainItemRef itemRef = (__bridge SecKeychainItemRef)([listOfResults objectAtIndex:i]);
 
         SecKeychainAttributeInfo attrInfo;
-        attrInfo.count = 0;
-
         attrInfo.count = 1;
         UInt32 tags[1] = {kSecAccountItemAttr}; //, kSecAccountItemAttr, kSecServerItemAttr, kSecPortItemAttr, kSecProtocolItemAttr, kSecPathItemAttr};
         attrInfo.tag = tags;
@@ -397,10 +395,7 @@ static unsigned int Find(vlc_keystore *p_keystore,
                 case kSecAccountItemAttr:
                     if (!p_entry->ppsz_values[KEY_USER]) {
                         msg_Dbg(p_keystore, "using account name from the keychain for login");
-                        uint8_t *paddedAccountAttribute = calloc(1, attr->length + 1);
-                        memcpy(paddedAccountAttribute, attr->data, attr->length);
                         p_entry->ppsz_values[KEY_USER] = strdup((const char *)attr->data);
-                        free(paddedAccountAttribute);
                     }
                     break;
                 default:



More information about the vlc-commits mailing list