cscope/SOURCES/cscope-coverity-fixes.patch

38 lines
1.2 KiB
Diff

diff -up ./src/command.c.coverity2 ./src/command.c
--- ./src/command.c.coverity2 2018-10-11 15:20:44.113781058 -0400
+++ ./src/command.c 2018-10-11 15:21:35.078607301 -0400
@@ -785,7 +785,6 @@ changestring(void)
}
}
fprintf(script, "w\nq\n!\n"); /* write and quit */
- fclose(script);
/* if any line was marked */
if (anymarked == YES) {
diff -up ./src/egrep.c.coverity2 ./src/egrep.c
--- ./src/egrep.c.coverity2 2018-10-11 15:22:40.481384312 -0400
+++ ./src/egrep.c 2018-10-11 15:23:31.152211589 -0400
@@ -1205,6 +1205,7 @@ yyparse (void)
# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
+ /* coverity[leaked_storage] */
}
# endif
#endif /* no yyoverflow */
diff -up ./src/logdir.c.coverity2 ./src/logdir.c
--- ./src/logdir.c.coverity2 2018-10-11 15:23:50.009147309 -0400
+++ ./src/logdir.c 2018-10-11 15:24:26.279023664 -0400
@@ -79,8 +79,10 @@ logdir(char *name)
if (line[j] == '\n')
break;
/* return a null pointer if the whole file has been read */
- if (j >= i)
+ if (j >= i) {
+ (void) close(pwf);
return(0);
+ }
line[++j] = 0; /* terminate the line */
(void) lseek(pwf, (long) (j - i), 1); /* point at the next line */
p = nextfield(line); /* get the logname */