GIT_INLINE(bool) valid_filemode(const int filemode)
{
	return (is_file_or_link(filemode) || filemode == GIT_FILEMODE_COMMIT);
}

The product calls free() twice on the same memory address, potentially leading to modification of unexpected memory locations.