Commit 1960a6f9da8b811e074a153918a02e69c8a8d885

Stefan Sperling 2018-07-12T23:56:25

don't leak objects in tog blame view

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/tog/tog.c b/tog/tog.c
index 00d4671..e5ddd90 100644
--- a/tog/tog.c
+++ b/tog/tog.c
@@ -1595,6 +1595,12 @@ show_blame_view(const char *path, struct got_object_id *commit_id,
 				if (thread_err)
 					break;
 				id = got_object_get_id(ch == 'b' ? obj : pobj);
+				got_object_close(obj);
+				obj = NULL;
+				if (pobj) {
+					got_object_close(pobj);
+					obj = NULL;
+				}
 				if (id == NULL) {
 					err = got_error_from_errno();
 					break;