From 822fdc67df7fc9887df8613e1649ea61cadda437 Mon Sep 17 00:00:00 2001 From: Steven Gu Date: Mon, 23 Oct 2023 11:21:06 +0800 Subject: [PATCH] Fix --- prover/core/prover.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prover/core/prover.go b/prover/core/prover.go index c006e2dd23..8f8981394b 100644 --- a/prover/core/prover.go +++ b/prover/core/prover.go @@ -42,7 +42,6 @@ func NewProverCore(cfg *config.ProverCoreConfig) (*ProverCore, error) { var vk string var rawVK *C.char - defer C.free_c_chars(rawVK) if cfg.ProofType == message.ProofTypeBatch { C.init_batch_prover(paramsPathStr, assetsPathStr) rawVK = C.get_batch_vk() @@ -50,6 +49,7 @@ func NewProverCore(cfg *config.ProverCoreConfig) (*ProverCore, error) { C.init_chunk_prover(paramsPathStr, assetsPathStr) rawVK = C.get_chunk_vk() } + defer C.free_c_chars(rawVK) if rawVK != nil { vk = C.GoString(rawVK)