Browse Source

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>
maint
Johannes Schindelin 3 years ago committed by Junio C Hamano
parent
commit
5a09991e32
  1. 8
      fsmonitor-settings.c

8
fsmonitor-settings.c

@ -202,11 +202,15 @@ char *fsm_settings__get_incompatible_msg(const struct repository *r, @@ -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…
Cancel
Save