Skip to content

Commit 1a73d5a

Browse files
[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 0aeaaaf) Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
1 parent 26d587b commit 1a73d5a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Modules/_queuemodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ RingBuf_Put(RingBuf *buf, PyObject *item)
165165
// Buffer is full, grow it.
166166
if (resize_ringbuf(buf, buf->items_cap * 2) < 0) {
167167
PyErr_NoMemory();
168+
Py_DECREF(item);
168169
return -1;
169170
}
170171
}

0 commit comments

Comments
 (0)