summaryrefslogtreecommitdiff
path: root/gitweb/static/js/lib/common-lib.js
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-22 11:17:58 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-22 09:18:06 -0700
commit5e9e04a0641a933fd2da62139795ef6fd322835a (patch)
treef9acb76ab9579d80842e7fa38f43ba48060d4ef2 /gitweb/static/js/lib/common-lib.js
parentf5ccb535ccfbabd55c2c7ab0b8e36ca5f322d31f (diff)
remote: fix leaks when matching refspecs
In `match_explicit()`, we try to match a source ref with a destination ref according to a refspec item. This matching sometimes requires us to allocate a new source spec so that it looks like we expect. And while we in some end up assigning this allocated ref as `peer_ref`, which hands over ownership of it to the caller, in other cases we don't. We neither free it though, causing a memory leak. Fix the leak by creating a common exit path where we can easily free the source ref in case it is allocated and hasn't been handed over to the caller. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/static/js/lib/common-lib.js')
0 files changed, 0 insertions, 0 deletions