1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-10 07:16:09 +02:00

Merge branch 'rs/daemon-plug-leak'

Plug a memory leak.

* rs/daemon-plug-leak:
  daemon: plug memory leak on overlong path
This commit is contained in:
Junio C Hamano 2022-01-05 14:01:31 -08:00
commit 9afe4d9f6b

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;