diff -r d6aa1a8c8d7c -r ca2d4080a02e mercurial/manifest.c --- a/mercurial/manifest.c Thu Dec 31 13:44:59 2015 -0500 +++ b/mercurial/manifest.c Thu Dec 31 13:45:48 2015 -0500 @@ -694,6 +694,9 @@ goto nomem; } copy = PyObject_New(lazymanifest, &lazymanifestType); + if (!copy) { + goto nomem; + } copy->dirty = true; copy->lines = malloc(self->maxlines * sizeof(line)); if (!copy->lines) {