http.c: fix an invalid free()
authorTay Ray Chuan <rctay89@gmail.com>
Wed, 3 Aug 2011 11:54:03 +0000 (19:54 +0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Aug 2011 18:23:09 +0000 (11:23 -0700)
commitec99c9a89a65749093e16aed37d393f646597b31
tree4b5457300e261960a65d5bb883db933aaa566249
parentb586744a864cf4d6886d6436d559302123b01fae
http.c: fix an invalid free()

Remove a free() on the static buffer returned by sha1_file_name().

While we're at it, replace xmalloc() calls on the structs
http_(object|pack)_request with xcalloc() so that pointers in the
structs get initialized to NULL. That way, free()'s are safe - for
example, a free() on the url string member when aborting.

This fixes an invalid free().

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Helped-by: Jeff King peff@peff.net
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
http.c