get_helper: use run-command's internal argv_array
commite0ab2ac6c553cbba5d0275cfd35beb3351cae034
authorJeff King <peff@peff.net>
Thu, 15 May 2014 08:34:18 +0000 (15 04:34 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 15 May 2014 16:49:11 +0000 (15 09:49 -0700)
tree0ef63c5251d93f9b6760d5ff84a0fde46875e003
parent1823bea10fceb371c7876e598d2413c85890cafc
get_helper: use run-command's internal argv_array

The get_helper functions dynamically allocates an
argv_array, feeds it to start_command, and then returns. We
then have to later clean up the memory manually after
calling finish_command. We can make this simpler by just
using run-command's internal argv_array, which handles
cleanup for us.

This also prevents a memory leak in the case that
transport_take_over is used, in which case we free the child
in finish_connect, which does not manually free the array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
transport-helper.c