git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/4] memory leaks in remote.c

From
Jeff King <peff@peff.net>
Date
Jan 19, 2026, 05:18 UTC
Message-ID
<20260119051858.GA1991308@coredump.intra.peff.net>

This fixes some memory leaks in remote.c. Not urgent, as they are quite old, but they are newly triggered in the test suite by Harald's hn/status-compare-with-push topic. So I think we'd want to build that topic on top of these.

The first two are just preparatory cleanups. Patch 3 fixes the leak that Harald's series triggers (and adds its own test, of course). Patch 4 is a hypothetical leak that I don't think can be triggered in practice (so it's more of a cleanup).

  [1/4]: remote: return non-const pointer from error_buf()
  [2/4]: remote: drop const return of tracking_for_push_dest()
  [3/4]: remote: fix leak in branch_get_push_1() with invalid "simple" config
  [4/4]: remote: always allocate branch.push_tracking_ref
 remote.c                | 24 ++++++++++++++----------
 remote.h                |  2 +-
 t/for-each-ref-tests.sh |  9 +++++++++
 3 files changed, 24 insertions(+), 11 deletions(-)
-Peff
Next: Jeff King
Message 1 of 15 in “memory leaks in remote.c”
  1. 0/4 memory leaks in remote.cJeff King, Jan 19, 2026
  2. 1/4 remote: return non-const pointer from error_buf()Jeff King, Jan 19, 2026
  3. Patrick SteinhardtJan 19, 2026
  4. Junio C HamanoJan 20, 2026
  5. Jeff KingJan 20, 2026
  6. Junio C HamanoJan 20, 2026
  7. 2/4 remote: drop const return of tracking_for_push_dest()Jeff King, Jan 19, 2026
  8. Patrick SteinhardtJan 19, 2026
  9. 3/4 remote: fix leak in branch_get_push_1() with invalid "simple" configJeff King, Jan 19, 2026
  10. Patrick SteinhardtJan 19, 2026
  11. 4/4 remote: always allocate branch.push_tracking_refJeff King, Jan 19, 2026
  12. Patrick SteinhardtJan 19, 2026
  13. Triangular workflowHarald Nordgren, Jan 19, 2026
  14. Jeff KingJan 20, 2026
  15. Junio C HamanoJan 20, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.