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:
parent
fe23ad7283
commit
761fcd03aa
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue