summaryrefslogtreecommitdiffstats
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2005-06-01 21:51:55 +0000
committerBram Moolenaar <Bram@vim.org>2005-06-01 21:51:55 +0000
commitd6f676daaf88bd4768cd715c0ce88531f599e609 (patch)
treea5f1d3dbcbc32264bee8a89852add2bec6ade8d4 /src/if_cscope.c
parent2c29beed4c2a40662ef859f4f5c9aed045d5a0d6 (diff)
updated for version 7.0078
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index 9693f845d3..3e5e26ce59 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1726,6 +1726,7 @@ cs_file_results(f, nummatches_a)
*
* get parsed cscope output and calls cs_make_vim_style_matches to convert
* into ctags format
+ * When there are no matches sets "*matches_p" to NULL.
*/
static void
cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
@@ -1790,9 +1791,18 @@ cs_fill_results(tagstr, totmatches, nummatches_a, matches_p, cntxts_p, matched)
} /* for all cscope connections */
parse_out:
+ if (totsofar == 0)
+ {
+ /* No matches, free the arrays and return NULL in "*matches_p". */
+ vim_free(matches);
+ matches = NULL;
+ vim_free(cntxts);
+ cntxts = NULL;
+ }
*matched = totsofar;
*matches_p = matches;
*cntxts_p = cntxts;
+
vim_free(buf);
} /* cs_fill_results */