summaryrefslogtreecommitdiffstats
path: root/Modules/_hotshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_hotshot.c')
-rw-r--r--Modules/_hotshot.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_hotshot.c b/Modules/_hotshot.c
index 6d9776f..21bd383 100644
--- a/Modules/_hotshot.c
+++ b/Modules/_hotshot.c
@@ -313,6 +313,11 @@ unpack_string(LogReaderObject *self, PyObject **pvalue)
return err;
buf = (char *)malloc(len);
+ if (!buf) {
+ PyErr_NoMemory();
+ return ERR_EXCEPTION;
+ }
+
for (i=0; i < len; i++) {
ch = fgetc(self->logfp);
buf[i] = ch;