aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-09-24 21:17:15 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-09-24 21:17:15 -0400
commit641c6420e146aee1d2c3e75439c3efc5777a6845 (patch)
tree92c384f25736725ced7edd3761268c0c75ca3105 /src
parentef5ee31452d60bdf3d904f8289ab805f003cffa7 (diff)
parent2c6f74d6d67208389a431aa5599b15899c16741a (diff)
downloadrneovim-641c6420e146aee1d2c3e75439c3efc5777a6845.tar.gz
rneovim-641c6420e146aee1d2c3e75439c3efc5777a6845.tar.bz2
rneovim-641c6420e146aee1d2c3e75439c3efc5777a6845.zip
Merge pull request #3384 from equalsraf/tb-vla
Remove VLA from path_get_absolute_path
Diffstat (limited to 'src')
-rw-r--r--src/nvim/path.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nvim/path.c b/src/nvim/path.c
index 45ae12b78a..a9d1d052d4 100644
--- a/src/nvim/path.c
+++ b/src/nvim/path.c
@@ -2083,7 +2083,7 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, int len, int
char_u *p;
*buf = NUL;
- char relative_directory[len];
+ char *relative_directory = xmalloc(len);
char *end_of_path = (char *) fname;
// expand it if forced or not an absolute path
@@ -2105,9 +2105,11 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, int len, int
}
if (FAIL == path_full_dir_name(relative_directory, (char *) buf, len)) {
+ xfree(relative_directory);
return FAIL;
}
}
+ xfree(relative_directory);
return append_path((char *)buf, end_of_path, len);
}