]> git.ipfire.org Git - thirdparty/git.git/commit
fsmonitor: fix leak of warning message
authorJeff King <peff@peff.net>
Tue, 11 Oct 2022 00:42:38 +0000 (20:42 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 11 Oct 2022 05:16:56 +0000 (22:16 -0700)
commitc4f94907902f18d80a78ee19983d0d02932154d7
tree3326c34d8419294b1689fd83172e28af6b9e825d
parent5aa9e3262e6ac99c1c06d7f0e0619b1ea94a9881
fsmonitor: fix leak of warning message

The fsm_settings__get_incompatible_msg() function returns an allocated
string.  So we can't pass its result directly to warning(); we must hold
on to the pointer and free it to avoid a leak.

The leak here is small and fixed size, but Coverity complained, and
presumably SANITIZE=leaks would eventually.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c