git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] refs/packed-backend.c: close fd of empty file
@ 2018-05-30 17:03 Stefan Beller
  2018-05-30 17:03 ` [PATCH 2/3] sequencer.c: free author variable when merging fails Stefan Beller
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Stefan Beller @ 2018-05-30 17:03 UTC (permalink / raw)
  To: git; +Cc: Stefan Beller

Signed-off-by: Stefan Beller <sbeller@google.com>
---

This was an oversight in 01caf20d57a (load_contents(): don't try to mmap an
empty file, 2018-01-24).

This and the following 2 patches apply on master.

 refs/packed-backend.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index cec3fb9e00f..d447a731da0 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -499,6 +499,7 @@ static int load_contents(struct snapshot *snapshot)
 	size = xsize_t(st.st_size);
 
 	if (!size) {
+		close(fd);
 		return 0;
 	} else if (mmap_strategy == MMAP_NONE || size <= SMALL_FILE_SIZE) {
 		snapshot->buf = xmalloc(size);
-- 
2.17.1.1185.g55be947832-goog


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-06-01  8:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 17:03 [PATCH 1/3] refs/packed-backend.c: close fd of empty file Stefan Beller
2018-05-30 17:03 ` [PATCH 2/3] sequencer.c: free author variable when merging fails Stefan Beller
2018-05-31 12:04   ` Johannes Schindelin
2018-05-31 18:52     ` Stefan Beller
2018-05-30 17:03 ` [PATCH 3/3] submodule--helper: plug mem leak in print_default_remote Stefan Beller
2018-05-31 12:07   ` Johannes Schindelin
2018-05-31 18:55     ` Stefan Beller
2018-06-01  8:46       ` Johannes Schindelin
2018-05-31  5:15 ` [PATCH 1/3] refs/packed-backend.c: close fd of empty file Jeff King
2018-05-31 11:49 ` Michael Haggerty
2018-05-31 12:06 ` Johannes Schindelin

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).