git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alex Riesen" <raa.lkml@gmail.com>
To: "Nicolas Pitre" <nico@cam.org>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: [PATCH] Fix handle leak in builtin-pack-objects
Date: Wed, 19 Nov 2008 12:13:06 +0100	[thread overview]
Message-ID: <81b0412b0811190313p643c0cb4vad620ea942aeea93@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

The opened packs seem to stay open forever.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

I'm very unsure about the solution, though: it is really horrible code
to debug...

 builtin-pack-objects.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-handle-leak-in-builtin-pack-objects.patch --]
[-- Type: text/x-diff; name=0001-Fix-handle-leak-in-builtin-pack-objects.patch, Size: 827 bytes --]

From d0fbfd05e5c1f41f58281d85d68c705c5f036e7d Mon Sep 17 00:00:00 2001
From: Alex Riesen <raa.lkml@gmail.com>
Date: Wed, 19 Nov 2008 11:04:48 +0100
Subject: [PATCH] Fix handle leak in builtin-pack-objects

The opened packs seem to stay open forever.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---
 builtin-pack-objects.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 67eefa2..e68e997 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -532,6 +532,7 @@ static void write_pack_file(void)
 
 			idx_tmp_name = write_idx_file(NULL, written_list,
 						      nr_written, sha1);
+			release_pack_memory(-1, -1);
 
 			snprintf(tmpname, sizeof(tmpname), "%s-%s.pack",
 				 base_name, sha1_to_hex(sha1));
-- 
1.6.0.4.644.gb619a


             reply	other threads:[~2008-11-19 11:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19 11:13 Alex Riesen [this message]
2008-11-19 11:54 ` [PATCH] Fix handle leak in builtin-pack-objects Johannes Sixt
2008-11-19 12:13   ` Alex Riesen
2008-11-19 12:26     ` Johannes Sixt
2008-11-19 12:55   ` Nicolas Pitre
2008-11-19 13:06     ` Johannes Sixt
2008-11-19 14:31       ` Nicolas Pitre
2008-11-19 13:34     ` Alex Riesen
2008-11-19 13:55       ` Johannes Sixt
2008-11-19 14:17         ` Alex Riesen
2008-11-19 14:42         ` Nicolas Pitre
2008-11-19 14:52           ` Johannes Sixt
2008-11-19 16:25             ` [PATCH] compat/mingw.c: Teach mingw_rename() to replace read-only files Johannes Sixt
2008-11-26 13:18           ` [PATCH] Fix handle leak in builtin-pack-objects Alex Riesen
2008-11-26 14:33             ` Nicolas Pitre
2008-11-26 18:43               ` Alex Riesen
2008-12-09 19:26               ` [PATCH] make sure packs to be replaced are closed beforehand Nicolas Pitre
2008-12-09 19:33                 ` Alex Riesen
2008-12-10  7:37                 ` Johannes Sixt
2008-12-10  8:27                   ` Junio C Hamano
2008-12-10  9:36                   ` Alex Riesen
2008-11-19 12:45 ` [PATCH] Fix handle leak in builtin-pack-objects Nicolas Pitre
2008-11-19 13:30   ` Alex Riesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81b0412b0811190313p643c0cb4vad620ea942aeea93@mail.gmail.com \
    --to=raa.lkml@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nico@cam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).