mirror of
https://github.com/git/git.git
synced 2025-01-19 05:53:31 +08:00
fsmonitor: avoid memory leak in fsm_settings__get_incompatible_msg()
Reported by Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
8168d5e9c2
commit
5a09991e32
@ -202,11 +202,15 @@ char *fsm_settings__get_incompatible_msg(const struct repository *r,
|
||||
case FSMONITOR_REASON_OK:
|
||||
goto done;
|
||||
|
||||
case FSMONITOR_REASON_BARE:
|
||||
case FSMONITOR_REASON_BARE: {
|
||||
char *cwd = xgetcwd();
|
||||
|
||||
strbuf_addf(&msg,
|
||||
_("bare repository '%s' is incompatible with fsmonitor"),
|
||||
xgetcwd());
|
||||
cwd);
|
||||
free(cwd);
|
||||
goto done;
|
||||
}
|
||||
|
||||
case FSMONITOR_REASON_ERROR:
|
||||
strbuf_addf(&msg,
|
||||
|
Loading…
Reference in New Issue
Block a user