F-4364: override releaseNativeStruct in Hmac to serialize native free

pull/261/head
Chris Conlon 2026-08-18 16:53:24 -06:00
parent 25b4ceb8cf
commit 2abd0fd33a
1 changed files with 12 additions and 0 deletions

View File

@ -212,6 +212,18 @@ public class Hmac extends NativeStruct {
}
}
/**
* Release native Hmac structure.
* Synchronized on this object so a concurrent release cannot free
* the native struct while another synchronized method is using it.
*/
@Override
public synchronized void releaseNativeStruct() {
synchronized (pointerLock) {
super.releaseNativeStruct();
}
}
/**
* Perform HMAC update operation
*