[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 0aeaaafac4)

Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
This commit is contained in:
Miss Islington (bot) 2026-03-08 09:02:39 +01:00 committed by GitHub
parent 26d587b395
commit 1a73d5a35c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;
}
}