commit 13cebc62497c5f3b3bfb884c834ebc63ac9be4040bd5dbc4ce1dd586700ba988 from: Kyle Ackerman date: Tue May 6 22:32:33 2025 UTC Plug a memory leak in gitconfig.c conf_parse_line frees *section before allocating a new one, which leaks *section on the last iteration of conf_parse. ok stsp@ commit - 1618ab2f38721012bae2e4bac394f228a9b5aa7a43c584f3304b3ffae8d40686 commit + 13cebc62497c5f3b3bfb884c834ebc63ac9be4040bd5dbc4ce1dd586700ba988 blob - b79066cbf5023f0dc2ca9d96c6578857061623f9eb864945ac2ea2cb645ef5c6 blob + 165f2467d011b026b304401c81b0ec69951fd9d1da216ec39e7dc2267c7fb59d --- lib/gitconfig.c +++ lib/gitconfig.c @@ -306,6 +306,7 @@ conf_parse(struct got_gitconfig *conf, int trans, char } if (cp != line) log_print("conf_parse: last line unterminated, ignored."); + free(section); return NULL; }