From b042f5e179164b0f65b4653bf9323d74b6bc471a Mon Sep 17 00:00:00 2001 From: xcel3011 <42922046+xcel3011@users.noreply.github.com> Date: Tue, 25 Feb 2025 18:09:28 +0800 Subject: [PATCH] fix: AddPunct panic for Go(#1921) --- scripts/go/sherpa_onnx.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/go/sherpa_onnx.go b/scripts/go/sherpa_onnx.go index 202638a7..b8363049 100644 --- a/scripts/go/sherpa_onnx.go +++ b/scripts/go/sherpa_onnx.go @@ -1483,7 +1483,7 @@ func DeleteOfflinePunc(punc *OfflinePunctuation) { func (punc *OfflinePunctuation) AddPunct(text string) string { p := C.SherpaOfflinePunctuationAddPunct(punc.impl, C.CString(text)) - defer C.free(unsafe.Pointer(p)) + defer C.SherpaOfflinePunctuationFreeText(p) text_with_punct := C.GoString(p)