mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 18:38:58 +00:00
Fix mutex init/free in config_file.c
This commit is contained in:
parent
7851e595ad
commit
4af0ef9690
@ -270,7 +270,6 @@ static int config_open(git_config_backend *cfg, git_config_level_t level)
|
|||||||
if ((res = refcounted_strmap_alloc(&b->header.values)) < 0)
|
if ((res = refcounted_strmap_alloc(&b->header.values)) < 0)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
git_mutex_init(&b->header.values_mutex);
|
|
||||||
git_array_init(b->readers);
|
git_array_init(b->readers);
|
||||||
reader = git_array_alloc(b->readers);
|
reader = git_array_alloc(b->readers);
|
||||||
if (!reader) {
|
if (!reader) {
|
||||||
@ -375,6 +374,7 @@ static void backend_free(git_config_backend *_backend)
|
|||||||
|
|
||||||
git__free(backend->file_path);
|
git__free(backend->file_path);
|
||||||
refcounted_strmap_free(backend->header.values);
|
refcounted_strmap_free(backend->header.values);
|
||||||
|
git_mutex_free(&backend->header.values_mutex);
|
||||||
git__free(backend);
|
git__free(backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -686,6 +686,7 @@ int git_config_file__ondisk(git_config_backend **out, const char *path)
|
|||||||
GITERR_CHECK_ALLOC(backend);
|
GITERR_CHECK_ALLOC(backend);
|
||||||
|
|
||||||
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
|
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
|
||||||
|
git_mutex_init(&backend->header.values_mutex);
|
||||||
|
|
||||||
backend->file_path = git__strdup(path);
|
backend->file_path = git__strdup(path);
|
||||||
GITERR_CHECK_ALLOC(backend->file_path);
|
GITERR_CHECK_ALLOC(backend->file_path);
|
||||||
@ -758,6 +759,7 @@ static void backend_readonly_free(git_config_backend *_backend)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
refcounted_strmap_free(backend->header.values);
|
refcounted_strmap_free(backend->header.values);
|
||||||
|
git_mutex_free(&backend->header.values_mutex);
|
||||||
git__free(backend);
|
git__free(backend);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,6 +786,7 @@ int git_config_file__snapshot(git_config_backend **out, diskfile_backend *in)
|
|||||||
GITERR_CHECK_ALLOC(backend);
|
GITERR_CHECK_ALLOC(backend);
|
||||||
|
|
||||||
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
|
backend->header.parent.version = GIT_CONFIG_BACKEND_VERSION;
|
||||||
|
git_mutex_init(&backend->header.values_mutex);
|
||||||
|
|
||||||
backend->snapshot_from = in;
|
backend->snapshot_from = in;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user