summaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-05-04 13:57:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-08 03:18:20 (GMT)
commit1efb1e9a21d16efddd1440bd2684bf19dc9546e0 (patch)
treedcd6ba3d730df24effeb594eb7f0086a3b62876f /builtin/fast-export.c
parent43e61e715283ba3e6cfe5ebf9e831e1d96cec399 (diff)
downloadgit-1efb1e9a21d16efddd1440bd2684bf19dc9546e0.zip
git-1efb1e9a21d16efddd1440bd2684bf19dc9546e0.tar.gz
git-1efb1e9a21d16efddd1440bd2684bf19dc9546e0.tar.bz2
fast-export: avoid leaking memory in handle_tag()
Reported by, you guessed it, Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index e022063..64617ad 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -734,6 +734,7 @@ static void handle_tag(const char *name, struct tag *tag)
oid_to_hex(&tag->object.oid));
case DROP:
/* Ignore this tag altogether */
+ free(buf);
return;
case REWRITE:
if (tagged->type != OBJ_COMMIT) {
@@ -765,6 +766,7 @@ static void handle_tag(const char *name, struct tag *tag)
(int)(tagger_end - tagger), tagger,
tagger == tagger_end ? "" : "\n",
(int)message_size, (int)message_size, message ? message : "");
+ free(buf);
}
static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)