diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-01-15 11:59:45 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-01-16 21:16:54 +0100 |
commit | 33011e769c2dd3eaa63e5b480e5845c5d370ab13 (patch) | |
tree | 16d5565f7e5482b35158560714ec0cffcd49de10 /trace.c | |
parent | trace: avoid unnecessary quoting (diff) | |
download | git-33011e769c2dd3eaa63e5b480e5845c5d370ab13.tar.xz git-33011e769c2dd3eaa63e5b480e5845c5d370ab13.zip |
trace.c: move strbuf_release() out of print_trace_line()
The function is about printing a trace line, not releasing the buffer it
receives too. Move strbuf_release() back outside. This makes it easier
to see how strbuf is managed.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.c')
-rw-r--r-- | trace.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -131,7 +131,6 @@ static void print_trace_line(struct trace_key *key, struct strbuf *buf) { strbuf_complete_line(buf); trace_write(key, buf->buf, buf->len); - strbuf_release(buf); } static void trace_vprintf_fl(const char *file, int line, struct trace_key *key, @@ -144,6 +143,7 @@ static void trace_vprintf_fl(const char *file, int line, struct trace_key *key, strbuf_vaddf(&buf, format, ap); print_trace_line(key, &buf); + strbuf_release(&buf); } static void trace_argv_vprintf_fl(const char *file, int line, @@ -159,6 +159,7 @@ static void trace_argv_vprintf_fl(const char *file, int line, sq_quote_argv_pretty(&buf, argv); print_trace_line(&trace_default_key, &buf); + strbuf_release(&buf); } void trace_strbuf_fl(const char *file, int line, struct trace_key *key, @@ -171,6 +172,7 @@ void trace_strbuf_fl(const char *file, int line, struct trace_key *key, strbuf_addbuf(&buf, data); print_trace_line(key, &buf); + strbuf_release(&buf); } static void trace_performance_vprintf_fl(const char *file, int line, @@ -190,6 +192,7 @@ static void trace_performance_vprintf_fl(const char *file, int line, } print_trace_line(&trace_perf_key, &buf); + strbuf_release(&buf); } #ifndef HAVE_VARIADIC_MACROS |