git: protect against unbalanced calls to {save,restore}_env()
authorJunio C Hamano <gitster@pobox.com>
Wed, 27 Jan 2016 06:50:27 +0000 (22:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Jan 2016 23:19:03 +0000 (15:19 -0800)
We made sure that save_env_before_alias() does not skip saving the
environment when asked to (which led to use-after-free of orig_cwd
in restore_env() in the buggy version) with the previous step.

Protect against future breakage where somebody adds new callers of
these functions in an unbalanced fashion.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found