Merge branch 'rs/daemon-plug-child-leak'
authorJunio C Hamano <gitster@pobox.com>
Tue, 3 Nov 2015 23:13:11 +0000 (15:13 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Nov 2015 23:13:12 +0000 (15:13 -0800)
"git daemon" uses "run_command()" without "finish_command()", so it
needs to release resources itself, which it forgot to do.

* rs/daemon-plug-child-leak:
daemon: plug memory leak
run-command: factor out child_process_clear()

1  2 
daemon.c
run-command.c
run-command.h
diff --cc daemon.c
Simple merge
diff --cc run-command.c
index e17e456cdaef63d3fa587b8e216bf1fe5c372317,fc391fb9cdd6977e8e40d00d2c6142fb824f99d1..13fa452e8c3d5a5e20e24a969d53ce7ade4019bf
@@@ -539,9 -553,8 +543,8 @@@ fail_pipe
  
  int finish_command(struct child_process *cmd)
  {
 -      int ret = wait_or_whine(cmd->pid, cmd->argv[0]);
 +      int ret = wait_or_whine(cmd->pid, cmd->argv[0], 0);
-       argv_array_clear(&cmd->args);
-       argv_array_clear(&cmd->env_array);
+       child_process_clear(cmd);
        return ret;
  }
  
diff --cc run-command.h
Simple merge