Re: [PATCH v2] revert: plug memory leak in "cherry-pick root commit" codepath

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Aug 16, 2011 at 01:16:33PM -0500, Jonathan Nieder wrote:

>  static struct tree *empty_tree(void)
>  {
> -	struct tree *tree = xcalloc(1, sizeof(struct tree));
> -
> -	tree->object.parsed = 1;
> -	tree->object.type = OBJ_TREE;
> -	pretend_sha1_file(NULL, 0, OBJ_TREE, tree->object.sha1);
> -	return tree;
> +	return lookup_tree((const unsigned char *)EMPTY_TREE_SHA1_BIN);
>  }

Much nicer. But doesn't your dab0d41 (correct type of
EMPTY_TREE_SHA1_BIN, 2011-02-07) make the cast unnecessary?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]