Merge branch 'master' of git://github.com/ksuther/MenuTunes
[MenuTunes.git] / PreferencesController.m
index 962b7d8..2b1bbf8 100755 (executable)
@@ -183,15 +183,14 @@ static PreferencesController *prefs = nil;
                if (status != noErr) {
                        ITDebugLog(@"Audioscrobbler: Error getting keychain item password: %i", status);
                } else {
-                       NSLog(@"Audioscrobbler: password buffer: \"%s\" \"Length: %i\"", buffer, length);
-                       pass = [[NSString alloc] initWithCharacters:(unichar *)buffer length:length];
+                       pass = [[NSString alloc] initWithBytes:buffer length:length encoding:NSUTF8StringEncoding];
                }
                if (status != noErr) {
                        ITDebugLog(@"Audioscrobbler: Error deleting keychain item: %i", status);
                }
+               SecKeychainItemFreeContent(NULL, buffer);
                CFRelease(item);
        }
-       NSLog(@"Audioscrobbler: Retrieved password: \"%@\"", pass);
        return [pass autorelease];
 }