Message ID | c7bb403ae381b0518b53b93964aad15ba67404d4.1615747662.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
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; }