Task #83639 - less-685-5.fc44/scan-results.err
back to task #83639download
Error: SHELLCHECK_WARNING (CWE-758):
/etc/profile.d/less.sh:1:1: error[SC2148]: Tips depend on target shell and yours is unknown. Add a shebang or a 'shell' directive.
# 1|-> # less initialization script (sh)
# 2|
# 3| # All less.*sh files should have the same semantics!
Error: SHELLCHECK_WARNING (CWE-477):
/usr/bin/lesspipe.sh:125:19: warning[SC2166]: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
# 123| if [ -n "$conv" ]; then
# 124| env=`echo $LANG | cut -d. -f2`
# 125|-> if [ -n "$env" -a "$conv" != "$env" ]; then
# 126| iconv -f $conv -t $env "$1"
# 127| exit $?
Error: CLANG_WARNING:
less-685/ch.c:226:40: warning[core.NullDereference]: Access to field 'datasize' results in a dereference of an undefined pointer value (loaded from variable 'bp')
# 224| lbool read_again;
# 225| POSITION len;
# 226|-> POSITION pos = ch_position(ch_block, bp->datasize);
# 227| lbool read_pipe_at_eof = FALSE;
# 228| if ((len = ch_length()) != NULL_POSITION && pos >= len)
Error: COMPILER_WARNING (CWE-252):
less-685/ch.c: scope_hint: In function ‘ch_get’
less-685/ch.c:311:33: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 311 | write(logfile, &bp->data[bp->datasize], (size_t) n);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 309| {
# 310| if (logfile >= 0 && n > 0)
# 311|-> write(logfile, &bp->data[bp->datasize], (size_t) n);
# 312| }
# 313| #endif
Error: COMPILER_WARNING (CWE-252):
less-685/ch.c: scope_hint: In function ‘sync_logfile’
less-685/ch.c:448:33: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
# 448 | write(logfile, bp->data, bp->datasize);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 446| if (bp->block == block)
# 447| {
# 448|-> write(logfile, bp->data, bp->datasize);
# 449| wrote = TRUE;
# 450| break;
Error: CLANG_WARNING:
less-685/ch.c:809:3: warning[unix.Malloc]: Use of memory after it is freed
# 807| {
# 808| bn = ch_bufhead;
# 809|-> BUF_RM(bn);
# 810| free(bufnode_buf(bn));
# 811| }
Error: GCC_ANALYZER_WARNING (CWE-416):
less-685/ch.c:809:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘*thisfile.buflist.next’
less-685/ch.c:806:16: branch_true: following ‘true’ branch...
less-685/ch.c:809:17: branch_true: ...to here
less-685/ch.c:810:17: release_memory: freed here
less-685/ch.c:806:16: branch_true: following ‘true’ branch...
less-685/ch.c:809:17: branch_true: ...to here
less-685/ch.c:809:17: danger: use after ‘free’ of ‘*thisfile.buflist.next’; freed at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 807| {
# 808| bn = ch_bufhead;
# 809|-> BUF_RM(bn);
# 810| free(bufnode_buf(bn));
# 811| }
Error: CLANG_WARNING:
less-685/decode.c:1015:31: warning[unix.MallocSizeof]: Result of 'calloc' is converted to a pointer of type 'unsigned char', which is incompatible with sizeof operand type 'char'
# 1013| return (-1);
# 1014| }
# 1015|-> if ((buf = (unsigned char *) calloc((size_t)len, sizeof(char))) == NULL)
# 1016| {
# 1017| close(f);
Error: COMPILER_WARNING (CWE-457):
less-685/edit.c:611:9: warning[-Wmaybe-uninitialized]: ‘alt_filename’ may be used uninitialized
# 611 | set_altfilename(curr_ifile, alt_filename);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
less-685/edit.c:442:15: note: ‘alt_filename’ was declared here
# 442 | char *alt_filename;
# | ^~~~~~~~~~~~
# 609| curr_ifile = ifile;
# 610| soft_eof = NULL_POSITION;
# 611|-> set_altfilename(curr_ifile, alt_filename);
# 612| set_altpipe(curr_ifile, altpipe);
# 613| set_open(curr_ifile); /* File has been opened */
Error: COMPILER_WARNING (CWE-457):
less-685/edit.c: scope_hint: In function ‘edit_ifile’
less-685/edit.c:615:9: warning[-Wmaybe-uninitialized]: ‘chflags’ may be used uninitialized
# 615 | ch_init(f, chflags, nread);
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~
less-685/edit.c:439:13: note: ‘chflags’ was declared here
# 439 | int chflags;
# | ^~~~~~~
# 613| set_open(curr_ifile); /* File has been opened */
# 614| get_pos(curr_ifile, &initial_scrpos);
# 615|-> ch_init(f, chflags, nread);
# 616| consecutive_nulls = 0;
# 617| check_modelines();
Error: COMPILER_WARNING (CWE-457):
less-685/edit.c:629:21: warning[-Wmaybe-uninitialized]: ‘open_filename’ may be used uninitialized
# 629 | if (strcmp(open_filename, "-") != 0)
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~
less-685/edit.c:441:24: note: ‘open_filename’ was declared here
# 441 | constant char *open_filename;
# | ^~~~~~~~~~~~~
# 627| #if HAVE_STAT_INO
# 628| /* Remember the i-number and device of the opened file. */
# 629|-> if (strcmp(open_filename, "-") != 0)
# 630| {
# 631| struct stat statbuf;
Error: COMPILER_WARNING (CWE-457):
less-685/edit.c:665:21: warning[-Wmaybe-uninitialized]: ‘filename’ may be used uninitialized
# 665 | if (strcmp(filename, FAKE_HELPFILE) && strcmp(filename, FAKE_EMPTYFILE))
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
less-685/edit.c:440:24: note: ‘filename’ was declared here
# 440 | constant char *filename;
# | ^~~~~~~~
# 663| undo_osc8();
# 664| hshift = 0;
# 665|-> if (strcmp(filename, FAKE_HELPFILE) && strcmp(filename, FAKE_EMPTYFILE))
# 666| {
# 667| char *qfilename = shell_quote(filename);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/edit.c:957:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
less-685/edit.c:939:12: branch_false: following ‘false’ branch...
less-685/edit.c:948:18: branch_false: ...to here
less-685/edit.c:948:18: acquire_resource: opened here
less-685/edit.c:949:12: branch_true: following ‘true’ branch...
less-685/edit.c:950:17: branch_true: ...to here
less-685/edit.c:957:21: danger: ‘open(filename, 0)’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 955| * If it doesn't exist we "overwrite" it.
# 956| */
# 957|-> if (!exists || force_logfile)
# 958| {
# 959| /*
Error: CLANG_WARNING:
less-685/edit.c:986:7: warning[unix.StdCLibraryFunctions]: The 1st argument to 'lseek' is -1 but should be >= 0
# 984| */
# 985| logfile = open(filename, OPEN_APPEND);
# 986|-> if (less_lseek(logfile, (less_off_t)0, SEEK_END) == BAD_LSEEK)
# 987| {
# 988| close(logfile);
Error: CLANG_WARNING:
less-685/input.c:152:3: warning[deadcode.DeadStores]: Value stored to 'new_pos' is never read
# 150| plinestart(base_pos);
# 151| ch_seek(curr_pos);
# 152|-> new_pos = curr_pos;
# 153| } else
# 154| {
Error: CLANG_WARNING:
less-685/input.c:535:8: warning[deadcode.DeadStores]: Value stored to 'edisp_pos' is never read
# 533| if (c == '\n')
# 534| new_pos++;
# 535|-> edisp_pos = new_pos;
# 536| break;
# 537| }
Error: CLANG_WARNING:
less-685/jump.c:145:7: warning[deadcode.DeadStores]: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len'
# 143| * (the specified percentage of the file's length).
# 144| */
# 145|-> if ((len = ch_length()) == NULL_POSITION)
# 146| {
# 147| ierror("Determining length of file", NULL_PARG);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lesskey.c:356:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:338:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:340:20: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_resource: opened here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:356:9: danger: ‘fopen(outfile, "wb")’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
# 354| fputbytes(out, cmdsection, sizeof(cmdsection));
# 355| fputint(out, tables.cmdtable.buf.end);
# 356|-> fputbytes(out, xbuf_char_data(&tables.cmdtable.buf), tables.cmdtable.buf.end);
# 357| /* Edit key section */
# 358| fputbytes(out, editsection, sizeof(editsection));
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lesskey.c:356:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:338:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:340:20: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_memory: allocated here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:356:9: danger: ‘fopen(outfile, "wb")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
# 354| fputbytes(out, cmdsection, sizeof(cmdsection));
# 355| fputint(out, tables.cmdtable.buf.end);
# 356|-> fputbytes(out, xbuf_char_data(&tables.cmdtable.buf), tables.cmdtable.buf.end);
# 357| /* Edit key section */
# 358| fputbytes(out, editsection, sizeof(editsection));
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lesskey.c:360:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_resource: opened here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:358:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:358:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:359:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:359:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:360:9: danger: ‘fopen(outfile, "wb")’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
# 358| fputbytes(out, editsection, sizeof(editsection));
# 359| fputint(out, tables.edittable.buf.end);
# 360|-> fputbytes(out, xbuf_char_data(&tables.edittable.buf), tables.edittable.buf.end);
# 361|
# 362| /* Environment variable section */
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lesskey.c:360:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_memory: allocated here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:358:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:358:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:359:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:359:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:360:9: danger: ‘fopen(outfile, "wb")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 358| fputbytes(out, editsection, sizeof(editsection));
# 359| fputint(out, tables.edittable.buf.end);
# 360|-> fputbytes(out, xbuf_char_data(&tables.edittable.buf), tables.edittable.buf.end);
# 361|
# 362| /* Environment variable section */
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lesskey.c:365:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_resource: opened here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:358:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:358:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:359:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:359:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:363:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:363:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:364:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:364:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:365:9: danger: ‘fopen(outfile, "wb")’ leaks here; was opened at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
# 363| fputbytes(out, varsection, sizeof(varsection));
# 364| fputint(out, tables.vartable.buf.end);
# 365|-> fputbytes(out, xbuf_char_data(&tables.vartable.buf), tables.vartable.buf.end);
# 366|
# 367| /* File trailer */
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lesskey.c:365:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(outfile, "wb")’
less-685/lesskey.c:292:5: enter_function: entry to ‘main’
less-685/lesskey.c:322:9: call_function: calling ‘parse_args’ from ‘main’
less-685/lesskey.c:322:9: return_function: returning to ‘main’ from ‘parse_args’
less-685/lesskey.c:324:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:330:9: branch_false: ...to here
less-685/lesskey.c:340:20: acquire_memory: allocated here
less-685/lesskey.c:340:12: branch_false: following ‘false’ branch...
less-685/lesskey.c:351:9: branch_false: ...to here
less-685/lesskey.c:351:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:351:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:354:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:354:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:355:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:355:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:358:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:358:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:359:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:359:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:363:9: call_function: calling ‘fputbytes’ from ‘main’
less-685/lesskey.c:363:9: return_function: returning to ‘main’ from ‘fputbytes’
less-685/lesskey.c:364:9: call_function: calling ‘fputint’ from ‘main’
less-685/lesskey.c:364:9: return_function: returning to ‘main’ from ‘fputint’
less-685/lesskey.c:365:9: danger: ‘fopen(outfile, "wb")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
# 363| fputbytes(out, varsection, sizeof(varsection));
# 364| fputint(out, tables.vartable.buf.end);
# 365|-> fputbytes(out, xbuf_char_data(&tables.vartable.buf), tables.vartable.buf.end);
# 366|
# 367| /* File trailer */
Error: CLANG_WARNING:
less-685/lesskey_parse.c:323:9: warning[core.CallAndMessage]: 1st function call argument is an uninitialized value
# 321| static char * skipsp(char *s)
# 322| {
# 323|-> while (issp(*s))
# 324| s++;
# 325| return (s);
Error: GCC_ANALYZER_WARNING (CWE-476):
less-685/lesskey_parse.c:561:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘eq’
less-685/lesskey_parse.c:629:5: enter_function: entry to ‘parse_lesskey’
less-685/lesskey_parse.c:634:24: branch_false: following ‘false’ branch (when ‘infile’ is NULL)...
less-685/lesskey_parse.c:634:60: branch_false: ...to here
less-685/lesskey_parse.c:635:12: branch_false: following ‘false’ branch...
less-685/lesskey_parse.c:638:9: branch_false: ...to here
less-685/lesskey_parse.c:647:12: branch_true: following ‘true’ branch (when the strings are equal)...
less-685/lesskey_parse.c:648:17: branch_true: ...to here
less-685/lesskey_parse.c:658:12: branch_true: following ‘true’ branch (when ‘desc’ is non-NULL)...
<unknown>: branch_true: ...to here
less-685/lesskey_parse.c:660:24: branch_true: following ‘true’ branch...
less-685/lesskey_parse.c:662:25: branch_true: ...to here
less-685/lesskey_parse.c:663:25: call_function: calling ‘parse_line’ from ‘parse_lesskey’
# 559|
# 560| eq = strchr(line, '=');
# 561|-> if (eq != NULL && eq > line && eq[-1] == '+')
# 562| {
# 563| /*
Error: CLANG_WARNING:
less-685/lesskey_parse.c:668:2: warning[unix.Stream]: Opened stream never closed. Potential resource leak
# 666| fclose(desc);
# 667| }
# 668|-> free(lesskey_file);
# 669| lesskey_file = NULL;
# 670| return (errors);
Error: CLANG_WARNING:
less-685/line.c:1594:5: warning[deadcode.DeadStores]: Value stored to 'prev_ch' is never read
# 1592| else
# 1593| cw = pwidth(wch, attr, prev_ch, attr);
# 1594|-> prev_ch = wch;
# 1595| }
# 1596| } else
Error: CPPCHECK_WARNING (CWE-457):
less-685/line.c:1932: warning[uninitvar]: Uninitialized variable: pos
# 1930| if ((pos = position(sline)) != NULL_POSITION)
# 1931| break;
# 1932|-> for (; sline < sc_height && pos != NULL_POSITION; sline++)
# 1933| {
# 1934| pos = forw_line(pos, NULL, NULL);
Error: GCC_ANALYZER_WARNING (CWE-476):
less-685/linenum.c:197:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
less-685/linenum.c:477:13: enter_function: entry to ‘scan_eof’
less-685/linenum.c:483:12: branch_false: following ‘false’ branch...
less-685/linenum.c:489:9: call_function: inlined call to ‘start_delayed_msg’ from ‘scan_eof’
less-685/linenum.c:491:16: branch_true: following ‘true’ branch (when ‘pos != -1’)...
less-685/linenum.c:494:22: branch_true: ...to here
less-685/linenum.c:494:20: branch_true: following ‘true’ branch...
less-685/linenum.c:495:25: branch_true: ...to here
less-685/linenum.c:495:25: call_function: calling ‘add_lnum’ from ‘scan_eof’
# 195| }
# 196| }
# 197|-> spare->next->prev = spare->prev;
# 198| spare->prev->next = spare->next;
# 199| }
Error: CLANG_WARNING:
less-685/linenum.c:197:23: warning[core.NullDereference]: Access to field 'prev' results in a dereference of a null pointer (loaded from variable 'spare')
# 195| }
# 196| }
# 197|-> spare->next->prev = spare->prev;
# 198| spare->prev->next = spare->next;
# 199| }
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:114:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:114:9: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 112| */
# 113| inp = dup(0);
# 114|-> close(0);
# 115| #if !MSDOS_COMPILER
# 116| if (open_tty() < 0)
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:116:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:116:13: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 114| close(0);
# 115| #if !MSDOS_COMPILER
# 116|-> if (open_tty() < 0)
# 117| #endif
# 118| dup(inp);
Error: CLANG_WARNING:
less-685/lsystem.c:118:3: warning[unix.StdCLibraryFunctions]: The 1st argument to 'dup' is -1 but should be >= 0
# 116| if (open_tty() < 0)
# 117| #endif
# 118|-> dup(inp);
# 119| #endif
# 120|
Error: GCC_ANALYZER_WARNING:
less-685/lsystem.c:118:17: warning[-Wanalyzer-fd-use-without-check]: ‘dup’ on possibly invalid file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:116:12: branch_true: following ‘true’ branch...
less-685/lsystem.c:118:17: branch_true: ...to here
less-685/lsystem.c:118:17: danger: ‘inp’ could be invalid: unchecked value from [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 116| if (open_tty() < 0)
# 117| #endif
# 118|-> dup(inp);
# 119| #endif
# 120|
Error: COMPILER_WARNING (CWE-252):
less-685/lsystem.c: scope_hint: In function ‘lsystem’
less-685/lsystem.c:118:17: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
# 118 | dup(inp);
# | ^~~~~~~~
# 116| if (open_tty() < 0)
# 117| #endif
# 118|-> dup(inp);
# 119| #endif
# 120|
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:129:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:129:22: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 127| #if HAVE_SHELL
# 128| p = NULL;
# 129|-> if ((shell = lgetenv("SHELL")) != NULL && *shell != '\0')
# 130| {
# 131| if (*cmd == '\0')
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:132:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:129:12: branch_true: following ‘true’ branch...
less-685/lsystem.c:131:20: branch_true: following ‘true’ branch...
less-685/lsystem.c:132:29: branch_true: ...to here
less-685/lsystem.c:132:29: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 130| {
# 131| if (*cmd == '\0')
# 132|-> p = save(shell);
# 133| else
# 134| {
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:135:40: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:129:12: branch_true: following ‘true’ branch...
less-685/lsystem.c:131:20: branch_false: following ‘false’ branch...
less-685/lsystem.c:135:40: branch_false: ...to here
less-685/lsystem.c:135:40: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 133| else
# 134| {
# 135|-> char *esccmd = shell_quote(cmd);
# 136| if (esccmd != NULL)
# 137| {
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:139:46: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:129:12: branch_true: following ‘true’ branch...
less-685/lsystem.c:131:20: branch_false: following ‘false’ branch...
less-685/lsystem.c:135:40: branch_false: ...to here
less-685/lsystem.c:136:28: branch_true: following ‘true’ branch...
less-685/lsystem.c:138:46: branch_true: ...to here
less-685/lsystem.c:139:46: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 137| {
# 138| size_t len = strlen(shell) + strlen(esccmd) + 5;
# 139|-> p = (char *) ecalloc(len, sizeof(char));
# 140| SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd);
# 141| free(esccmd);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:140:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:129:12: branch_true: following ‘true’ branch...
less-685/lsystem.c:131:20: branch_false: following ‘false’ branch...
less-685/lsystem.c:135:40: branch_false: ...to here
less-685/lsystem.c:136:28: branch_true: following ‘true’ branch...
less-685/lsystem.c:138:46: branch_true: ...to here
less-685/lsystem.c:140:33: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 138| size_t len = strlen(shell) + strlen(esccmd) + 5;
# 139| p = (char *) ecalloc(len, sizeof(char));
# 140|-> SNPRINTF3(p, len, "%s %s %s", shell, shell_coption(), esccmd);
# 141| free(esccmd);
# 142| }
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:148:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:147:20: branch_true: following ‘true’ branch...
less-685/lsystem.c:148:29: branch_true: ...to here
less-685/lsystem.c:148:29: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 146| {
# 147| if (*cmd == '\0')
# 148|-> p = save("sh");
# 149| else
# 150| p = save(cmd);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:150:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:147:20: branch_false: following ‘false’ branch...
less-685/lsystem.c:150:29: branch_false: ...to here
less-685/lsystem.c:150:29: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 148| p = save("sh");
# 149| else
# 150|-> p = save(cmd);
# 151| }
# 152| system(p);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:152:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:152:9: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 150| p = save(cmd);
# 151| }
# 152|-> system(p);
# 153| free(p);
# 154| #else
Error: COMPILER_WARNING (CWE-252):
less-685/lsystem.c:152:9: warning[-Wunused-result]: ignoring return value of ‘system’ declared with attribute ‘warn_unused_result’
# 152 | system(p);
# | ^~~~~~~~~
# 150| p = save(cmd);
# 151| }
# 152|-> system(p);
# 153| free(p);
# 154| #else
Error: GCC_ANALYZER_WARNING (CWE-1341):
less-685/lsystem.c:176:9: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘0’
less-685/lsystem.c:114:9: release_resource: first ‘close’ here
less-685/lsystem.c:176:9: danger: second ‘close’ here; first ‘close’ was at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 174| * Restore standard input, reset signals, raw mode, etc.
# 175| */
# 176|-> close(0);
# 177| dup(inp);
# 178| close(inp);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:176:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:176:9: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 174| * Restore standard input, reset signals, raw mode, etc.
# 175| */
# 176|-> close(0);
# 177| dup(inp);
# 178| close(inp);
Error: CLANG_WARNING:
less-685/lsystem.c:177:2: warning[unix.StdCLibraryFunctions]: The 1st argument to 'dup' is -1 but should be >= 0
# 175| */
# 176| close(0);
# 177|-> dup(inp);
# 178| close(inp);
# 179| #endif
Error: GCC_ANALYZER_WARNING:
less-685/lsystem.c:177:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup’ on possibly invalid file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:177:9: danger: ‘inp’ could be invalid: unchecked value from [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 175| */
# 176| close(0);
# 177|-> dup(inp);
# 178| close(inp);
# 179| #endif
Error: COMPILER_WARNING (CWE-252):
less-685/lsystem.c:177:9: warning[-Wunused-result]: ignoring return value of ‘dup’ declared with attribute ‘warn_unused_result’
# 177 | dup(inp);
# | ^~~~~~~~
# 175| */
# 176| close(0);
# 177|-> dup(inp);
# 178| close(inp);
# 179| #endif
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/lsystem.c:178:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘inp’
less-685/lsystem.c:113:15: acquire_resource: opened here
less-685/lsystem.c:178:9: danger: ‘inp’ leaks here; was opened at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 176| close(0);
# 177| dup(inp);
# 178|-> close(inp);
# 179| #endif
# 180|
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:303:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:303:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
# 301| return (-1);
# 302| }
# 303|-> clear_bot();
# 304| putstr("!");
# 305| putstr(cmd);
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:304:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:304:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
# 302| }
# 303| clear_bot();
# 304|-> putstr("!");
# 305| putstr(cmd);
# 306| putstr("\n");
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:305:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:305:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 303| clear_bot();
# 304| putstr("!");
# 305|-> putstr(cmd);
# 306| putstr("\n");
# 307|
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:306:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:306:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 304| putstr("!");
# 305| putstr(cmd);
# 306|-> putstr("\n");
# 307|
# 308| deinit();
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:308:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:308:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 306| putstr("\n");
# 307|
# 308|-> deinit();
# 309| flush();
# 310| raw_mode(0);
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:309:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:309:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 307|
# 308| deinit();
# 309|-> flush();
# 310| raw_mode(0);
# 311| init_signals(0);
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:310:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:310:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
# 308| deinit();
# 309| flush();
# 310|-> raw_mode(0);
# 311| init_signals(0);
# 312| #if MSDOS_COMPILER==WIN32C
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:311:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:311:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
# 309| flush();
# 310| raw_mode(0);
# 311|-> init_signals(0);
# 312| #if MSDOS_COMPILER==WIN32C
# 313| close_getchr();
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:325:21: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:320:16: branch_true: following ‘true’ branch (when ‘epos == -1’)...
less-685/lsystem.c:325:21: branch_true: ...to here
less-685/lsystem.c:325:21: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 323| * Read a character from the file and give it to the pipe.
# 324| */
# 325|-> c = ch_forw_get();
# 326| if (c == EOI)
# 327| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:337:21: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:335:16: branch_true: following ‘true’ branch...
less-685/lsystem.c:337:21: branch_true: ...to here
less-685/lsystem.c:337:21: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
# 335| while (c != '\n' && c != EOI )
# 336| {
# 337|-> c = ch_forw_get();
# 338| if (c == EOI)
# 339| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/lsystem.c:347:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(cmd, "w")’
less-685/lsystem.c:292:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:298:18: branch_false: ...to here
less-685/lsystem.c:298:18: acquire_memory: allocated here
less-685/lsystem.c:298:12: branch_false: following ‘false’ branch...
less-685/lsystem.c:303:9: branch_false: ...to here
less-685/lsystem.c:347:9: danger: ‘popen(cmd, "w")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
# 345|
# 346| #ifdef SIGPIPE
# 347|-> LSIGNAL(SIGPIPE, SIG_DFL);
# 348| #endif
# 349| #if MSDOS_COMPILER==WIN32C
Error: CPPCHECK_WARNING (CWE-909):
less-685/position.c:127: error[uninitStructMember]: Uninitialized struct member: scrpos.ln
# 125| pos_clear();
# 126| if (scrpos.pos != NULL_POSITION)
# 127|-> table[scrpos.ln-1] = scrpos.pos;
# 128| }
# 129|
Error: CLANG_WARNING:
less-685/search.c:2288:50: warning[core.UndefinedBinaryOperatorResult]: The left operand of '>' is a garbage value
# 2286| if (result < 0)
# 2287| return;
# 2288|-> if (nprep_endpos == NULL_POSITION || new_epos > nprep_endpos)
# 2289| nprep_endpos = new_epos;
# 2290|
Error: CLANG_WARNING:
less-685/search.c:2289:18: warning[core.uninitialized.Assign]: Assigned value is uninitialized
# 2287| return;
# 2288| if (nprep_endpos == NULL_POSITION || new_epos > nprep_endpos)
# 2289|-> nprep_endpos = new_epos;
# 2290|
# 2291| /*
Error: CLANG_WARNING:
less-685/tags.c:102:3: warning[unix.Malloc]: Use of memory after it is freed
# 100| while ((tp = taglist.tl_first) != TAG_END)
# 101| {
# 102|-> TAG_RM(tp);
# 103| free(tp->tag_file);
# 104| free(tp->tag_pattern);
Error: GCC_ANALYZER_WARNING (CWE-416):
less-685/tags.c:102:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘tp’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
# 100| while ((tp = taglist.tl_first) != TAG_END)
# 101| {
# 102|-> TAG_RM(tp);
# 103| free(tp->tag_file);
# 104| free(tp->tag_pattern);
Error: GCC_ANALYZER_WARNING (CWE-415):
less-685/tags.c:103:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*tp.tag_file’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
# 101| {
# 102| TAG_RM(tp);
# 103|-> free(tp->tag_file);
# 104| free(tp->tag_pattern);
# 105| free(tp);
Error: GCC_ANALYZER_WARNING (CWE-415):
less-685/tags.c:104:17: warning[-Wanalyzer-double-free]: double-‘free’ of ‘*tp.tag_pattern’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
# 102| TAG_RM(tp);
# 103| free(tp->tag_file);
# 104|-> free(tp->tag_pattern);
# 105| free(tp);
# 106| }
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:118:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_false: following ‘false’ branch...
less-685/tags.c:356:22: branch_false: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 116| struct tag *tp;
# 117|
# 118|-> tp = (struct tag *) ecalloc(sizeof(struct tag), 1);
# 119| tp->tag_file = (char *) ecalloc(strlen(file) + 1, sizeof(char));
# 120| strcpy(tp->tag_file, file);
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:118:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_false: following ‘false’ branch...
less-685/tags.c:356:22: branch_false: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 116| struct tag *tp;
# 117|
# 118|-> tp = (struct tag *) ecalloc(sizeof(struct tag), 1);
# 119| tp->tag_file = (char *) ecalloc(strlen(file) + 1, sizeof(char));
# 120| strcpy(tp->tag_file, file);
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:119:33: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_false: following ‘false’ branch...
less-685/tags.c:356:22: branch_false: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 117|
# 118| tp = (struct tag *) ecalloc(sizeof(struct tag), 1);
# 119|-> tp->tag_file = (char *) ecalloc(strlen(file) + 1, sizeof(char));
# 120| strcpy(tp->tag_file, file);
# 121| tp->tag_linenum = linenum;
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:119:33: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_false: following ‘false’ branch...
less-685/tags.c:356:22: branch_false: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 117|
# 118| tp = (struct tag *) ecalloc(sizeof(struct tag), 1);
# 119|-> tp->tag_file = (char *) ecalloc(strlen(file) + 1, sizeof(char));
# 120| strcpy(tp->tag_file, file);
# 121| tp->tag_linenum = linenum;
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:127:44: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_true: following ‘true’ branch...
less-685/tags.c:334:40: branch_true: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 125| else
# 126| {
# 127|-> tp->tag_pattern = (char *) ecalloc(strlen(pattern) + 1, sizeof(char));
# 128| strcpy(tp->tag_pattern, pattern);
# 129| }
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:127:44: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_true: following ‘true’ branch...
less-685/tags.c:334:40: branch_true: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
# 125| else
# 126| {
# 127|-> tp->tag_pattern = (char *) ecalloc(strlen(pattern) + 1, sizeof(char));
# 128| strcpy(tp->tag_pattern, pattern);
# 129| }
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:153:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(tags, 0)’
less-685/tags.c:166:13: enter_function: entry to ‘findtag’
less-685/tags.c:168:20: call_function: calling ‘gettagtype’ from ‘findtag’
# 151| if (f >= 0)
# 152| {
# 153|-> close(f);
# 154| return T_CTAGS;
# 155| }
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:302:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:302:21: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/1)
# 300| * Skip over the whitespace after the tag name.
# 301| */
# 302|-> p = skipsp(tline+taglen);
# 303| if (*p == '\0')
# 304| /* File name is missing! */
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:302:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:302:21: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/1)
# 300| * Skip over the whitespace after the tag name.
# 301| */
# 302|-> p = skipsp(tline+taglen);
# 303| if (*p == '\0')
# 304| /* File name is missing! */
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:315:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:315:21: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/1)
# 313| p++;
# 314| *p++ = '\0';
# 315|-> p = skipsp(p);
# 316| if (*p == '\0')
# 317| /* Pattern is missing! */
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:315:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:315:21: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/1)
# 313| p++;
# 314| *p++ = '\0';
# 315|-> p = skipsp(p);
# 316| if (*p == '\0')
# 317| /* Pattern is missing! */
Error: GCC_ANALYZER_WARNING (CWE-775):
less-685/tags.c:324:30: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_resource: opened here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:324:30: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was opened at [(2)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/1)
# 322| */
# 323| tagendline = FALSE;
# 324|-> taglinenum = getnum(&p, 0, &err);
# 325| if (err)
# 326| {
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:324:30: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(shell_unquote(tags), "r")’
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:269:13: acquire_memory: allocated here
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:324:30: danger: ‘fopen(shell_unquote(tags), "r")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/1)
# 322| */
# 323| tagendline = FALSE;
# 324|-> taglinenum = getnum(&p, 0, &err);
# 325| if (err)
# 326| {
Error: GCC_ANALYZER_WARNING (CWE-131):
less-685/tags.c:357:17: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
less-685/tags.c:253:24: enter_function: entry to ‘findctag’
less-685/tags.c:271:12: branch_false: following ‘false’ branch...
less-685/tags.c:274:9: branch_false: ...to here
less-685/tags.c:274:9: call_function: calling ‘cleantags’ from ‘findctag’
less-685/tags.c:274:9: return_function: returning to ‘findctag’ from ‘cleantags’
less-685/tags.c:281:16: branch_true: following ‘true’ branch...
less-685/tags.c:283:21: branch_true: ...to here
less-685/tags.c:325:20: branch_false: following ‘false’ branch...
less-685/tags.c:356:22: branch_false: ...to here
less-685/tags.c:356:22: call_function: calling ‘maketagent’ from ‘findctag’
less-685/tags.c:356:22: return_function: returning to ‘findctag’ from ‘maketagent’
less-685/tags.c:357:17: danger: assigned to ‘struct tag *’ here; ‘sizeof (struct tag)’ is ‘48’
# 355| }
# 356| tp = maketagent(tagfile, taglinenum, tagpattern, tagendline);
# 357|-> TAG_INS(tp);
# 358| total++;
# 359| }
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:491:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
less-685/tags.c:493:9: return_function: returning to ‘findgtag’ from ‘cleantags’
less-685/tags.c:500:12: branch_false: following ‘false’ branch (when ‘type != 1’)...
less-685/tags.c:513:38: branch_false: ...to here
less-685/tags.c:515:20: branch_false: following ‘false’ branch...
less-685/tags.c:518:17: branch_false: ...to here
<unknown>: branch_true: following ‘true’ branch...
less-685/tags.c:537:24: branch_true: ...to here
less-685/tags.c:544:22: acquire_memory: allocated here
less-685/tags.c:548:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
<unknown>: branch_true: ...to here
less-685/tags.c:590:20: branch_false: following ‘false’ branch...
less-685/tags.c:602:9: branch_false: ...to here
less-685/tags.c:491:24: danger: ‘fp’ leaks here; was allocated at [(15)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/14)
# 489|
# 490| if (type != T_CTAGS_X && tag == NULL)
# 491|-> return TAG_NOFILE;
# 492|
# 493| cleantags();
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:561:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
less-685/tags.c:493:9: return_function: returning to ‘findgtag’ from ‘cleantags’
less-685/tags.c:500:12: branch_false: following ‘false’ branch (when ‘type != 1’)...
less-685/tags.c:513:38: branch_false: ...to here
less-685/tags.c:515:20: branch_false: following ‘false’ branch...
less-685/tags.c:518:17: branch_false: ...to here
<unknown>: branch_true: following ‘true’ branch...
less-685/tags.c:537:24: branch_true: ...to here
less-685/tags.c:544:22: acquire_memory: allocated here
less-685/tags.c:548:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
<unknown>: branch_true: ...to here
less-685/tags.c:550:24: branch_true: following ‘true’ branch...
less-685/tags.c:557:29: branch_true: ...to here
less-685/tags.c:557:28: branch_true: following ‘true’ branch...
less-685/tags.c:560:37: branch_true: ...to here
less-685/tags.c:560:36: branch_true: following ‘true’ branch...
less-685/tags.c:561:41: branch_true: ...to here
less-685/tags.c:561:41: danger: ‘fp’ leaks here; was allocated at [(15)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/14)
# 559| #if HAVE_POPEN
# 560| if (fp != stdin)
# 561|-> pclose(fp);
# 562| #endif
# 563| return TAG_INTR;
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:572:45: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
less-685/tags.c:493:9: return_function: returning to ‘findgtag’ from ‘cleantags’
less-685/tags.c:500:12: branch_false: following ‘false’ branch (when ‘type != 1’)...
less-685/tags.c:513:38: branch_false: ...to here
less-685/tags.c:515:20: branch_false: following ‘false’ branch...
less-685/tags.c:518:17: branch_false: ...to here
<unknown>: branch_true: following ‘true’ branch...
less-685/tags.c:537:24: branch_true: ...to here
less-685/tags.c:544:22: acquire_memory: allocated here
less-685/tags.c:548:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
<unknown>: branch_true: ...to here
less-685/tags.c:550:24: branch_true: following ‘true’ branch...
less-685/tags.c:557:29: branch_true: ...to here
less-685/tags.c:557:28: branch_false: following ‘false’ branch...
less-685/tags.c:565:31: branch_false: ...to here
less-685/tags.c:572:45: danger: ‘fp’ leaks here; was allocated at [(15)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/14)
# 570| int c;
# 571| do {
# 572|-> c = fgetc(fp);
# 573| } while (c != '\n' && c != EOF);
# 574| }
Error: GCC_ANALYZER_WARNING (CWE-401):
less-685/tags.c:592:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
less-685/tags.c:484:24: enter_function: entry to ‘findgtag’
less-685/tags.c:490:12: branch_false: following ‘false’ branch...
less-685/tags.c:493:9: branch_false: ...to here
less-685/tags.c:493:9: call_function: calling ‘cleantags’ from ‘findgtag’
less-685/tags.c:493:9: return_function: returning to ‘findgtag’ from ‘cleantags’
less-685/tags.c:500:12: branch_false: following ‘false’ branch (when ‘type != 1’)...
less-685/tags.c:513:38: branch_false: ...to here
less-685/tags.c:515:20: branch_false: following ‘false’ branch...
less-685/tags.c:518:17: branch_false: ...to here
<unknown>: branch_true: following ‘true’ branch...
less-685/tags.c:537:24: branch_true: ...to here
less-685/tags.c:544:22: acquire_memory: allocated here
less-685/tags.c:548:12: branch_true: following ‘true’ branch (when ‘fp’ is non-NULL)...
<unknown>: branch_true: ...to here
less-685/tags.c:590:20: branch_true: following ‘true’ branch...
less-685/tags.c:592:29: branch_true: ...to here
less-685/tags.c:592:29: danger: ‘fp’ leaks here; was allocated at [(15)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/14)
# 590| if (fp != stdin)
# 591| {
# 592|-> if (pclose(fp))
# 593| {
# 594| curtag = NULL;