patch 9.1.1566: self-referenced enum may not get freed

Problem:  self-referenced enum may not get freed
Solution: Test if it can be freed (Yegappan Lakshmanan)

closes: #17743

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Yegappan Lakshmanan
2025-07-18 21:50:20 +02:00
committed by Christian Brabandt
parent f412241fcd
commit 0e40501a9d
5 changed files with 137 additions and 3 deletions

View File

@ -6025,7 +6025,8 @@ partial_free(partial_T *pt)
}
else
func_ptr_unref(pt->pt_func);
object_unref(pt->pt_obj);
if (pt->pt_obj != NULL)
object_unref(pt->pt_obj);
// "out_up" is no longer used, decrement refcount on partial that owns it.
partial_unref(pt->pt_outer.out_up_partial);