• Jeremy Hylton's avatar
    Fix two memory leaks in socket.ssl(). · f86d63e4
    Jeremy Hylton yazdı
    XXX [1] These changes aren't tested very thoroughly, because regrtest
    doesn't do any SSL tests.  I've done some trivial tests on my own, but
    don't really know how to use the key and cert files.  In one case, an
    SSL-level error causes Python to dump core.  I'll get the fixed in the
    next round of changes.
    
    XXX [2] The checkin removes the x_attr member of the SSLObject struct.
    I'm not sure if this is kosher for backwards compatibility at the
    binary level.  Perhaps its safer to keep the member but keep it
    assigned to NULL.
    
    And the leaks?
    
    newSSLObject() called PyDict_New(), stored the result in x_attr
    without checking it, and later stored NULL in x_attr without doing
    anything to the dict.  So the dict always leaks.  There is no further
    reference to x_attr, so I just removed it completely.
    
    The error cases in newSSLObject() passed the return value of
    PyString_FromString() directly to PyErr_SetObject().
    PyErr_SetObject() expects a borrowed reference, so the string leaked.
    f86d63e4
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...