[Zodb-checkins] CVS: StandaloneZODB/ExtensionClass/src - ThreadLock.c:1.10
Barry Warsaw
barry@wooz.org
Thu, 8 Nov 2001 12:02:10 -0500
Update of /cvs-repository/StandaloneZODB/ExtensionClass/src
In directory cvs.zope.org:/tmp/cvs-serv4253/ExtensionClass/src
Modified Files:
ThreadLock.c
Log Message:
initThreadLock(): Be sure to decref the revision string, added to the
module dict with the keys "__version__". Fixes small leaks detected
by Insure.
=== StandaloneZODB/ExtensionClass/src/ThreadLock.c 1.9 => 1.10 ===
initThreadLock(void)
{
- PyObject *m, *d;
+ PyObject *m, *d, *s;
char *rev="$Revision$";
m = Py_InitModule4("ThreadLock", Module_methods,
@@ -320,8 +320,9 @@
ErrorObject = PyString_FromString("ThreadLock.error");
PyDict_SetItemString(d, "error", ErrorObject);
- PyDict_SetItemString(d, "__version__",
- PyString_FromStringAndSize(rev+11,strlen(rev+11)-2));
+ s = PyString_FromStringAndSize(rev+11,strlen(rev+11)-2);
+ PyDict_SetItemString(d, "__version__", s);
+ Py_XDECREF(s);
#ifdef WITH_THREAD
PyDict_SetItemString(d, "WITH_THREAD", PyInt_FromLong(1));