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>
Johannes Schindelin committed
May 4, 2017 at 15:57 UTC
1efb1e9a21d16efddd1440bd2684bf19dc9546e0
1 file changed
+2
builtin/fast-export.c
+2
@@ -734,6 +734,7 @@ static void handle_tag(const char *name, struct tag *tag)
734
oid_to_hex(&tag->object.oid));
735
case DROP:
736
/* Ignore this tag altogether */
737
+ free(buf);
738
return;
739
case REWRITE:
740
if (tagged->type != OBJ_COMMIT) {
@@ -765,6 +766,7 @@ static void handle_tag(const char *name, struct tag *tag)
766
(int)(tagger_end - tagger), tagger,
767
tagger == tagger_end ? "" : "\n",
768
(int)message_size, (int)message_size, message ? message : "");
769
+ free(buf);
770
}
771
772
static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)