From 8d641979b0808e82568da8cdb7d3abfe2b7bb6f0 Mon Sep 17 00:00:00 2001 From: Mike Nawrocki Date: Tue, 17 Sep 2024 13:48:58 -0400 Subject: [PATCH] Python: mark add_entry return value as reference Makes the return value from the PE::Reference add_entry method an internal reference. --- api/python/src/PE/objects/pyRelocation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/python/src/PE/objects/pyRelocation.cpp b/api/python/src/PE/objects/pyRelocation.cpp index 498a714f42..103ef228a1 100644 --- a/api/python/src/PE/objects/pyRelocation.cpp +++ b/api/python/src/PE/objects/pyRelocation.cpp @@ -60,7 +60,8 @@ void create(nb::module_& m) { .def("add_entry", &Relocation::add_entry, "Add a new " RST_CLASS_REF(lief.PE.RelocationEntry) ""_doc, - "new_entry"_a) + "new_entry"_a, + nb::rv_policy::reference_internal) LIEF_COPYABLE(Relocation) LIEF_DEFAULT_STR(Relocation);