safer backend release (#701)
This commit is contained in:
parent
64e6a602fd
commit
6fab252bf1
|
@ -88,6 +88,10 @@ proc prove*[H](
|
||||||
var
|
var
|
||||||
backend: ptr CircomCompatCtx
|
backend: ptr CircomCompatCtx
|
||||||
|
|
||||||
|
defer:
|
||||||
|
if backend != nil:
|
||||||
|
backend.addr.releaseCircomCompat()
|
||||||
|
|
||||||
if initCircomCompat(
|
if initCircomCompat(
|
||||||
self.backendCfg,
|
self.backendCfg,
|
||||||
addr backend) != ERR_OK or backend == nil:
|
addr backend) != ERR_OK or backend == nil:
|
||||||
|
@ -169,9 +173,6 @@ proc prove*[H](
|
||||||
if proofPtr != nil:
|
if proofPtr != nil:
|
||||||
proofPtr.addr.releaseProof()
|
proofPtr.addr.releaseProof()
|
||||||
|
|
||||||
if backend != nil:
|
|
||||||
backend.addr.releaseCircomCompat()
|
|
||||||
|
|
||||||
success proof
|
success proof
|
||||||
|
|
||||||
proc verify*(
|
proc verify*(
|
||||||
|
|
Loading…
Reference in New Issue