Commit f78ec441a9df316cfb21a37c00e8147ad74d6827

Stefan Sperling 2018-03-17T03:33:47

fix memleak in test helper function print_tree_object()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/regress/repository/repository_test.c b/regress/repository/repository_test.c
index c986d41..6f6b30c 100644
--- a/regress/repository/repository_test.c
+++ b/regress/repository/repository_test.c
@@ -95,6 +95,7 @@ print_tree_object(struct got_object *obj, char *parent,
 
 		if (!S_ISDIR(te->mode)) {
 			test_printf("%s %s/%s\n", hex, parent, te->name);
+			free(hex);
 			continue;
 		}
 		test_printf("%s %s/%s\n", hex, parent, te->name);
@@ -239,6 +240,7 @@ repo_read_tree(const char *repo_path)
 	got_repo_close(repo);
 	return (err == NULL);
 }
+
 static int
 repo_read_blob(const char *repo_path)
 {