diff --git a/keychain_mac.cpp b/keychain_mac.cpp index 52e5095..19a1157 100644 --- a/keychain_mac.cpp +++ b/keychain_mac.cpp @@ -221,7 +221,7 @@ void deletePassword(const std::string &package, const std::string &service, } } - if (item) { + if (!err && item) { CFRelease(item); }