{"thread":{"id":"60560","subject":"[PATCH] column: release strbuf and string_list after use","startedAt":"2023-11-26T11:57:38Z","lastAt":"2023-11-27T12:05:01Z","messageCount":2,"participants":["René Scharfe","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"485157","messageId":"f087137d-a5aa-487e-a1cb-0ad7117b38ed@web.de","threadId":"60560","inReplyTo":null,"subject":"[PATCH] column: release strbuf and string_list after use","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2023-11-26T11:57:36Z","receivedAt":"2023-11-26T11:57:38Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Releasing strbuf and string_list just before exiting is not strictly\nnecessary, but it gets rid of false positives reported by leak checkers,\nwhich can then be more easily used to show that the column-printing\nmachinery behind print_columns() are free of leaks.\n\nSigned-off-by: René Scharfe <l.s.r@web.de>\n---\n builtin/column.c  | 2 ++\n t/t9002-column.sh | 1 +\n 2 files changed, 3 insertions(+)\n\ndiff --git a/builtin/column.c b/builtin/column.c\nindex a83be8bc99..e80218f81f 100644\n--- a/builtin/column.c\n+++ b/builtin/column.c\n@@ -56,5 +56,7 @@ int cmd_column(int argc, const char **argv, const char *prefix)\n \t\tstring_list_append(&list, sb.buf);\n\n \tprint_columns(&list, colopts, &copts);\n+\tstrbuf_release(&sb);\n+\tstring_list_clear(&list, 0);\n \treturn 0;\n }\ndiff --git a/t/t9002-column.sh b/t/t9002-column.sh\nindex 6d3dbde3fe..348cc40658 100755\n--- a/t/t9002-column.sh\n+++ b/t/t9002-column.sh\n@@ -1,6 +1,7 @@\n #!/bin/sh\n\n test_description='git column'\n+TEST_PASSES_SANITIZE_LEAK=true\n . ./test-lib.sh\n\n test_expect_success 'setup' '\n--\n2.43.0\n"},{"id":"485167","messageId":"xmqqr0kb2yhj.fsf@gitster.g","threadId":"60560","inReplyTo":"f087137d-a5aa-487e-a1cb-0ad7117b38ed@web.de","subject":"Re: [PATCH] column: release strbuf and string_list after use","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2023-11-27T12:04:56Z","receivedAt":"2023-11-27T12:05:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Releasing strbuf and string_list just before exiting is not strictly\n> necessary, but it gets rid of false positives reported by leak checkers,\n> which can then be more easily used to show that the column-printing\n> machinery behind print_columns() are free of leaks.\n\nThanks for being careful.  Will queue.\n"}]}