Git development
 help / color / mirror / Atom feed
From: David CARLIER <devnexen@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH] small memory leak fix
Date: Mon, 1 May 2017 21:40:24 +0100	[thread overview]
Message-ID: <C3A43A45-9120-4755-AE42-FD33F68F3FCB@gmail.com> (raw)

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

Hi this is my first submission, a memory leak found in the maint branch (might be in master as well).

Kind regards.

[-- Attachment #2: 0001-memory-leaks-fixes-for-remote-lists.patch --]
[-- Type: application/octet-stream, Size: 820 bytes --]

From d98f3944780730447f111a4178c9d99f5110c260 Mon Sep 17 00:00:00 2001
From: David Carlier <devnexen@gmail.com>
Date: Mon, 1 May 2017 21:14:09 +0100
Subject: [PATCH] memory leaks fixes for remote lists.

both push and fetch lists were not freed thus
using free_refspecs usage.

Signed-off-by: David Carlier <devnexen@gmail.com>
---
 remote.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/remote.c b/remote.c
index 9f83fe2c4..2f8cb35a3 100644
--- a/remote.c
+++ b/remote.c
@@ -742,6 +742,8 @@ int for_each_remote(each_remote_fn fn, void *priv)
 			r->push = parse_push_refspec(r->push_refspec_nr,
 						     r->push_refspec);
 		result = fn(r, priv);
+		free_refspecs(r->push, r->push_refspec_nr);
+		free_refspecs(r->fetch, r->fetch_refspec_nr);
 	}
 	return result;
 }
-- 
2.12.2


             reply	other threads:[~2017-05-01 20:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 20:40 David CARLIER [this message]
2017-05-01 20:50 ` [PATCH] small memory leak fix Stefan Beller
2017-05-01 21:38   ` Jeff King

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=C3A43A45-9120-4755-AE42-FD33F68F3FCB@gmail.com \
    --to=devnexen@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