summaryrefslogtreecommitdiffstats
path: root/src/if_cscope.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-02-03 19:35:13 +0100
committerBram Moolenaar <Bram@vim.org>2021-02-03 19:35:13 +0100
commit4dba04256b8a49b201d685217d3d7abc4988f090 (patch)
treec7ffb911251a8066fc91075e251459153935deb4 /src/if_cscope.c
parent7b6903f02c9eeb12cd85941ea0d352d84e4dab30 (diff)
patch 8.2.2457: Coverity warns for memory leakv8.2.2457
Problem: Coverity warns for memory leak. Solution: Free memory when out of memory.
Diffstat (limited to 'src/if_cscope.c')
-rw-r--r--src/if_cscope.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/if_cscope.c b/src/if_cscope.c
index bbb429ab91..f52316faec 100644
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1813,7 +1813,10 @@ cs_file_results(FILE *f, int *nummatches_a)
context = alloc(strlen(cntx)+5);
if (context == NULL)
+ {
+ vim_free(fullname);
continue;
+ }
if (strcmp(cntx, "<global>")==0)
strcpy(context, "<<global>>");