mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
python: Avoid leaking py_array and py_args in event callbacks
See also:
https://listman.redhat.com/archives/libguestfs/2023-February/030730.html
https://listman.redhat.com/archives/libguestfs/2023-February/030745.html
https://listman.redhat.com/archives/libguestfs/2023-February/030746.html
Fixes: commit 6ef5837e2d
Thanks: Laszlo Ersek, Eric Blake
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
@@ -134,6 +134,7 @@ guestfs_int_py_event_callback_wrapper (guestfs_h *g,
|
||||
args = Py_BuildValue ("(Kiy#O)",
|
||||
(unsigned PY_LONG_LONG) event, event_handle,
|
||||
buf, buf_len, py_array);
|
||||
Py_DECREF (py_array);
|
||||
if (args == NULL) {
|
||||
PyErr_PrintEx (0);
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user