зеркало из https://github.com/microsoft/git.git
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:
Родитель
8168d5e9c2
Коммит
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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче