Fix accidentally reversed NULL test in load_mark(). Suggested by

Tamito Kajiyama.  (This caused a bug only on platforms where malloc(0)
returns NULL.)
This commit is contained in:
Guido van Rossum 1999-04-12 22:51:20 +00:00
parent fe23ad7283
commit 761fcd03aa
1 changed files with 1 additions and 1 deletions

View File

@ -3295,7 +3295,7 @@ load_mark(Unpicklerobject *self) {
if ((self->num_marks + 1) >= self->marks_size) { if ((self->num_marks + 1) >= self->marks_size) {
s=self->marks_size+20; s=self->marks_size+20;
if (s <= self->num_marks) s=self->num_marks + 1; if (s <= self->num_marks) s=self->num_marks + 1;
if (self->marks) if (self->marks == NULL)
self->marks=(int *)malloc(s * sizeof(int)); self->marks=(int *)malloc(s * sizeof(int));
else else
self->marks=(int *)realloc(self->marks, s * sizeof(int)); self->marks=(int *)realloc(self->marks, s * sizeof(int));