Skip to content
Snippets Groups Projects
Commit e9f67730 authored by Stuart Gathman's avatar Stuart Gathman
Browse files

Report context allocation error.

parent 2276762c
Branches
Tags
No related merge requests found
...@@ -34,6 +34,9 @@ $ python setup.py help ...@@ -34,6 +34,9 @@ $ python setup.py help
libraries=["milter","smutil","resolv"] libraries=["milter","smutil","resolv"]
* $Log$ * $Log$
* Revision 1.4 2005/06/24 04:12:43 customdesigned
* Remove unused name argument to generic wrappers.
*
* Revision 1.3 2005/06/24 03:57:35 customdesigned * Revision 1.3 2005/06/24 03:57:35 customdesigned
* Handle close called before connect. * Handle close called before connect.
* *
...@@ -200,7 +203,7 @@ $ python setup.py help ...@@ -200,7 +203,7 @@ $ python setup.py help
/* Yes, these are static. If you need multiple different callbacks, */ /* Yes, these are static. If you need multiple different callbacks, */
/* it's cleaner to use multiple filters. */ /* it's cleaner to use multiple filters, or convert to OO method calls. */
static PyObject *connect_callback = NULL; static PyObject *connect_callback = NULL;
static PyObject *helo_callback = NULL; static PyObject *helo_callback = NULL;
static PyObject *envfrom_callback = NULL; static PyObject *envfrom_callback = NULL;
...@@ -245,8 +248,11 @@ _get_context(SMFICTX *ctx) { ...@@ -245,8 +248,11 @@ _get_context(SMFICTX *ctx) {
PyEval_AcquireThread(t); /* lock interp */ PyEval_AcquireThread(t); /* lock interp */
self = PyObject_New(milter_ContextObject,&milter_ContextType); self = PyObject_New(milter_ContextObject,&milter_ContextType);
if (!self) { if (!self) {
/* Can't pass on exception since we are called from libmilter */ /* Report and clear exception since we are called from libmilter */
if (PyErr_Occurred()) {
PyErr_Print();
PyErr_Clear(); PyErr_Clear();
}
PyThreadState_Clear(t); PyThreadState_Clear(t);
PyEval_ReleaseThread(t); PyEval_ReleaseThread(t);
PyThreadState_Delete(t); PyThreadState_Delete(t);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment