Commit 094328b7 authored by Barry Warsaw's avatar Barry Warsaw

initThreadLock(): Be sure to decref the revision string, added to the

module dict with the keys "__version__".  Fixes small leaks detected
by Insure.
parent 7513e635
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE. DAMAGE.
$Id: ThreadLock.c,v 1.9 2001/04/02 16:38:58 jeremy Exp $ $Id: ThreadLock.c,v 1.10 2001/11/08 17:02:09 bwarsaw Exp $
If you have questions regarding this software, If you have questions regarding this software,
contact: contact:
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
*/ */
static char ThreadLock_module_documentation[] = static char ThreadLock_module_documentation[] =
"" ""
"\n$Id: ThreadLock.c,v 1.9 2001/04/02 16:38:58 jeremy Exp $" "\n$Id: ThreadLock.c,v 1.10 2001/11/08 17:02:09 bwarsaw Exp $"
; ;
#include "Python.h" #include "Python.h"
...@@ -305,8 +305,8 @@ static struct PyMethodDef Module_methods[] = { ...@@ -305,8 +305,8 @@ static struct PyMethodDef Module_methods[] = {
void void
initThreadLock(void) initThreadLock(void)
{ {
PyObject *m, *d; PyObject *m, *d, *s;
char *rev="$Revision: 1.9 $"; char *rev="$Revision: 1.10 $";
m = Py_InitModule4("ThreadLock", Module_methods, m = Py_InitModule4("ThreadLock", Module_methods,
ThreadLock_module_documentation, ThreadLock_module_documentation,
...@@ -320,8 +320,9 @@ initThreadLock(void) ...@@ -320,8 +320,9 @@ initThreadLock(void)
ErrorObject = PyString_FromString("ThreadLock.error"); ErrorObject = PyString_FromString("ThreadLock.error");
PyDict_SetItemString(d, "error", ErrorObject); PyDict_SetItemString(d, "error", ErrorObject);
PyDict_SetItemString(d, "__version__", s = PyString_FromStringAndSize(rev+11,strlen(rev+11)-2);
PyString_FromStringAndSize(rev+11,strlen(rev+11)-2)); PyDict_SetItemString(d, "__version__", s);
Py_XDECREF(s);
#ifdef WITH_THREAD #ifdef WITH_THREAD
PyDict_SetItemString(d, "WITH_THREAD", PyInt_FromLong(1)); PyDict_SetItemString(d, "WITH_THREAD", PyInt_FromLong(1));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment