This is an archive of the discontinued Mercurial Phabricator instance.

revlog: remove side effect from failed nt_init()
ClosedPublic

Authored by martinvonz on Aug 1 2018, 3:01 PM.

Details

Summary

If nt_init() successfully allocates memory for the node tree but then
runs out of memory while trying to insert nullid into it, it will
leave the node tree pointer set on the index object. That means that
future node tree operations will think that the tree is properly
initialized. It seems very unlikely to make a difference in practice
(if nt_init() runs out of memory, not much else will probably work),
but since I spotted it, I figured I might as well fix it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

martinvonz created this revision.Aug 1 2018, 3:01 PM
This revision was automatically updated to reflect the committed changes.