Make sure not to call realloc() with a NULL pointer -- call malloc()
in that case.  Tamito Kajiyama.
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index a73a787..d259471 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -3275,7 +3275,10 @@
     if ((self->num_marks + 1) >= self->marks_size) {
         s=self->marks_size+20;
         if (s <= self->num_marks) s=self->num_marks + 1;
-        self->marks =(int *)realloc(self->marks, s * sizeof(int));
+        if (self->marks)
+            self->marks=(int *)malloc(s * sizeof(int));
+        else
+            self->marks=(int *)realloc(self->marks, s * sizeof(int));
         if (! self->marks) {
             PyErr_NoMemory();
             return -1;