summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-11-18 22:45:56 +0100
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-11-18 22:45:56 +0100
commitbdd31dd5e832126b2f22fccbe244a1106c241ab0 (patch)
treeb08a2ad0fad57131563aa8c071221bea241128c1 /src/config.c
parent277b7efe493887081ce1dafd91199d0ee9f676c9 (diff)
parente4c93a392763a006d11e1c1dd01c12f85498dad5 (diff)
downloadlibgit2-error-handling.tar.gz
Merge branch 'development' into error-handlingerror-handling
The code in this branch has been modified so it works with the global state introduced in development.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c
index f53afa145..4e48ff7f4 100644
--- a/src/config.c
+++ b/src/config.c
@@ -35,11 +35,11 @@ void git_config_free(git_config *cfg)
internal = git_vector_get(&cfg->files, i);
file = internal->file;
file->free(file);
- free(internal);
+ git__free(internal);
}
git_vector_free(&cfg->files);
- free(cfg);
+ git__free(cfg);
}
static int config_backend_cmp(const void *a, const void *b)
@@ -61,7 +61,7 @@ int git_config_new(git_config **out)
memset(cfg, 0x0, sizeof(git_config));
if (git_vector_init(&cfg->files, 3, config_backend_cmp) < 0) {
- free(cfg);
+ git__free(cfg);
return GIT_ENOMEM;
}
@@ -125,7 +125,7 @@ int git_config_add_file(git_config *cfg, git_config_file *file, int priority)
internal->priority = priority;
if (git_vector_insert(&cfg->files, internal) < 0) {
- free(internal);
+ git__free(internal);
return GIT_ENOMEM;
}
@@ -366,20 +366,20 @@ static int win32_find_system(char *system_config_path)
return git__throw(GIT_ERROR, "Failed to expand environment strings");
if (_waccess(apphome_utf16, F_OK) < 0) {
- free(apphome_utf16);
+ git__free(apphome_utf16);
return GIT_ENOTFOUND;
}
- apphome_utf8 = conv_utf16_to_utf8(apphome_utf16);
- free(apphome_utf16);
+ apphome_utf8 = gitwin_from_utf16(apphome_utf16);
+ git__free(apphome_utf16);
if (strlen(apphome_utf8) >= GIT_PATH_MAX) {
- free(apphome_utf8);
+ git__free(apphome_utf8);
return git__throw(GIT_ESHORTBUFFER, "Path is too long");
}
strcpy(system_config_path, apphome_utf8);
- free(apphome_utf8);
+ git__free(apphome_utf8);
return GIT_SUCCESS;
}
#endif