]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_keychain/lib/StorageManager.cpp
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_keychain / lib / StorageManager.cpp
index c8484cea5bbea71908d66026292a8ce144765d6f..e173e8512de9069b5e76bd6aa95cf7e723bf0001 100644 (file)
@@ -51,7 +51,7 @@
 #include "TrustSettingsSchema.h"
 #include <security_cdsa_client/wrapkey.h>
 #include <securityd_client/ssblob.h>
 #include "TrustSettingsSchema.h"
 #include <security_cdsa_client/wrapkey.h>
 #include <securityd_client/ssblob.h>
-#include <SecBasePriv.h>
+#include <Security/SecBasePriv.h>
 #include "TokenLogin.h"
 
 //%%% add this to AuthorizationTagsPriv.h later
 #include "TokenLogin.h"
 
 //%%% add this to AuthorizationTagsPriv.h later
@@ -1356,10 +1356,11 @@ void StorageManager::login(ConstStringPtr name, ConstStringPtr password)
 {
        StLock<Mutex>_(mMutex);
 
 {
        StLock<Mutex>_(mMutex);
 
-    if ( name == NULL || password == NULL )
+    if ( name == NULL || password == NULL ) {
         MacOSError::throwMe(errSecParam);
         MacOSError::throwMe(errSecParam);
+    }
 
 
-       login(name[0], name + 1, password[0], password + 1, false);
+    login(name[0], name + 1, password[0], password + 1, false);
 }
 
 void StorageManager::login(UInt32 nameLength, const void *name,
 }
 
 void StorageManager::login(UInt32 nameLength, const void *name,
@@ -1573,7 +1574,9 @@ void StorageManager::login(UInt32 nameLength, const void *name,
                                                        }
                                                }
                                        }
                                                        }
                                                }
                                        }
-                                       AuthorizationFreeItemSet(returnedInfo);
+                    if(returnedInfo) {
+                        AuthorizationFreeItemSet(returnedInfo);
+                    }
                                }
                                AuthorizationFree(authRef, 0);
                        }
                                }
                                AuthorizationFree(authRef, 0);
                        }