From: Nicolas Pitre <nico@cam.org>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: [PATCH 6/6] fix for more minor memory leaks
Date: Tue, 16 Oct 2007 21:55:50 -0400 [thread overview]
Message-ID: <1192586150-13743-7-git-send-email-nico@cam.org> (raw)
In-Reply-To: <1192586150-13743-6-git-send-email-nico@cam.org>
Now that some pointers have lost their const attribute, we can free their
associated memory when done with them. This is more a correctness issue
about the rule for freeing those pointers which isn't completely trivial
more than the leak itself which didn't matter as the program is
exiting anyway.
Signed-off-by: Nicolas Pitre <nico@cam.org>
---
index-pack.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/index-pack.c b/index-pack.c
index 60173d5..2f149a4 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -815,6 +815,10 @@ int main(int argc, char **argv)
free(objects);
free(index_name_buf);
free(keep_name_buf);
+ if (pack_name == NULL)
+ free(curr_pack);
+ if (index_name == NULL)
+ free(curr_index);
return 0;
}
--
1.5.3.4.1212.gdb015
next prev parent reply other threads:[~2007-10-17 1:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-17 1:55 [PATCH 0/6] miscelaneous stuff Nicolas Pitre
2007-10-17 1:55 ` [PATCH 1/6] more compact progress display Nicolas Pitre
2007-10-17 1:55 ` [PATCH 2/6] cope with multiple line breaks within sideband progress messages Nicolas Pitre
2007-10-17 1:55 ` [PATCH 3/6] pack-objects: no delta possible with only one object in the list Nicolas Pitre
2007-10-17 1:55 ` [PATCH 4/6] pack-objects.c: fix some global variable abuse and memory leaks Nicolas Pitre
2007-10-17 1:55 ` [PATCH 5/6] fix const issues with some functions Nicolas Pitre
2007-10-17 1:55 ` Nicolas Pitre [this message]
2007-10-17 2:15 ` Deltifying? (was [PATCH 3/6] pack-objects: no delta possible...) Shawn O. Pearce
2007-10-17 2:28 ` Nicolas Pitre
2007-10-17 2:11 ` [PATCH 1/6] more compact progress display Shawn O. Pearce
2007-10-17 2:24 ` Nicolas Pitre
2007-10-17 8:20 ` Karl Hasselström
2007-10-17 20:56 ` Nicolas Pitre
2007-10-18 4:58 ` Shawn O. Pearce
2007-10-18 8:34 ` Karl Hasselström
2007-10-17 6:34 ` Johannes Sixt
2007-10-17 6:37 ` Shawn O. Pearce
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1192586150-13743-7-git-send-email-nico@cam.org \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=spearce@spearce.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.
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).