Merge branch 'rs/daemon-plug-leak'

Plug a memory leak.

* rs/daemon-plug-leak:
  daemon: plug memory leak on overlong path
maint
Junio C Hamano 2022-01-05 14:01:31 -08:00
commit 9afe4d9f6b
1 changed files with 1 additions and 1 deletions

View File

@ -232,13 +232,13 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)

rlen = strlcpy(interp_path, expanded_path.buf,
sizeof(interp_path));
strbuf_release(&expanded_path);
if (rlen >= sizeof(interp_path)) {
logerror("interpolated path too large: %s",
interp_path);
return NULL;
}

strbuf_release(&expanded_path);
loginfo("Interpolated dir '%s'", interp_path);

dir = interp_path;