safer backend release (#701)

This commit is contained in:
Dmitriy Ryajov 2024-02-10 17:17:11 -06:00 committed by GitHub
parent 64e6a602fd
commit 6fab252bf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -88,6 +88,10 @@ proc prove*[H](
var
backend: ptr CircomCompatCtx
defer:
if backend != nil:
backend.addr.releaseCircomCompat()
if initCircomCompat(
self.backendCfg,
addr backend) != ERR_OK or backend == nil:
@ -169,9 +173,6 @@ proc prove*[H](
if proofPtr != nil:
proofPtr.addr.releaseProof()
if backend != nil:
backend.addr.releaseCircomCompat()
success proof
proc verify*(