~sileht/pyopenssl/pyopenssl

« back to all changes in this revision

Viewing changes to OpenSSL/crypto/crl.c

  • Committer: Jean-Paul Calderone
  • Date: 2011-04-25 23:41:32 UTC
  • mfrom: (128.2.10 run-on-pypy)
  • Revision ID: exarkun@divmod.com-20110425234132-0f76yf59poaegjxu
Various fixes which make pyOpenSSL more likely to work with PyPy

  * Fix a consistent refcounting bug across most modules
  * switch from tp_setattr to tp_setattro
  * Fix a general bug in error handling when setting invalid X509Name attributes

Show diffs side-by-side

added added

removed removed

Lines of Context:
276
276
};
277
277
 
278
278
int init_crypto_crl(PyObject *module) {
279
 
       if (PyType_Ready(&crypto_CRL_Type) < 0) {
280
 
                  return 0;
281
 
       }
 
279
    if (PyType_Ready(&crypto_CRL_Type) < 0) {
 
280
        return 0;
 
281
    }
282
282
 
283
 
       if (PyModule_AddObject(module, "CRL", (PyObject *)&crypto_CRL_Type) != 0) {
284
 
                  return 0;
285
 
       }
286
 
       return 1;
 
283
    /* PyModule_AddObject steals a reference.
 
284
     */
 
285
    Py_INCREF((PyObject *)&crypto_CRL_Type);
 
286
    if (PyModule_AddObject(module, "CRL", (PyObject *)&crypto_CRL_Type) != 0) {
 
287
        return 0;
 
288
    }
 
289
    return 1;
287
290
}