Re: [PATCH 5/6] bundle: don't leak an fd in case of early return

2016-03-30 Thread Junio C Hamano
Jeff King writes: >> +if (compute_and_write_prerequisites(bundle_fd, &revs, argc, argv)) { >> +if (!bundle_to_stdout) >> +close(bundle_fd); >> return -1; >> +} > > Makes sense. Should we also be rolling back the lock file? It happens > automati

Re: [PATCH 5/6] bundle: don't leak an fd in case of early return

2016-03-29 Thread Jeff King
On Tue, Mar 29, 2016 at 05:38:52PM -0700, Stefan Beller wrote: > In successful operation `write_pack_data` will close the `bundle_fd`, > but when we exit early, we need to take care of the file descriptor > ourselves. > > Signed-off-by: Stefan Beller > --- > bundle.c | 10 -- > 1 file c

[PATCH 5/6] bundle: don't leak an fd in case of early return

2016-03-29 Thread Stefan Beller
In successful operation `write_pack_data` will close the `bundle_fd`, but when we exit early, we need to take care of the file descriptor ourselves. Signed-off-by: Stefan Beller --- bundle.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bundle.c b/bundle.c index