dotcloud/docker — pull request #2265 by alexlarsson (2013-10-17 12:56:09+00:00)
Title: TarFilter: Fix leak of tmpfiles

We were leaking the temporary directory that we create in TarFilter,
because the "tmpDir, err := ioutil.TempDir()" call overrides the
tmpDir in the outer scope with a new locally scoped variable.
This means tmpDir is always "" when the cleanup function is called.

Also, we did not call the atExit() function if CmdStream had an
error early on.

On errors in CmdStream(),