Skip to content

Commit b6d1377

Browse files
eendebakptmiss-islington
authored andcommitted
pythongh-145376: Fix refleak in queuemodule.c out-of-memory path (pythonGH-145543)
(cherry picked from commit 0aeaaaf) Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
1 parent c23dd52 commit b6d1377

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

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)