Commit c53671d0164e8b30ca7a3c4f2ce8d02767ff9e5c

Stefan Sperling 2019-03-15T12:45:56

plug memleak in got_ref_resolve()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/reference.c b/lib/reference.c
index 3dcda2d..5205a7b 100644
--- a/lib/reference.c
+++ b/lib/reference.c
@@ -499,7 +499,7 @@ got_ref_resolve(struct got_object_id **id, struct got_repository *repo,
 		err = resolve_symbolic_ref(&resolved, repo, ref);
 		if (err == NULL)
 			err = got_ref_resolve(id, repo, resolved);
-		free(resolved);
+		got_ref_close(resolved);
 		return err;
 	}