git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ammon Riley <ammon.riley@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] Fix minor memory leak in init-db
Date: Thu, 14 May 2009 15:22:24 -0700	[thread overview]
Message-ID: <cd3664ac0905141522s3ad78411o9f015d2e7720c8b5@mail.gmail.com> (raw)

There was an xmalloc() for path, but I didn't see a corresponding free().
Does it happen somewhere else that I'm not expecting?

Signed-off-by: Ammon Riley <ammon.riley@gmail.com>
---
 builtin-init-db.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/builtin-init-db.c b/builtin-init-db.c
index d1fa12a..6969987 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -308,6 +308,8 @@ int init_db(const char *template_dir, unsigned int flags)
 	strcpy(path+len, "/info");
 	safe_create_dir(path, 1);

+	free(path);
+
 	if (shared_repository) {
 		char buf[10];
 		/* We do not spell "group" and such, so that
-- 
1.6.3.1.9.g95405b.dirty

             reply	other threads:[~2009-05-14 22:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 22:22 Ammon Riley [this message]
2009-05-16 19:56 ` [PATCH] Fix minor memory leak in init-db Junio C Hamano
2009-05-17  4:07   ` Ammon Riley
2009-05-17  5:13     ` Junio C Hamano
2009-05-17 16:09       ` Ammon Riley

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=cd3664ac0905141522s3ad78411o9f015d2e7720c8b5@mail.gmail.com \
    --to=ammon.riley@gmail.com \
    --cc=git@vger.kernel.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).