From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 8 Mar 2026 08:02:39 +0000 (+0100) Subject: [3.13] gh-145376: Fix refleak in `queuemodule.c` out-of-memory path (GH-145543) ... X-Git-Tag: v3.13.13~122 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a73d5a35c6da2b8e45df027b5313ac4e82a7390;p=thirdparty%2FPython%2Fcpython.git [3.13] gh-145376: Fix refleak in `queuemodule.c` out-of-memory path (GH-145543) (#145621) gh-145376: Fix refleak in `queuemodule.c` out-of-memory path (GH-145543) (cherry picked from commit 0aeaaafac476119f242fe717ce60d2070172127b) Co-authored-by: Pieter Eendebak --- diff --git a/Modules/_queuemodule.c b/Modules/_queuemodule.c index 5c995cf68334..9f1c9a1b0d42 100644 --- a/Modules/_queuemodule.c +++ b/Modules/_queuemodule.c @@ -165,6 +165,7 @@ RingBuf_Put(RingBuf *buf, PyObject *item) // Buffer is full, grow it. if (resize_ringbuf(buf, buf->items_cap * 2) < 0) { PyErr_NoMemory(); + Py_DECREF(item); return -1; } }