This is an archive of the discontinued Mercurial Phabricator instance.

cext: refactor cleanup code in bdiff()
ClosedPublic

Authored by indygreg on Mar 3 2018, 11:28 AM.

Details

Summary

A future commit will need to introduce additional cleanup code.

We refactor the cleanup code to check NULL before calling free().
We also initialize these variables as NULL.

We set the out of memory exception explicitly, so we can just return
result.

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

indygreg created this revision.Mar 3 2018, 11:28 AM
yuja accepted this revision.Mar 3 2018, 3:02 PM
This revision is now accepted and ready to land.Mar 3 2018, 3:02 PM
This revision was automatically updated to reflect the committed changes.
yuja added a comment.Mar 3 2018, 3:16 PM

Queued, thanks.

mercurial/cext/bdiff.c
148

Nit: these "if"s aren't necessary