Skip to content

Commit

Permalink
Merge pull request softhsm#519 from opendnssec/fix_issue_518
Browse files Browse the repository at this point in the history
Fix issue softhsm#518 by locking before the object set is accessed
  • Loading branch information
halderen authored Mar 3, 2020
2 parents 0ad0f7b + 2446047 commit 9100ce6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/object_store/SessionObjectStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ SessionObject* SessionObjectStore::createObject(CK_SLOT_ID slotID, CK_SESSION_HA
// Delete an object
bool SessionObjectStore::deleteObject(SessionObject* object)
{
MutexLocker lock(storeMutex);

if (objects.find(object) == objects.end())
{
ERROR_MSG("Cannot delete non-existent object 0x%08X", object);

return false;
}

MutexLocker lock(storeMutex);

// Invalidate the object instance
object->invalidate();

Expand Down

0 comments on commit 9100ce6

Please sign in to comment.