diff --git a/mercurial/cext/manifest.c b/mercurial/cext/manifest.c --- a/mercurial/cext/manifest.c +++ b/mercurial/cext/manifest.c @@ -185,7 +185,7 @@ static void lazymanifest_dealloc(lazyman { /* free any extra lines we had to allocate */ int i; - for (i = 0; i < self->numlines; i++) { + for (i = 0; self->lines && (i < self->numlines); i++) { if (self->lines[i].from_malloc) { free(self->lines[i].start); }