summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 64dfa91..d5b4cde 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -1525,9 +1525,11 @@ hotshot_profiler(PyObject *unused, PyObject *args)
calibrate();
calibrate();
}
- if (write_header(self))
+ if (write_header(self)) {
/* some error occurred, exception has been set */
+ Py_DECREF(self);
self = NULL;
+ }
}
return (PyObject *) self;
}