[MONGOCRYPT-322] Calling close multiple times causes a crash Created: 02/Jul/21  Updated: 28/Oct/23  Resolved: 07/Jul/21

Status: Closed
Project: Libmongocrypt
Component/s: Java binding
Affects Version/s: 1.2.0
Fix Version/s: 1.2.1

Type: Bug Priority: Unknown
Reporter: Ross Lawley Assignee: Ross Lawley
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-4215 Closing a MongoClient twice with Auto... Closed

 Description   

The MongoCryptImpl#close method isn't guarded:

    @Override
    public void close() {
        mongocrypt_destroy(wrapped);
        closed = true;
    }

So each call to close() will try to destroy the mongocrypt_t object.



 Comments   
Comment by Githook User [ 06/Jul/21 ]

Author:

{'name': 'Ross Lawley', 'email': 'ross.lawley@gmail.com', 'username': 'rozza'}

Message: Ensure Java bindings handle multiple calls MongoCrypt#close (#179)

MONGOCRYPT-322
Branch: master
https://github.com/mongodb/libmongocrypt/commit/a0f76d83eddb478f5e5bb9083fbeae348db48610

Comment by Ross Lawley [ 02/Jul/21 ]

PR: https://github.com/mongodb/libmongocrypt/pull/179

Generated at Thu Feb 08 09:08:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.