diff --git a/mercurial/manifest.c b/mercurial/manifest.c --- a/mercurial/manifest.c +++ b/mercurial/manifest.c @@ -694,6 +694,9 @@ static lazymanifest *lazymanifest_filter goto nomem; } copy = PyObject_New(lazymanifest, &lazymanifestType); + if (!copy) { + goto nomem; + } copy->dirty = true; copy->lines = malloc(self->maxlines * sizeof(line)); if (!copy->lines) {