~zseil/pyopenssl/util-cleanup

Viewing all changes in revision 127.

  • Committer: Ziga Seilnacht
  • Date: 2009-12-22 11:08:24 UTC
  • Revision ID: ziga.seilnacht@gmail.com-20091222110824-iwstubrg9ltdpwlk
Avoid memory allocation to prevent possible loss of error details.

E.g. before this change code like this might overwrite the exception
from callback with uninformative MemoryError:

    pkey = PEM_read_bio_PrivateKey(bio, NULL, callback, cb_arg);
    if (pkey == NULL) {
        if (PyErr_Occured()) {
            /* Reraise the Python level error from callback */
            flush_error_queue();
            return NULL;
        }
    }

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: