# HG changeset patch # User Josef 'Jeff' Sipek # Date 1528900880 14400 # Node ID 6caca2a7d37f081fdbf86ff2c9c5aadde6713f4d # Parent d9e87566f879697b9ea8c8defbb5871a62f0e49f lazymanifest: don't crash when out of memory (issue5916) self->lines can be NULL if we failed to allocate memory for it. diff -r d9e87566f879 -r 6caca2a7d37f mercurial/cext/manifest.c --- a/mercurial/cext/manifest.c Wed Jun 13 10:37:39 2018 -0400 +++ b/mercurial/cext/manifest.c Wed Jun 13 10:41:20 2018 -0400 @@ -185,7 +185,7 @@ { /* 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); }