From 3c2b64a0ccde7ff09c28dfe20af0d5de96c0f364 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Wed, 1 Nov 2023 23:10:39 +0100 Subject: [PATCH] heap-allocate ``nb_func`` names --- src/nb_func.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nb_func.cpp b/src/nb_func.cpp index f1347656..8441f807 100644 --- a/src/nb_func.cpp +++ b/src/nb_func.cpp @@ -100,6 +100,7 @@ void nb_func_dealloc(PyObject *self) { } } + free((char *) f->name); free(f->args); free((char *) f->descr); free(f->descr_types); @@ -304,6 +305,7 @@ PyObject *nb_func_new(const void *in_) noexcept { if (!has_name) fc->name = ""; + fc->name = strdup_check(fc->name); if (is_implicit) { check(fc->flags & (uint32_t) func_flags::is_constructor,