summaryrefslogtreecommitdiff
path: root/src/config.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-10-28 14:51:13 -0700
committerVicent Marti <tanoku@gmail.com>2011-10-28 19:02:36 -0700
commit3286c408eccb18c525ca123383f3ebf5097441bc (patch)
tree4422fe16ab4f7b9cf713e0209cbb74fb4115889e /src/config.c
parentda37654d04617b4dacce6e7a4796007d2854624d (diff)
downloadlibgit2-3286c408eccb18c525ca123383f3ebf5097441bc.tar.gz
global: Properly use `git__` memory wrappers
Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/config.c b/src/config.c
index ad6f88575..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 = gitwin_from_utf16(apphome_utf16);
- free(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