Thread (151 messages) 151 messages, 6 authors, 2017-05-11

Re: [PATCH 18/26] fast-export: avoid leaking memory in handle_tag()

From: Johannes Sixt <hidden>
Date: 2017-04-27 16:39:17

Am 26.04.2017 um 22:21 schrieb Johannes Schindelin:
quoted hunk ↗ jump to hunk
Reported by, you guessed it, Coverity.

Signed-off-by: Johannes Schindelin <redacted>
---
 builtin/fast-export.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index e0220630d00..828d41c0c11 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -765,6 +765,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)
There is an early return in the function that is not covered by this 
patch. Look for "case DROP".

-- Hannes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help