| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
insnstr() sets the window rendition before the write. When that fails it released the wide string but not the bytes object that PyCurses_ConvertToString() returned as a new reference, so each failing call leaked one reference to the caller's argument. addstr(), addnstr() and insstr() already release it at the same point.
There was a problem hiding this comment.
LGTM. 👍
It is worth to backport the fix to 3.15, even if we cannot reproduce the leak there.
Sorry, something went wrong.
|
Thanks @fedonman for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
|
Sorry, @fedonman and @serhiy-storchaka, I could not cleanly backport this to 3.15 due to a conflict. cherry_picker 23180c50082fe98784c78511b335d7274ed87fb7 3.15 |
Sorry, something went wrong.
…honGH-156954) insnstr() did not release the bytes object it converted its argument to when setting the attributes failed, unlike addstr(), addnstr() and insstr().
|
Thanks @fedonman for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
|
Sorry, @fedonman and @serhiy-storchaka, I could not cleanly backport this to 3.15 due to a conflict. Please backport manually with cherry_picker, see the devguide for more information. cherry_picker 23180c50082fe98784c78511b335d7274ed87fb7 3.15 |
Sorry, something went wrong.
|
GH-159108 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
_curses_window_insnstr_impl() frees the wide string when curses_wattr_save() or curses_wattrset() fails, but never decrefs the bytes object PyCurses_ConvertToString() returned as a new reference, so each failing call leaks one reference to the caller's argument. GH-145609 added that decref to addstr(), addnstr() and insstr() and skipped insnstr(); this adds the missing line and a test covering all four.
There is no NEWS entry because no released version can reach the leak: 3.15 has the same omission, but detaching a window arrived with the multi-terminal screen API in GH-151748, so nothing there makes the rendition call fail.