Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverity errors #82

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/electronic-ids/pkcs11/PKCS11CardManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@
#define C(API, ...) Call(__func__, __FILE__, __LINE__, "C_" #API, fl->C_##API, __VA_ARGS__)

#define SCOPE_GUARD_SESSION(HANDLE, CLOSE) \
make_unique_ptr(&(HANDLE), [this](auto* h) { C(CLOSE, *h); });
make_unique_ptr(&(HANDLE), [this](auto* h) noexcept { \
try { \
C(CLOSE, *h); \
} catch (...) { \
} \
});

namespace electronic_id
{
Expand Down Expand Up @@ -100,12 +105,12 @@ class PKCS11CardManager
};

auto newInstance =
std::shared_ptr<PKCS11CardManager>(new PKCS11CardManager(module), deleter);
std::shared_ptr<PKCS11CardManager>(new PKCS11CardManager(module), std::move(deleter));
instances[moduleStr] = newInstance;
return newInstance;
}

~PKCS11CardManager()
~PKCS11CardManager() noexcept
{
if (!library)
return;
Expand Down
Loading