diff options
author | Armin Rigo <arigo@tunes.org> | 2004-08-03 09:02:32 +0000 |
---|---|---|
committer | Armin Rigo <arigo@tunes.org> | 2004-08-03 09:02:32 +0000 |
commit | 09f9565f36fbdaafcc7024519df666caf11900ea (patch) | |
tree | f5b9f4a26b743aa10864a1c8e5760dd76a9f29cc /Modules/_hotshot.c | |
parent | be73439f5dba7546b988cccc56be886c53c3b91f (diff) | |
download | cpython-git-09f9565f36fbdaafcc7024519df666caf11900ea.tar.gz |
back-ported SF bug #808756: refleaks
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r-- | Modules/_hotshot.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c index da68970095..1f347250cd 100644 --- a/Modules/_hotshot.c +++ b/Modules/_hotshot.c @@ -351,9 +351,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; @@ -523,6 +525,7 @@ logreader_dealloc(LogReaderObject *self) fclose(self->logfp); self->logfp = NULL; } + Py_XDECREF(self->info); PyObject_Del(self); } @@ -799,11 +802,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; } |