--- a/mercurial/cext/revlog.c Wed Aug 08 21:52:39 2018 -0700
+++ b/mercurial/cext/revlog.c Wed Aug 08 22:26:57 2018 -0700
@@ -1075,10 +1075,6 @@
return -1;
}
self->length = 1;
- if (nt_insert(self, nullid, -1) == -1) {
- free(self->nodes);
- return -1;
- }
return 0;
}
@@ -1152,6 +1148,11 @@
self->nt = NULL;
return -1;
}
+ if (nt_insert(self->nt, nullid, -1) == -1) {
+ PyMem_Free(self->nt);
+ self->nt = NULL;
+ return -1;
+ }
self->ntrev = (int)index_length(self);
self->ntlookups = 1;
self->ntmisses = 0;