diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-08-14 23:54:47 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-08-14 23:54:47 +0200 |
commit | 4385f8a52d74db55731e8bc02070151eff0fea74 (patch) | |
tree | df2d58dab20eca6bb30e7e6ecd7c18cf571e1706 /convert.c | |
parent | The third batch (diff) | |
parent | commit-reach: fix trivial memory leak when computing reachability (diff) | |
download | git-4385f8a52d74db55731e8bc02070151eff0fea74.tar.xz git-4385f8a52d74db55731e8bc02070151eff0fea74.zip |
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
...
Diffstat (limited to 'convert.c')
-rw-r--r-- | convert.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -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); |