stdpaths,main: Remove all remaining memory leaks

This commit is contained in:
ZyX
2015-10-17 15:32:11 +03:00
parent 0a59c969cc
commit 502a20a8fe
3 changed files with 52 additions and 11 deletions

View File

@@ -59,7 +59,7 @@ static char *get_xdg_home(const XDGVarType idx)
{
char *dir = stdpaths_get_xdg_var(idx);
if (dir) {
dir = concat_fnames(dir, "nvim", true);
dir = concat_fnames_realloc(dir, "nvim", true);
}
return dir;
}
@@ -77,13 +77,13 @@ static void create_dir(const char *dir, int mode, const char *suffix)
char *stdpaths_user_conf_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
return concat_fnames(get_xdg_home(kXDGConfigHome), fname, true);
return concat_fnames_realloc(get_xdg_home(kXDGConfigHome), fname, true);
}
char *stdpaths_user_data_subpath(const char *fname)
FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL
{
char *dir = concat_fnames(get_xdg_home(kXDGDataHome), fname, true);
char *dir = concat_fnames_realloc(get_xdg_home(kXDGDataHome), fname, true);
if (!os_isdir((char_u *)dir)) {
create_dir(dir, 0755, fname);
}