git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Stefan Beller <sbeller@google.com>
To: gitster@pobox.com, peff@peff.net
Cc: git@vger.kernel.org, Stefan Beller <sbeller@google.com>
Subject: [PATCH v2 4/4] replace-object.c: remove the_repository from prepare_replace_object
Date: Thu, 10 May 2018 12:58:49 -0700	[thread overview]
Message-ID: <20180510195849.28023-5-sbeller@google.com> (raw)
In-Reply-To: <20180510195849.28023-1-sbeller@google.com>

This was missed in 5982da9d2ce (replace-object: allow
prepare_replace_object to handle arbitrary repositories, 2018-04-11)

Technically the code works correctly as the replace_map is the same
size in different repositories, however it is hard to read. So convert
the code to the familiar pattern of dereferencing the pointer that we
assign in the sizeof itself.

Signed-off-by: Stefan Beller <sbeller@google.com>
---
 replace-object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/replace-object.c b/replace-object.c
index 246b98cd4f1..801b5c16789 100644
--- a/replace-object.c
+++ b/replace-object.c
@@ -37,7 +37,7 @@ static void prepare_replace_object(struct repository *r)
 		return;
 
 	r->objects->replace_map =
-		xmalloc(sizeof(*the_repository->objects->replace_map));
+		xmalloc(sizeof(*r->objects->replace_map));
 	oidmap_init(r->objects->replace_map, 0);
 
 	for_each_replace_ref(r, register_replace_ref, NULL);
-- 
2.17.0.255.g8bfb7c0704


  parent reply	other threads:[~2018-05-10 19:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-10 19:58 [PATCH v2 0/4] Fix mem leaks of recent object store conversions Stefan Beller
2018-05-10 19:58 ` [PATCH v2 1/4] packfile: close and free packs upon releasing an object store Stefan Beller
2018-05-10 19:58 ` [PATCH v2 2/4] packfile.h: remove all extern keywords Stefan Beller
2018-05-10 19:58 ` [PATCH v2 3/4] object.c: free replace map in raw_object_store_clear Stefan Beller
2018-05-10 19:58 ` Stefan Beller [this message]
2018-05-11  8:37 ` [PATCH v2 0/4] Fix mem leaks of recent object store conversions Jeff King
2018-05-11 18:59   ` Stefan Beller

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=20180510195849.28023-5-sbeller@google.com \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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).