summaryrefslogtreecommitdiff
path: root/git-gui/lib/commit.tcl
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-06-14 06:26:16 -0400
committerJunio C Hamano <gitster@pobox.com>2024-06-14 09:34:37 -0700
commitaa0595fbd635bc2d16a4921244cf2bc94ca7761e (patch)
tree8511784f4fbc9375382a23fd4068cd6655a9ade4 /git-gui/lib/commit.tcl
parent0295ce7cbf0d2b3b71f44d9dc84ae8db1e895a99 (diff)
remote: refactor alias_url() memory ownership
The alias_url() function may return either a newly allocated string (which the caller must take ownership of), or the original const "url" parameter that was passed in. This often works OK because callers are generally passing in a "url" that they expect to retain ownership of anyway. So whether we got back the original or a new string, we're always interested in storing it forever. But I suspect there are some possible leaks here (e.g., add_url_alias() may end up discarding the original "url"). Whether there are active leaks or not, this is a confusing setup that makes further refactoring of memory ownership harder. So instead of returning the original string, return NULL, forcing callers to decide what to do with it explicitly. We can then build further cleanups on top of that. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-gui/lib/commit.tcl')
0 files changed, 0 insertions, 0 deletions