• Victor Stinner's avatar
    Fix CID-1414686: PyInit_readline() handles errors (#4647) · 0efc0249
    Victor Stinner authored
    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).
    0efc0249
readline.c 37.3 KB