]> Kevux Git Server - rit/commit
builtin/credential-cache: fix trivial leaks
authorPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2024 10:40:51 +0000 (12:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Aug 2024 15:47:37 +0000 (08:47 -0700)
commit145c9790207b9847b609d997c86c7cf8cec043b2
tree03e488bc1b1f07d3b53518b68877dccb27d3da72
parentcd6d7630fa51ad16afa010c6619870cab6c6faba
builtin/credential-cache: fix trivial leaks

There are two trivial leaks in git-credential-cache(1):

  - We leak the child process in `spawn_daemon()`. As we do not call
    `finish_command()` and instead let the created process daemonize, we
    have to clear the process manually.

  - We do not free the computed socket path in case it wasn't given via
    `--socket=`.

Plug both of these memory leaks.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/credential-cache.c
t/t0301-credential-cache.sh