• Stéphane Wirtel's avatar
    bpo-30614: testInitNonExistentFile() of test_bz2 leaks references (#2033) · 28288beb
    Stéphane Wirtel yazdı
    * bpo-30614: testInitNonExistentFile() of test_bz2 leaks references
    
    Extract the code of BZ2File_dealloc and create a new BZ2File_clear()
    function. Call BZ2File_clear() in BZ2File_dealloc().
    
    Define BZ2File_clear() as tp_clear.
    
    Move the lock initialization before the "self->file =
    PyObject_CallFunction" in BZ2File_init() and check the lock is not
    created twice.
    
    Call BZ2File_clear() in BZ2File_init() after the init of the lock
    Co-Authored-By: 's avatarVictor Stinner <victor.stinner@gmail.com>
    
    * Create bz2module.c
    
    Fix after the review of Victor Stinner
    28288beb
bz2module.c 68.3 KB