load_subtree(): check earlier whether an internal node is a tree entry
commit4d589b87e857015b4f78e47353f87d4aa717b1a0
authorMichael Haggerty <mhagger@alum.mit.edu>
Sat, 26 Aug 2017 08:28:06 +0000 (26 10:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 26 Aug 2017 16:21:01 +0000 (26 09:21 -0700)
tree852bf6b013f08f272d31657772012487a3124b7b
parent98c9897d9e40f49cfb416801851656bac494ae40
load_subtree(): check earlier whether an internal node is a tree entry

If an entry is not a tree entry, then it cannot possibly be an
internal node. But the old code checked this condition only after
allocating a leaf_node object and therefore leaked that memory.
Instead, check before even entering this branch of the code.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
notes.c