summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-04-12 22:51:20 (GMT)
committerGuido van Rossum <guido@python.org>1999-04-12 22:51:20 (GMT)
commit761fcd03aa71d16225850a797f6a7c67c12800ed (patch)
tree90af6eacaa907fb8617aa8413044e377fcd2a979 /Modules
parentfe23ad72833f2106f7056037778ebebc3023553d (diff)
downloadcpython-761fcd03aa71d16225850a797f6a7c67c12800ed.zip
cpython-761fcd03aa71d16225850a797f6a7c67c12800ed.tar.gz
cpython-761fcd03aa71d16225850a797f6a7c67c12800ed.tar.bz2
Fix accidentally reversed NULL test in load_mark(). Suggested by
Tamito Kajiyama. (This caused a bug only on platforms where malloc(0) returns NULL.)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 614ff06..a661c66 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -3295,7 +3295,7 @@ load_mark(Unpicklerobject *self) {
if ((self->num_marks + 1) >= self->marks_size) {
s=self->marks_size+20;
if (s <= self->num_marks) s=self->num_marks + 1;
- if (self->marks)
+ if (self->marks == NULL)
self->marks=(int *)malloc(s * sizeof(int));
else
self->marks=(int *)realloc(self->marks, s * sizeof(int));