From 761fcd03aa71d16225850a797f6a7c67c12800ed Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Mon, 12 Apr 1999 22:51:20 +0000 Subject: [PATCH] Fix accidentally reversed NULL test in load_mark(). Suggested by Tamito Kajiyama. (This caused a bug only on platforms where malloc(0) returns NULL.) --- Modules/cPickle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 614ff06c259..a661c660b04 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));