aboutsummaryrefslogtreecommitdiff
path: root/remote.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-30 11:14:21 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-30 11:23:08 -0700
commita6c30623d77b5fe759d5d9bedc33957ddaff1b4d (patch)
tree8a06803ec667d75651e7de84d0f9f0665ba16c54 /remote.h
parent12f0fb953891940598486bdbe8edd28b05b38278 (diff)
downloadgit-a6c30623d77b5fe759d5d9bedc33957ddaff1b4d.tar.xz
remote: fix leaking push reports
The push reports that report failures to the user when pushing a reference leak in several places. Plug these leaks by introducing a new function `ref_push_report_free()` that frees the list of reports and call it as required. While at it, fix a trivially leaking error string in the vicinity. These leaks get hit in t5411, but plugging them does not make the whole test suite pass. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.h')
-rw-r--r--remote.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/remote.h b/remote.h
index ad4513f639..c5e79eb40e 100644
--- a/remote.h
+++ b/remote.h
@@ -126,13 +126,15 @@ int remote_has_url(struct remote *remote, const char *url);
struct strvec *push_url_of_remote(struct remote *remote);
struct ref_push_report {
- const char *ref_name;
+ char *ref_name;
struct object_id *old_oid;
struct object_id *new_oid;
unsigned int forced_update:1;
struct ref_push_report *next;
};
+void ref_push_report_free(struct ref_push_report *);
+
struct ref {
struct ref *next;
struct object_id old_oid;