From e97b043c1b6907255a00c7b8edae0a0c8a669285 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 24 Sep 2022 13:55:37 +0700 Subject: [PATCH] sip4: fix memleak with Python 3.11 --- srcpkgs/sip4/patches/python-3.11.patch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/srcpkgs/sip4/patches/python-3.11.patch b/srcpkgs/sip4/patches/python-3.11.patch index cf382529950..6d60a5b239c 100644 --- a/srcpkgs/sip4/patches/python-3.11.patch +++ b/srcpkgs/sip4/patches/python-3.11.patch @@ -20,7 +20,7 @@ static int sip_api_check_plugin_for_type(const sipTypeDef *td, const char *name); static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar, -@@ -13741,13 +13741,13 @@ static int sip_api_is_user_type(const si +@@ -13741,13 +13741,16 @@ static int sip_api_is_user_type(const si /* * Return a frame from the execution stack. */ @@ -29,11 +29,14 @@ { - struct _frame *frame = PyEval_GetFrame(); + PyFrameObject *frame = PyEval_GetFrame(); ++ Py_XINCREF(frame); while (frame != NULL && depth > 0) { - frame = frame->f_back; ++ PyFrameObject *oframe = frame; + frame = PyFrame_GetBack(frame); ++ Py_DECREF(oframe); --depth; }