git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: Jared Hance <jaredhance@gmail.com>
Subject: [PATCH 2/2] apply: free patch->result
Date: Wed, 21 Mar 2012 15:21:32 -0700	[thread overview]
Message-ID: <7vwr6dzjbn.fsf_-_@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7v1uol1tud.fsf_-_@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Wed, 21 Mar 2012 15:18:18 -0700")

This is by far the largest piece of data, much larger than the patch and
fragment structures or the three name fields in the patch structure.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
I have not finished auditing all the codepaths, so this change needs to be
eyeballed carefully. We may be pointing an unfreeable piece of memory or a
piece of memory that belong to other structures that are going to be freed
otherwise.

 builtin/apply.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/builtin/apply.c b/builtin/apply.c
index 5d03e50..c919db3 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -212,6 +212,7 @@ static void free_patch(struct patch *patch)
 		free(patch->def_name);
 		free(patch->old_name);
 		free(patch->new_name);
+		free(patch->result);
 		free(patch);
 		patch = patch_next;
 	}
-- 
1.7.10.rc1.76.g1a8310

  reply	other threads:[~2012-03-21 22:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 22:21 [PATCH v3 0/3] Fix documented fixme's throughout Jared Hance
2012-03-07 22:21 ` [PATCH v3 1/3] Fix memory leak in apply_patch in apply.c Jared Hance
2012-03-07 23:39   ` Junio C Hamano
2012-03-21 22:18   ` [PATCH 1/2] apply: free patch->{def,old,new}_name fields Junio C Hamano
2012-03-21 22:21     ` Junio C Hamano [this message]
2012-03-07 22:21 ` [PATCH v3 2/3] Add threaded versions of functions in symlinks.c Jared Hance
2012-03-07 23:39   ` Junio C Hamano
2012-03-07 22:21 ` [PATCH v3 3/3] Use startup_info->prefix rather than prefix Jared Hance
2012-03-07 23:39   ` Junio C Hamano

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=7vwr6dzjbn.fsf_-_@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaredhance@gmail.com \
    /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).