Skip to content

Commit 1efb1e9

Browse files
dschogitster
authored andcommitted
fast-export: avoid leaking memory in handle_tag()
Reported by, you guessed it, Coverity. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43e61e7 commit 1efb1e9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/fast-export.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,7 @@ static void handle_tag(const char *name, struct tag *tag)
734734
oid_to_hex(&tag->object.oid));
735735
case DROP:
736736
/* Ignore this tag altogether */
737+
free(buf);
737738
return;
738739
case REWRITE:
739740
if (tagged->type != OBJ_COMMIT) {
@@ -765,6 +766,7 @@ static void handle_tag(const char *name, struct tag *tag)
765766
(int)(tagger_end - tagger), tagger,
766767
tagger == tagger_end ? "" : "\n",
767768
(int)message_size, (int)message_size, message ? message : "");
769+
free(buf);
768770
}
769771

770772
static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)

0 commit comments

Comments
 (0)