Thread (151 messages) 151 messages, 6 authors, 2017-05-11
STALE3336d
Revisions (4)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
  4. v4 [diff vs current]

[PATCH v3 10/25] cat-file: fix memory leak

From: Johannes Schindelin <hidden>
Date: 2017-05-02 16:02:16
Subsystem: the rest · Maintainer: Linus Torvalds

Discovered by Coverity.

Signed-off-by: Johannes Schindelin <redacted>
---
 builtin/cat-file.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 1890d7a6390..9af863e7915 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -165,6 +165,7 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
 		die("git cat-file %s: bad file", obj_name);
 
 	write_or_die(1, buf, size);
+	free(buf);
 	return 0;
 }
 
-- 
2.12.2.windows.2.800.gede8f145e06

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