Commit 761fcd03 authored by Guido van Rossum's avatar Guido van Rossum

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

Tamito Kajiyama.  (This caused a bug only on platforms where malloc(0)
returns NULL.)
parent fe23ad72
......@@ -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));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment