diff src/if_cscope.c @ 7009:286fd54c7ae3 v7.4.822

patch 7.4.822 Problem: More problems reported by coverity. Solution: Avoid the warnings. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Tue, 11 Aug 2015 19:14:00 +0200
parents 7347229a646a
children 37c929c4a073
line wrap: on
line diff
--- a/src/if_cscope.c
+++ b/src/if_cscope.c
@@ -1076,8 +1076,8 @@ err_closing:
 /*
  * PRIVATE: cs_find
  *
- * query cscope using command line interface.  parse the output and use tselect
- * to allow choices.  like Nvi, creates a pipe to send to/from query/cscope.
+ * Query cscope using command line interface.  Parse the output and use tselect
+ * to allow choices.  Like Nvi, creates a pipe to send to/from query/cscope.
  *
  * returns TRUE if we jump to a tag or abort, FALSE if not.
  */
@@ -1214,7 +1214,10 @@ cs_find_common(opt, pat, forceit, verbos
 
     nummatches = (int *)alloc(sizeof(int)*csinfo_size);
     if (nummatches == NULL)
+    {
+	vim_free(cmd);
 	return FALSE;
+    }
 
     /* Send query to all open connections, then count the total number
      * of matches so we can alloc all in one swell foop. */
@@ -1289,7 +1292,7 @@ cs_find_common(opt, pat, forceit, verbos
 # ifdef FEAT_WINDOWS
 		if (postponed_split != 0)
 		{
-		    win_split(postponed_split > 0 ? postponed_split : 0,
+		    (void)win_split(postponed_split > 0 ? postponed_split : 0,
 						       postponed_split_flags);
 		    RESET_BINDING(curwin);
 		    postponed_split = 0;
@@ -2085,6 +2088,8 @@ cs_print_tags_priv(matches, cntxts, num_
 
     strcpy(tbuf, matches[0]);
     ptag = strtok(tbuf, "\t");
+    if (ptag == NULL)
+	return;
 
     newsize = (int)(strlen(cstag_msg) + strlen(ptag));
     buf = (char *)alloc(newsize);