From 040a1b43c65c838d03bd39832a04584832594297 Mon Sep 17 00:00:00 2001 From: M_noAria <46508354+M-Quadra@users.noreply.github.com> Date: Tue, 5 Oct 2021 17:13:27 +0800 Subject: [PATCH] fix Py_EnterRecursiveCall C.free sequence --- recursion.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recursion.go b/recursion.go index efb3e2a..ffe140e 100644 --- a/recursion.go +++ b/recursion.go @@ -20,7 +20,7 @@ import ( //Py_EnterRecursiveCall : https://docs.python.org/3/c-api/exceptions.html#c.Py_EnterRecursiveCall func Py_EnterRecursiveCall(where string) int { cwhere := C.CString(where) - C.free(unsafe.Pointer(cwhere)) + defer C.free(unsafe.Pointer(cwhere)) return int(C._go_Py_EnterRecursiveCall(cwhere)) }