Message ID | 6af157dfed796508933793f6c4e7453764643fd4.1616345918.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | f63b88867a8f87d7f8442b2dc2deb38c720449bc |
Headers | show |
Series | Fix all leaks in t0001 | expand |
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c index 80237f0df10f..e547a08d6c7c 100644 --- a/builtin/symbolic-ref.c +++ b/builtin/symbolic-ref.c @@ -24,9 +24,11 @@ static int check_symref(const char *HEAD, int quiet, int shorten, int print) return 1; } if (print) { + char *to_free = NULL; if (shorten) - refname = shorten_unambiguous_ref(refname, 0); + refname = to_free = shorten_unambiguous_ref(refname, 0); puts(refname); + free(to_free); } return 0; }