Skip to content

Fix CID-1414686: PyInit_readline() handles errors#4647

Merged
vstinner merged 1 commit into
python:masterfrom
vstinner:coverity_readline
Nov 30, 2017
Merged

Fix CID-1414686: PyInit_readline() handles errors#4647
vstinner merged 1 commit into
python:masterfrom
vstinner:coverity_readline

Conversation

@vstinner

Copy link
Copy Markdown
Member

Handle PyModule_AddIntConstant() and PyModule_AddStringConstant()
failures. Add also constants before calling setup_readline(), since
setup_readline() registers callbacks which uses a reference to the
module, whereas the module is destroyed if adding constants fails.

Fix Coverity warning:

CID 1414686: Unchecked return value (CHECKED_RETURN)
2. check_return: Calling PyModule_AddStringConstant without checking
return value (as is done elsewhere 45 out of 55 times).

Handle PyModule_AddIntConstant() and PyModule_AddStringConstant()
failures. Add also constants before calling setup_readline(), since
setup_readline() registers callbacks which uses a reference to the
module, whereas the module is destroyed if adding constants fails.

Fix Coverity warning:

CID 1414686: Unchecked return value (CHECKED_RETURN)
2. check_return: Calling PyModule_AddStringConstant without checking
return value (as is done elsewhere 45 out of 55 times).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants