summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2004-08-03 08:33:55 (GMT)
committerArmin Rigo <arigo@tunes.org>2004-08-03 08:33:55 (GMT)
commita41276956d9c269f42dd9d57561475160fe22031 (patch)
treedeef47d7dc7a4e6d8a8a952c5fadb11e50c419d4 /Modules
parent31d485c0f5e817d37dbbfb86fdea66027866ce84 (diff)
downloadcpython-a41276956d9c269f42dd9d57561475160fe22031.zip
cpython-a41276956d9c269f42dd9d57561475160fe22031.tar.gz
cpython-a41276956d9c269f42dd9d57561475160fe22031.tar.bz2
SF bug #808756: refleaks in _hotshot.c.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_hotshot.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 0683be6..b75b1a32 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -347,9 +347,11 @@ unpack_add_info(LogReaderObject *self)
goto finally;
}
if (PyDict_SetItem(self->info, key, list)) {
+ Py_DECREF(list);
err = ERR_EXCEPTION;
goto finally;
}
+ Py_DECREF(list);
}
if (PyList_Append(list, value))
err = ERR_EXCEPTION;
@@ -519,6 +521,7 @@ logreader_dealloc(LogReaderObject *self)
fclose(self->logfp);
self->logfp = NULL;
}
+ Py_XDECREF(self->info);
PyObject_Del(self);
}
@@ -795,11 +798,16 @@ get_fileno(ProfilerObject *self, PyCodeObject *fcode)
PyObject *name = PyDict_GetItem(dict, obj);
if (name == NULL) {
if (pack_define_func(self, fileno, fcode->co_firstlineno,
- PyString_AS_STRING(fcode->co_name)) < 0)
+ PyString_AS_STRING(fcode->co_name)) < 0) {
+ Py_DECREF(obj);
return -1;
- if (PyDict_SetItem(dict, obj, fcode->co_name))
+ }
+ if (PyDict_SetItem(dict, obj, fcode->co_name)) {
+ Py_DECREF(obj);
return -1;
+ }
}
+ Py_DECREF(obj);
}
return fileno;
}