diff options
Diffstat (limited to 'builtin/ls-files.c')
| -rw-r--r-- | builtin/ls-files.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index a03b559eca..26e309f533 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -89,12 +89,15 @@ static void write_name(const char *name) static void write_name_to_buf(struct strbuf *sb, const char *name) { - const char *rel = relative_path(name, prefix_len ? prefix : NULL, sb); + struct strbuf buf = STRBUF_INIT; + const char *rel = relative_path(name, prefix_len ? prefix : NULL, &buf); if (line_terminator) quote_c_style(rel, sb, NULL, 0); else strbuf_addstr(sb, rel); + + strbuf_release(&buf); } static const char *get_tag(const struct cache_entry *ce, const char *tag) |
