Skip to content

Commit

Permalink
heap-allocate nb_func names
Browse files Browse the repository at this point in the history
  • Loading branch information
wjakob committed Nov 1, 2023
1 parent 176e4f7 commit 3c2b64a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/nb_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3c2b64a

Please sign in to comment.