Merge branch 'ps/leakfixes-part-3'

More leakfixes.

* ps/leakfixes-part-3: (24 commits)
  commit-reach: fix trivial memory leak when computing reachability
  convert: fix leaking config strings
  entry: fix leaking pathnames during delayed checkout
  object-name: fix leaking commit list items
  t/test-repository: fix leaking repository
  builtin/credential-cache: fix trivial leaks
  builtin/worktree: fix leaking derived branch names
  builtin/shortlog: fix various trivial memory leaks
  builtin/rerere: fix various trivial memory leaks
  builtin/credential-store: fix leaking credential
  builtin/show-branch: fix several memory leaks
  builtin/rev-parse: fix memory leak with `--parseopt`
  builtin/stash: fix various trivial memory leaks
  builtin/remote: fix various trivial memory leaks
  builtin/remote: fix leaking strings in `branch_list`
  builtin/ls-remote: fix leaking `pattern` strings
  builtin/submodule--helper: fix leaking buffer in `is_tip_reachable`
  builtin/submodule--helper: fix leaking clone depth parameter
  builtin/name-rev: fix various trivial memory leaks
  builtin/describe: fix trivial memory leak when describing blob
  ...
This commit is contained in:
Junio C Hamano
2024-08-14 14:54:47 -07:00
57 changed files with 256 additions and 88 deletions

View File

@@ -963,7 +963,7 @@ int async_query_available_blobs(const char *cmd, struct string_list *available_p
while ((line = packet_read_line(process->out, NULL))) {
const char *path;
if (skip_prefix(line, "pathname=", &path))
string_list_insert(available_paths, xstrdup(path));
string_list_insert(available_paths, path);
else
; /* ignore unknown keys */
}
@@ -1053,14 +1053,20 @@ static int read_convert_config(const char *var, const char *value,
* The command-line will not be interpolated in any way.
*/
if (!strcmp("smudge", key))
if (!strcmp("smudge", key)) {
FREE_AND_NULL(drv->smudge);
return git_config_string(&drv->smudge, var, value);
}
if (!strcmp("clean", key))
if (!strcmp("clean", key)) {
FREE_AND_NULL(drv->clean);
return git_config_string(&drv->clean, var, value);
}
if (!strcmp("process", key))
if (!strcmp("process", key)) {
FREE_AND_NULL(drv->process);
return git_config_string(&drv->process, var, value);
}
if (!strcmp("required", key)) {
drv->required = git_config_bool(var, value);