aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2015-09-10 20:52:25 -0400
committerJustin M. Keyes <justinkz@gmail.com>2015-09-10 20:52:25 -0400
commitb762e809e40271ad8cad13995a1f0cbdabc10f33 (patch)
treef894abf058898e7aa739f6354abb2f51d4da3c00 /src/nvim/ex_getln.c
parent7031364c7693d2a73b49c421aeee1c82bd0346b6 (diff)
parent367fc419434101d7f4bb1b40534bad94f0c027de (diff)
downloadrneovim-b762e809e40271ad8cad13995a1f0cbdabc10f33.tar.gz
rneovim-b762e809e40271ad8cad13995a1f0cbdabc10f33.tar.bz2
rneovim-b762e809e40271ad8cad13995a1f0cbdabc10f33.zip
Merge pull request #3322 from oni-link/fix.memory.leak.2
path.c: Fix memory leak in expand_wildcards().
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 03116d454f..a9d371d0eb 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -4112,10 +4112,11 @@ void globpath(char_u *path, char_u *file, garray_T *ga, int expand_options)
STRCAT(buf, file); // NOLINT
char_u **p;
- int num_p;
- if (ExpandFromContext(&xpc, buf, &num_p, &p,
- WILD_SILENT|expand_options) != FAIL && num_p > 0) {
- ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
+ int num_p = 0;
+ (void)ExpandFromContext(&xpc, buf, &num_p, &p,
+ WILD_SILENT | expand_options);
+ if (num_p > 0) {
+ ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT | expand_options);
// Concatenate new results to previous ones.
ga_grow(ga, num_p);