groff-1.23.0-11.fc44

List of Findings

Error: SHELLCHECK_WARNING: [#def1]
/usr/bin/eqn2graph:75:25: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#   73|       # $RANDOM is a Bashism.  The fallback of $PPID is not good pseudorandomness,
#   74|       # but is supported by the stripped-down dash shell, for instance.
#   75|->     tmp="$d/eqn2graph$$-${RANDOM:-$PPID}"
#   76|       (umask 077 && mkdir "$tmp") 2> /dev/null
#   77|   

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/bin/eqn2graph:96:6: warning[SC2154]: exit_status is referenced but not assigned.
#   94|   fi
#   95|   
#   96|-> trap 'exit_status=$?; rm -rf "$tmp" && exit $exit_status' EXIT INT TERM
#   97|   
#   98|   # Here goes:

Error: SHELLCHECK_WARNING (CWE-138): [#def3]
/usr/bin/gdiffmk:28:22: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#   26|   	if test $# -gt 0
#   27|   	then
#   28|-> 		echo >&2 "${CMD}:  $@"
#   29|   	fi
#   30|   	echo >&2 "\

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/bin/gdiffmk:71:2: warning[SC2034]: arg appears unused. Verify use (or export if used externally).
#   69|   	exitcode=$1
#   70|   	shift
#   71|-> 	for arg
#   72|   	do
#   73|   		echo >&2 "${CMD}:  $1"

Error: SHELLCHECK_WARNING (CWE-456): [#def5]
/usr/bin/gdiffmk:175:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  173|   BASH_PROG=/usr/bin/bash
#  174|   BADOPTION=
#  175|-> DIFFCMD=diff
#  176|   SEDCMD=sed
#  177|   D_option=

Error: SHELLCHECK_WARNING (CWE-456): [#def6]
/usr/bin/gdiffmk:176:1: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  174|   BADOPTION=
#  175|   DIFFCMD=diff
#  176|-> SEDCMD=sed
#  177|   D_option=
#  178|   br=.br

Error: SHELLCHECK_WARNING: [#def7]
/usr/bin/grap2graph:77:26: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#   75|       # $RANDOM is a Bashism.  The fallback of $PPID is not good pseudorandomness,
#   76|       # but is supported by the stripped-down dash shell, for instance.
#   77|->     tmp="$d/grap2graph$$-${RANDOM:-$PPID}"
#   78|       (umask 077 && mkdir "$tmp") 2> /dev/null
#   79|   

Error: SHELLCHECK_WARNING (CWE-563): [#def8]
/usr/bin/grap2graph:95:5: warning[SC2034]: convert_trim_arg appears unused. Verify use (or export if used externally).
#   93|   then
#   94|       echo "$0: warning: falling back to old '-crop 0x0' trim method" >&2
#   95|->     convert_trim_arg="-crop 0x0"
#   96|   fi
#   97|   

Error: SHELLCHECK_WARNING (CWE-457): [#def9]
/usr/bin/grap2graph:98:6: warning[SC2154]: exit_status is referenced but not assigned.
#   96|   fi
#   97|   
#   98|-> trap 'exit_status=$?; rm -rf "$tmp" && exit $exit_status' EXIT INT TERM
#   99|   
#  100|   # Here goes:

Error: SHELLCHECK_WARNING (CWE-563): [#def10]
/usr/bin/pdfroff:67:42: warning[SC2034]: NULLCMD appears unused. Verify use (or export if used externally).
#   65|   # then we may need this hack, adapted from autoconf code.
#   66|   #
#   67|->   test x${ZSH_VERSION+"set"} = x"set" && NULLCMD=":" \
#   68|       && (emulate sh) >$NULLDEV 2>&1 && emulate sh
#   69|   #

Error: SHELLCHECK_WARNING (CWE-569): [#def11]
/usr/bin/pdfroff:101:67: warning[SC2089]: Quotes/backslashes will be treated literally. Rewrite using set/"$@" or functions.
#   99|   #
#  100|     NO='' NOPROG="$CMD: installation problem: cannot find program"
#  101|->   test "$CAT" = ":" && echo >&2 "$NOPROG 'cat' in PATH" && NO="$NO 'cat'"
#  102|     test "$GREP" = ":" && echo >&2 "$NOPROG 'grep' in PATH" && NO="$NO 'grep'"
#  103|     test "$GROFF" = ":" && echo >&2 "$NOPROG 'groff' in $GPATH" && NO="$NO 'groff'"

Error: SHELLCHECK_WARNING (CWE-569): [#def12]
/usr/bin/pdfroff:107:9: warning[SC2090]: Quotes/backslashes in this variable will not be respected.
#  105|     if test -n "$NO"
#  106|     then
#  107|->     set $NO
#  108|       test $# -gt 1 && NO="s" IS="are" || NO='' IS="is"
#  109|       while test $# -gt 0

Error: SHELLCHECK_WARNING (CWE-456): [#def13]
/usr/bin/pdfroff:133:40: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  131|     if test -n "${PDFROFF_POSTPROCESSOR_COMMAND}"
#  132|     then
#  133|->     GROFF_GHOSTSCRIPT_INTERPRETER=`set command ${PDFROFF_POSTPROCESSOR_COMMAND};
#  134|         echo $2`
#  135|     fi

Error: SHELLCHECK_WARNING (CWE-569): [#def14]
/usr/bin/pdfroff:150:18: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  148|     # so to clean up, we may simply purge it.
#  149|     #
#  150|->     trap "rm -rf ${GROFF_TMPDIR}" 0
#  151|     #
#  152|     else

Error: SHELLCHECK_WARNING (CWE-569): [#def15]
/usr/bin/pdfroff:159:17: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  157|     #
#  158|       GROFF_TMPDIR=${TMPDIR}
#  159|->     trap "rm -f ${GROFF_TMPDIR}/pdf$$.*" 0
#  160|     fi
#  161|     #

Error: SHELLCHECK_WARNING (CWE-569): [#def16]
/usr/bin/pdfroff:159:36: warning[SC2064]: Use single quotes, otherwise this expands now rather than when signalled.
#  157|     #
#  158|       GROFF_TMPDIR=${TMPDIR}
#  159|->     trap "rm -f ${GROFF_TMPDIR}/pdf$$.*" 0
#  160|     fi
#  161|     #

Error: SHELLCHECK_WARNING (CWE-398): [#def17]
/usr/bin/pdfroff:168:23: warning[SC2172]: Trapping signals by number is not well defined. Prefer signal names.
#  166|     # here we trap SIGHUP, SIGINT, SIGQUIT, SIGPIPE and SIGTERM.
#  167|     #
#  168|->   trap "exit 1" 1 2 3 13 15
#  169|   #
#  170|     WRKFILE=${GROFF_TMPDIR}/pdf$$.tmp

Error: SHELLCHECK_WARNING (CWE-482): [#def18]
/usr/bin/pdfroff:207:34: error[SC1097]: Unexpected ==. For assignment, use =. For comparison, use [/[[. Or quote for literal string.
#  205|   #          First identify, matching any abbreviation to its full form.
#  206|   #
#  207|->            MATCH="" OPTNAME=`IFS==; set dummy $1; echo $2`
#  208|              for OPT in $LONGOPTS
#  209|              do

Error: SHELLCHECK_WARNING (CWE-456): [#def19]
/usr/bin/pdfroff:207:41: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  205|   #          First identify, matching any abbreviation to its full form.
#  206|   #
#  207|->            MATCH="" OPTNAME=`IFS==; set dummy $1; echo $2`
#  208|              for OPT in $LONGOPTS
#  209|              do

Error: SHELLCHECK_WARNING (CWE-456): [#def20]
/usr/bin/pdfroff:302:16: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  300|   
#  301|                --report-progress)
#  302|->                SHOW_PROGRESS=echo
#  303|                  ;;
#  304|   

Error: SHELLCHECK_WARNING (CWE-456): [#def21]
/usr/bin/pdfroff:374:16: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  372|         -[dfFILmMnoPrTwW])
#  373|              OPTNAME="$1"
#  374|-> 	   shift; set reparse "$OPTNAME$@"
#  375|   	   ;;
#  376|   #

Error: SHELLCHECK_WARNING (CWE-138): [#def22]
/usr/bin/pdfroff:374:33: error[SC2145]: Argument mixes string and array. Use * or separate argument.
#  372|         -[dfFILmMnoPrTwW])
#  373|              OPTNAME="$1"
#  374|-> 	   shift; set reparse "$OPTNAME$@"
#  375|   	   ;;
#  376|   #

Error: SHELLCHECK_WARNING (CWE-456): [#def23]
/usr/bin/pdfroff:390:16: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  388|   #     '-h' and '-v' options redirect to their equivalent long forms ...
#  389|   #
#  390|->       -h*) set redirect --help
#  391|              ;;
#  392|   #

Error: SHELLCHECK_WARNING (CWE-456): [#def24]
/usr/bin/pdfroff:393:23: warning[SC2121]: To assign a variable, use just 'var=value', no 'set ..'.
#  391|              ;;
#  392|   #
#  393|->       -v*) shift; set redirect --version "$@"
#  394|              ;;
#  395|   #

Error: SHELLCHECK_WARNING: [#def25]
/usr/bin/pdfroff:425:45: warning[SC3037]: In POSIX sh, echo flags are undefined.
#  423|   # (Adapted from 'autoconf' code, as found in 'configure' scripts).
#  424|   #
#  425|->   case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
#  426|       *c*,*-n*)  n=''   c=''   ;;
#  427|       *c*)       n='-n' c=''   ;;

Error: SHELLCHECK_WARNING (CWE-569): [#def26]
/usr/bin/pdfroff:445:5: warning[SC2188]: This redirection doesn't have a command. Move to its command (or use 'true' as no-op).
#  443|     if test -z "$DIFF"
#  444|     then
#  445|->     >> $REFFILE
#  446|       echo kickstart > $REFCOPY
#  447|       test x${SHOW_PROGRESS+"set"} = x"set" && SAY=echo

Error: SHELLCHECK_WARNING (CWE-456): [#def27]
/usr/bin/pdfroff:447:46: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  445|       >> $REFFILE
#  446|       echo kickstart > $REFCOPY
#  447|->     test x${SHOW_PROGRESS+"set"} = x"set" && SAY=echo
#  448|   #
#  449|   #   In order to correctly resolve 'pdfmark' references,

Error: SHELLCHECK_WARNING (CWE-569): [#def28]
/usr/bin/pdfroff:465:69: warning[SC2089]: Quotes/backslashes will be treated literally. Rewrite using set/"$@" or functions.
#  463|       fi
#  464|       DIFF=`searchpath diff "$PATH"`
#  465|->     test "$AWK" = ":" && echo >&2 "$NOPROG 'awk' in PATH" && NO="$NO 'awk'"
#  466|       test "$DIFF" = ":" && echo >&2 "$NOPROG 'diff' in PATH" && NO="$NO 'diff'"
#  467|       if test -n "$NO"

Error: SHELLCHECK_WARNING (CWE-569): [#def29]
/usr/bin/pdfroff:469:11: warning[SC2090]: Quotes/backslashes in this variable will not be respected.
#  467|       if test -n "$NO"
#  468|       then
#  469|->       set $NO
#  470|         SAY=":" AWK=":" DIFF=":"
#  471|         test $# -gt 1 && NO="s $1 and $2 are" || NO=" $1 is"

Error: SHELLCHECK_WARNING (CWE-156): [#def30]
/usr/bin/pdfroff:593:8: warning[SC2046]: Quote this to prevent word splitting.
#  591|   # as a result of parsing the document source ...
#  592|   #
#  593|->   eval `$SED -n '/^ *pdfroff-option:set */s///p' $WRKFILE`
#  594|   #
#  595|   # ... (which is currently supported to enable "toc-relocation",

Error: SHELLCHECK_WARNING (CWE-456): [#def31]
/usr/bin/pdfroff:613:44: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string).
#  611|   #  of spurious messages associated with reference resolution).
#  612|   #
#  613|->   test x${SHOW_PROGRESS+"set"} = x"set" && SAY=echo
#  614|   #
#  615|   # If a document cover style sheet is specified ...

Error: SHELLCHECK_WARNING (CWE-398): [#def32]
/usr/bin/pdfroff:651:35: warning[SC1078]: Did you forget to close this double quoted string?
#  649|     if test -z "$PDFROFF_POSTPROCESSOR_COMMAND"
#  650|     then
#  651|->     PDFROFF_POSTPROCESSOR_COMMAND="$GS -dQUIET -dBATCH -dNOPAUSE -dSAFER
#  652|         -sDEVICE=pdfwrite -sOutputFile="${PDF_OUTPUT-"-"}
#  653|   

Error: SHELLCHECK_WARNING: [#def33]
/usr/bin/pic2graph:90:25: warning[SC3028]: In POSIX sh, RANDOM is undefined.
#   88|       # $RANDOM is a Bashism.  The fallback of $PPID is not good pseudorandomness,
#   89|       # but is supported by the stripped-down dash shell, for instance.
#   90|->     tmp="$d/pic2graph$$-${RANDOM:-$PPID}"
#   91|       (umask 077 && mkdir "$tmp") 2> /dev/null
#   92|   

Error: SHELLCHECK_WARNING (CWE-457): [#def34]
/usr/bin/pic2graph:111:6: warning[SC2154]: exit_status is referenced but not assigned.
#  109|   fi
#  110|   
#  111|-> trap 'exit_status=$?; rm -rf "$tmp" && exit $exit_status' EXIT INT TERM
#  112|   
#  113|   # Here goes:

Error: GCC_ANALYZER_WARNING (CWE-404): [#def35]
groff-1.23.0/lib/asnprintf.c:31:12: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
groff-1.23.0/lib/asnprintf.c:30:3: acquire_resource: ‘va_start’ called here
groff-1.23.0/lib/asnprintf.c:31:12: throw: if ‘vasnprintf’ throws an exception...
groff-1.23.0/lib/asnprintf.c:31:12: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   29|   
#   30|     va_start (args, format);
#   31|->   result = vasnprintf (resultbuf, lengthp, format, args);
#   32|     va_end (args);
#   33|     return result;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def36]
groff-1.23.0/lib/fprintf.c:45:12: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
groff-1.23.0/lib/fprintf.c:44:3: acquire_resource: ‘va_start’ called here
groff-1.23.0/lib/fprintf.c:45:12: throw: if ‘vasnprintf’ throws an exception...
groff-1.23.0/lib/fprintf.c:45:12: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   43|   
#   44|     va_start (args, format);
#   45|->   output = vasnprintf (buf, &lenbuf, format, args);
#   46|     len = lenbuf;
#   47|     va_end (args);

Error: GCC_ANALYZER_WARNING (CWE-124): [#def37]
groff-1.23.0/lib/vasnprintf.c:1981:13: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
groff-1.23.0/lib/vasnprintf.c:1857:1: enter_function: entry to ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1863:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1874:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1874:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1892:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1892:7: call_function: inlined call to ‘xsum4’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: following ‘true’ branch (when ‘sum <= 3999’)...
groff-1.23.0/lib/vasnprintf.c:1896:27: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1948:12: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1950:24: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1951:39: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch (when ‘allocated != 18446744073709551615’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch (when ‘result == resultbuf’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1969:12: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1973:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1973:12: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1977:19: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1977:16: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1979:32: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_false: following ‘false’ branch (when ‘allocated != 18446744073709551615’)...
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_true: following ‘true’ branch (when ‘result == resultbuf’)...
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_false: following ‘false’ branch (when ‘memory’ is non-NULL)...
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1980:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1981:13: danger: out-of-bounds write at byte -1 but region starts at byte 0
# 1979|               augmented_length = xsum (length, 1);
# 1980|               ENSURE_ALLOCATION (augmented_length);
# 1981|->             result[length] = '%';
# 1982|               length = augmented_length;
# 1983|             }

Error: GCC_ANALYZER_WARNING (CWE-124): [#def38]
groff-1.23.0/lib/vasnprintf.c:5071:17: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
groff-1.23.0/lib/vasnprintf.c:1857:1: enter_function: entry to ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1863:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1874:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1874:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1892:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1892:7: call_function: inlined call to ‘xsum4’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: following ‘true’ branch (when ‘sum <= 3999’)...
groff-1.23.0/lib/vasnprintf.c:1896:27: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1948:12: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1950:24: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1951:39: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch (when ‘allocated != 18446744073709551615’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch (when ‘result == resultbuf’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1969:12: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1973:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1973:12: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1986:19: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1986:16: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1989:16: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1989:16: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4721:33: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4898:20: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4900:21: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4900:20: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4902:21: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4902:20: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4904:21: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4904:20: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4907:21: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4907:20: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4912:25: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4912:24: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4914:25: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4914:24: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4935:25: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:4935:24: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:4955:17: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:5066:17: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:5066:17: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:5071:18: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:5071:17: danger: out-of-bounds write at byte -1 but region starts at byte 0
# 5069|                   /* Prepare checking whether snprintf returns the count
# 5070|                      via %n.  */
# 5071|->                 *(TCHAR_T *) (result + length) = '\0';
# 5072|   #endif
# 5073|   

Error: GCC_ANALYZER_WARNING (CWE-124): [#def39]
groff-1.23.0/lib/vasnprintf.c:5668:5: warning[-Wanalyzer-out-of-bounds]: heap-based buffer underwrite
groff-1.23.0/lib/vasnprintf.c:1857:1: enter_function: entry to ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1863:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1874:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1874:6: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1892:7: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1892:7: call_function: inlined call to ‘xsum4’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1894:8: branch_true: following ‘true’ branch (when ‘sum <= 3999’)...
groff-1.23.0/lib/vasnprintf.c:1896:27: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1948:12: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1950:24: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1951:39: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch (when ‘allocated != 18446744073709551615’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: following ‘true’ branch (when ‘result == resultbuf’)...
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_true: ...to here
groff-1.23.0/lib/vasnprintf.c:1953:13: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:1969:12: branch_true: following ‘true’ branch...
groff-1.23.0/lib/vasnprintf.c:5667:5: call_function: inlined call to ‘xsum’ from ‘vasnprintf’
groff-1.23.0/lib/vasnprintf.c:5667:5: branch_false: following ‘false’ branch...
groff-1.23.0/lib/vasnprintf.c:5668:11: branch_false: ...to here
groff-1.23.0/lib/vasnprintf.c:5668:5: danger: out-of-bounds write at byte -1 but region starts at byte 0
# 5666|       /* Add the final NUL.  */
# 5667|       ENSURE_ALLOCATION (xsum (length, 1));
# 5668|->     result[length] = '\0';
# 5669|   
# 5670|       if (result != resultbuf && length + 1 < allocated)

Error: CPPCHECK_WARNING (CWE-457): [#def40]
groff-1.23.0/src/devices/grolbp/lbp.h:162: warning[uninitvar]: Uninitialized variable: result
#  160|     *p++ = b3;
#  161|     *p = 0x00; /* End of the resulting string */
#  162|->   return result;
#  163|   }
#  164|   

Error: CPPCHECK_WARNING (CWE-476): [#def41]
groff-1.23.0/src/devices/grotty/tty.cpp:27: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   25|   
#   26|   declare_ptable(schar)
#   27|-> implement_ptable(schar)
#   28|   
#   29|   extern "C" const char *Version_string;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def42]
groff-1.23.0/src/devices/xditview/device.c:471:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘find_file(XtMalloc((unsigned int)strlen(device_name) + (unsigned int)strlen(file_name) + 5), result)’
groff-1.23.0/src/devices/xditview/device.c:525:7: enter_function: entry to ‘open_device_file’
groff-1.23.0/src/devices/xditview/device.c:533:8: call_function: calling ‘find_file’ from ‘open_device_file’
groff-1.23.0/src/devices/xditview/device.c:533:8: return_function: returning to ‘open_device_file’ from ‘find_file’
groff-1.23.0/src/devices/xditview/device.c:534:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/devices/xditview/device.c:538:3: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:538:3: throw: if ‘XtFree’ throws an exception...
groff-1.23.0/src/devices/xditview/device.c:471:3: danger: ‘find_file(XtMalloc((unsigned int)strlen(device_name) + (unsigned int)strlen(file_name) + 5), result)’ leaks here; was opened at [(10)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/9)
#  469|       strcat(path, ":");
#  470|     }
#  471|->   strcat(path, FONTPATH);
#  472|   
#  473|     *result = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
groff-1.23.0/src/devices/xditview/device.c:471:3: warning[-Wanalyzer-malloc-leak]: leak of ‘find_file(XtMalloc((unsigned int)strlen(device_name) + (unsigned int)strlen(file_name) + 5), result)’
groff-1.23.0/src/devices/xditview/device.c:525:7: enter_function: entry to ‘open_device_file’
groff-1.23.0/src/devices/xditview/device.c:533:8: call_function: calling ‘find_file’ from ‘open_device_file’
groff-1.23.0/src/devices/xditview/device.c:533:8: return_function: returning to ‘open_device_file’ from ‘find_file’
groff-1.23.0/src/devices/xditview/device.c:534:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/devices/xditview/device.c:538:3: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:538:3: throw: if ‘XtFree’ throws an exception...
groff-1.23.0/src/devices/xditview/device.c:471:3: danger: ‘find_file(XtMalloc((unsigned int)strlen(device_name) + (unsigned int)strlen(file_name) + 5), result)’ leaks here; was allocated at [(10)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/9)
#  469|       strcat(path, ":");
#  470|     }
#  471|->   strcat(path, FONTPATH);
#  472|   
#  473|     *result = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def44]
groff-1.23.0/src/devices/xditview/device.c:511:5: warning[-Wanalyzer-null-argument]: use of NULL ‘buf’ where non-null expected
groff-1.23.0/src/devices/xditview/device.c:473:3: release_memory: ‘*result’ is NULL
groff-1.23.0/src/devices/xditview/device.c:475:6: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
groff-1.23.0/src/devices/xditview/device.c:477:7: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:477:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/devices/xditview/device.c:480:6: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:480:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/devices/xditview/device.c:487:10: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:489:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/device.c:494:11: branch_true: ...to here
groff-1.23.0/src/devices/xditview/device.c:495:8: branch_true: following ‘true’ branch (when ‘end’ is non-NULL)...
groff-1.23.0/src/devices/xditview/device.c:496:7: branch_true: ...to here
groff-1.23.0/src/devices/xditview/device.c:504:8: branch_false: following ‘false’ branch (when ‘bufsiz >= len’)...
groff-1.23.0/src/devices/xditview/device.c:511:5: branch_false: ...to here
groff-1.23.0/src/devices/xditview/device.c:511:5: danger: argument 1 (‘buf’) NULL where non-null expected
#  509|         bufsiz = len;
#  510|       }
#  511|->     memcpy(buf, start, end - start);
#  512|       buf[end - start] = '/';
#  513|       strcpy(buf + (end - start) + 1, file);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def45]
groff-1.23.0/src/devices/xditview/lex.c:33:16: warning[-Wanalyzer-deref-before-check]: check of ‘*dw.dvi.tmpFile’ for NULL after already dereferencing it
groff-1.23.0/src/devices/xditview/lex.c:33:16: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/lex.c:33:16: branch_true: ...to here
groff-1.23.0/src/devices/xditview/lex.c:33:16: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/lex.c:33:16: branch_true: ...to here
groff-1.23.0/src/devices/xditview/lex.c:33:16: danger: pointer ‘*dw.dvi.tmpFile’ is checked for NULL here but it was already dereferenced at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   31|   	Length--;		     /* Save room for final '\0' */
#   32|   	
#   33|-> 	while (DviGetC (dw, &c) != EOF) {
#   34|   		if (Buffer && i < Length)
#   35|   			Buffer[i++] = c;

Error: GCC_ANALYZER_WARNING (CWE-465): [#def46]
groff-1.23.0/src/devices/xditview/lex.c:52:16: warning[-Wanalyzer-deref-before-check]: check of ‘*dw.dvi.tmpFile’ for NULL after already dereferencing it
groff-1.23.0/src/devices/xditview/lex.c:52:16: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/lex.c:52:16: branch_true: ...to here
groff-1.23.0/src/devices/xditview/lex.c:52:16: danger: pointer ‘*dw.dvi.tmpFile’ is checked for NULL here but it was already dereferenced at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   50|   	
#   51|   	Length--;			    /* Save room for final '\0' */
#   52|-> 	while (DviGetC(dw, &c) == ' ' || c == '\n')
#   53|   		;
#   54|   	while (c != EOF) {

Error: GCC_ANALYZER_WARNING (CWE-465): [#def47]
groff-1.23.0/src/devices/xditview/lex.c:73:16: warning[-Wanalyzer-deref-before-check]: check of ‘*dw.dvi.tmpFile’ for NULL after already dereferencing it
groff-1.23.0/src/devices/xditview/lex.c:73:16: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/lex.c:73:16: branch_true: ...to here
groff-1.23.0/src/devices/xditview/lex.c:73:16: danger: pointer ‘*dw.dvi.tmpFile’ is checked for NULL here but it was already dereferenced at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   71|   	int	negative = 0;
#   72|   
#   73|-> 	while (DviGetC(dw, &c) == ' ' || c == '\n')
#   74|   		;
#   75|   	if (c == '-') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
groff-1.23.0/src/devices/xditview/xditview.c:355:5: warning[-Wanalyzer-malloc-leak]: leak of ‘new_file’
groff-1.23.0/src/devices/xditview/xditview.c:341:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
groff-1.23.0/src/devices/xditview/xditview.c:343:14: branch_false: ...to here
groff-1.23.0/src/devices/xditview/xditview.c:343:13: branch_true: following ‘true’ branch...
groff-1.23.0/src/devices/xditview/xditview.c:344:20: branch_true: ...to here
groff-1.23.0/src/devices/xditview/xditview.c:344:20: acquire_memory: allocated here
groff-1.23.0/src/devices/xditview/xditview.c:349:8: branch_false: following ‘false’ branch (when ‘new_file’ is non-NULL)...
groff-1.23.0/src/devices/xditview/xditview.c:353:5: branch_false: ...to here
groff-1.23.0/src/devices/xditview/xditview.c:355:5: throw: if ‘XtSetValues’ throws an exception...
groff-1.23.0/src/devices/xditview/xditview.c:355:5: danger: ‘new_file’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  353|       XtSetArg (arg[0], XtNfile, new_file);
#  354|       XtSetArg (arg[1], XtNseek, seek);
#  355|->     XtSetValues (dvi, arg, 2);
#  356|       if (hadFile || name[0] != '-' || name[1] != '\0') {
#  357|   	XtSetArg (arg[0], XtNtitle, name);

Error: COMPILER_WARNING (CWE-704): [#def49]
groff-1.23.0/src/devices/xditview/xditview.c: scope_hint: In function ‘NewFile’
groff-1.23.0/src/devices/xditview/xditview.c:358:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  358 |         if (name[0] != '/' && (n = strrchr (name, '/')))
#      |                                  ^
#  356|       if (hadFile || name[0] != '-' || name[1] != '\0') {
#  357|   	XtSetArg (arg[0], XtNtitle, name);
#  358|-> 	if (name[0] != '/' && (n = strrchr (name, '/')))
#  359|   	    n = n + 1;
#  360|   	else

Error: COMPILER_WARNING (CWE-704): [#def50]
groff-1.23.0/src/devices/xditview/xditview.c:358:34: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  356|       if (hadFile || name[0] != '-' || name[1] != '\0') {
#  357|   	XtSetArg (arg[0], XtNtitle, name);
#  358|-> 	if (name[0] != '/' && (n = strrchr (name, '/')))
#  359|   	    n = n + 1;
#  360|   	else

Error: GCC_ANALYZER_WARNING: [#def51]
groff-1.23.0/src/devices/xditview/xditview.c:367:5: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to ‘strcpy’
groff-1.23.0/src/devices/xditview/xditview.c:487:1: enter_function: entry to ‘RerasterizeAction’
groff-1.23.0/src/devices/xditview/xditview.c:499:5: call_function: calling ‘NewFile’ from ‘RerasterizeAction’
#  365|       hadFile = 1;
#  366|       SelectPageNumber ("1");
#  367|->     strcpy (current_file_name, name);
#  368|       current_file = new_file;
#  369|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
groff-1.23.0/src/devices/xditview/xditview.c:480:5: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(name, "w")’
groff-1.23.0/src/devices/xditview/xditview.c:476:18: acquire_memory: allocated here
groff-1.23.0/src/devices/xditview/xditview.c:477:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/devices/xditview/xditview.c:480:5: branch_false: ...to here
groff-1.23.0/src/devices/xditview/xditview.c:480:5: throw: if ‘DviSaveToFile’ throws an exception...
groff-1.23.0/src/devices/xditview/xditview.c:480:5: danger: ‘popen(name, "w")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  478|   	/* XXX print error message */
#  479|   	return;
#  480|->     DviSaveToFile(dvi, print_file);
#  481|       pclose(print_file);
#  482|       signal(SIGPIPE, handler);

Error: COMPILER_WARNING: [#def53]
groff-1.23.0/src/libs/libdriver/printer.cpp:120:23: warning[-Wstringop-overflow=]: ‘__builtin_memset’ writing between 16 and 25769803768 bytes into a region of size 0 overflows the destination
#  120 |         font_table[i] = 0;
#      |                       ^
groff-1.23.0/src/libs/libdriver/printer.cpp:115:37: note: at offset [-8589934592, -8] into destination object of size [8, 17179869176] allocated by ‘operator new []’
#  115 |       font_table = new font *[nfonts];
#      |                                     ^
#  118|   	font_table[i] = old_font_table[i];
#  119|         for (i = old_nfonts; i < nfonts; i++)
#  120|-> 	font_table[i] = 0;
#  121|         delete[] old_font_table;
#  122|       }

Error: COMPILER_WARNING: [#def54]
groff-1.23.0/src/libs/libdriver/printer.cpp: scope_hint: In member function ‘printer::load_font(int, char const*)’
groff-1.23.0/src/libs/libdriver/printer.cpp:120:23: warning[-Wstringop-overflow=]: ‘memset’ writing between 16 and 25769803768 bytes into a region of size 0 overflows the destination
#  120 |         font_table[i] = 0;
#      |         ~~~~~~~~~~~~~~^~~
groff-1.23.0/src/libs/libdriver/printer.cpp:115:37: note: at offset [-8589934592, -8] into destination object of size [8, 17179869176] allocated by ‘operator new[](unsigned long)’
#  115 |       font_table = new font *[nfonts];
#      |                                     ^
#  118|   	font_table[i] = old_font_table[i];
#  119|         for (i = old_nfonts; i < nfonts; i++)
#  120|-> 	font_table[i] = 0;
#  121|         delete[] old_font_table;
#  122|       }

Error: COMPILER_WARNING (CWE-704): [#def55]
groff-1.23.0/src/libs/libgroff/getopt.c: scope_hint: In function ‘_getopt_internal_r’
groff-1.23.0/src/libs/libgroff/getopt.c:777:18: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  777 |     char *temp = strchr (optstring, c);
#      |                  ^~~~~~
#  775|     {
#  776|       char c = *d->__nextchar++;
#  777|->     char *temp = strchr (optstring, c);
#  778|   
#  779|       /* Increment 'optind' when we start to process its last character.  */

Error: COMPILER_WARNING (CWE-704): [#def56]
groff-1.23.0/src/libs/libgroff/getopt.c:777:18: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  775|     {
#  776|       char c = *d->__nextchar++;
#  777|->     char *temp = strchr (optstring, c);
#  778|   
#  779|       /* Increment 'optind' when we start to process its last character.  */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def57]
groff-1.23.0/src/libs/libgroff/getopt.c:907:46: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
groff-1.23.0/src/libs/libgroff/getopt.c:1166:1: enter_function: entry to ‘groff_getopt’
groff-1.23.0/src/libs/libgroff/getopt.c:1168:10: call_function: calling ‘_getopt_internal’ from ‘groff_getopt’
#  905|   	/* Test all long options for either exact match
#  906|   	   or abbreviated matches.  */
#  907|-> 	for (p = longopts, option_index = 0; p->name; p++, option_index++)
#  908|   	  if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
#  909|   	    {

Error: CPPCHECK_WARNING (CWE-476): [#def58]
groff-1.23.0/src/libs/libgroff/glyphuni.cpp:31: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   29|   
#   30|   declare_ptable(glyph_to_unicode)
#   31|-> implement_ptable(glyph_to_unicode)
#   32|   
#   33|   PTABLE(glyph_to_unicode) glyph_to_unicode_table;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
groff-1.23.0/src/libs/libgroff/localcharset.c:171:16: warning[-Wanalyzer-malloc-leak]: leak of ‘file_name’
groff-1.23.0/src/libs/libgroff/localcharset.c:129:6: branch_true: following ‘true’ branch (when ‘cp’ is NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:138:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:147:30: acquire_memory: allocated here
groff-1.23.0/src/libs/libgroff/localcharset.c:148:12: branch_true: following ‘true’ branch (when ‘file_name’ is non-NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:150:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:171:16: throw: if ‘open’ throws an exception...
groff-1.23.0/src/libs/libgroff/localcharset.c:171:16: danger: ‘file_name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  169|                some writable directory and defining the environment variable
#  170|                CHARSETALIASDIR to point to that directory.  */
#  171|->           fd = open (file_name,
#  172|                        O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
#  173|             if (fd < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
groff-1.23.0/src/libs/libgroff/localcharset.c:184:19: warning[-Wanalyzer-malloc-leak]: leak of ‘file_name’
groff-1.23.0/src/libs/libgroff/localcharset.c:129:6: branch_true: following ‘true’ branch (when ‘cp’ is NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:138:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:147:30: acquire_memory: allocated here
groff-1.23.0/src/libs/libgroff/localcharset.c:148:12: branch_true: following ‘true’ branch (when ‘file_name’ is non-NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:150:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:173:14: branch_false: following ‘false’ branch...
groff-1.23.0/src/libs/libgroff/localcharset.c:180:20: branch_false: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:181:18: branch_true: following ‘true’ branch (when ‘fp’ is NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:184:19: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:184:19: throw: if ‘close’ throws an exception...
groff-1.23.0/src/libs/libgroff/localcharset.c:184:19: danger: ‘file_name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  182|                   {
#  183|                     /* Out of memory.  Treat the file as empty.  */
#  184|->                   close (fd);
#  185|                     cp = "";
#  186|                   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
groff-1.23.0/src/libs/libgroff/localcharset.c:216:23: warning[-Wanalyzer-malloc-leak]: leak of ‘file_name’
groff-1.23.0/src/libs/libgroff/localcharset.c:124:1: enter_function: entry to ‘get_charset_aliases’
groff-1.23.0/src/libs/libgroff/localcharset.c:129:6: branch_true: following ‘true’ branch (when ‘cp’ is NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:138:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:147:30: acquire_memory: allocated here
groff-1.23.0/src/libs/libgroff/localcharset.c:148:12: branch_true: following ‘true’ branch (when ‘file_name’ is non-NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:150:13: branch_true: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:173:14: branch_false: following ‘false’ branch...
groff-1.23.0/src/libs/libgroff/localcharset.c:180:20: branch_false: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:181:18: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
groff-1.23.0/src/libs/libgroff/localcharset.c:181:18: branch_false: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:201:27: call_function: inlined call to ‘getc_unlocked’ from ‘get_charset_aliases’
groff-1.23.0/src/libs/libgroff/localcharset.c:202:26: branch_false: following ‘false’ branch...
groff-1.23.0/src/libs/libgroff/localcharset.c:204:27: branch_false: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:206:26: branch_false: following ‘false’ branch...
groff-1.23.0/src/libs/libgroff/localcharset.c:216:23: branch_false: ...to here
groff-1.23.0/src/libs/libgroff/localcharset.c:216:23: throw: if ‘ungetc’ throws an exception...
groff-1.23.0/src/libs/libgroff/localcharset.c:216:23: danger: ‘file_name’ leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  214|                             continue;
#  215|                           }
#  216|->                       ungetc (c, fp);
#  217|                         if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
#  218|                           break;

Error: CPPCHECK_WARNING (CWE-476): [#def62]
groff-1.23.0/src/libs/libgroff/nametoindex.cpp:40: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   38|   // PTABLE(charinfo) is a hash table mapping 'const char *' to 'charinfo *'.
#   39|   declare_ptable(charinfo)
#   40|-> implement_ptable(charinfo)
#   41|   
#   42|   // ITABLE(charinfo) is a hash table mapping 'int >= 0' to 'charinfo *'.

Error: CPPCHECK_WARNING (CWE-476): [#def63]
groff-1.23.0/src/libs/libgroff/relocate.cpp:217: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: relocated_path
#  215|   					+ relative_path_len + 1);
#  216|     assert(0 != curr_prefix);
#  217|->   strcpy(relocated_path, curr_prefix);
#  218|     strcat(relocated_path, relative_path);
#  219|   #if DEBUG

Error: CPPCHECK_WARNING (CWE-476): [#def64]
groff-1.23.0/src/libs/libgroff/relocate.cpp:218: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: relocated_path
#  216|     assert(0 != curr_prefix);
#  217|     strcpy(relocated_path, curr_prefix);
#  218|->   strcat(relocated_path, relative_path);
#  219|   #if DEBUG
#  220|     fprintf(stderr, "relocated_path: %s\n", relocated_path);

Error: CPPCHECK_WARNING (CWE-476): [#def65]
groff-1.23.0/src/libs/libgroff/uniglyph.cpp:31: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   29|   
#   30|   declare_ptable(unicode_to_glyph)
#   31|-> implement_ptable(unicode_to_glyph)
#   32|   
#   33|   PTABLE(unicode_to_glyph) unicode_to_glyph_table;

Error: CPPCHECK_WARNING (CWE-476): [#def66]
groff-1.23.0/src/libs/libgroff/uniuni.cpp:35: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   33|   
#   34|   declare_ptable(unicode_decompose)
#   35|-> implement_ptable(unicode_decompose)
#   36|   
#   37|   PTABLE(unicode_decompose) unicode_decompose_table;

Error: CPPCHECK_WARNING (CWE-476): [#def67]
groff-1.23.0/src/preproc/eqn/lex.cpp:53: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   51|   
#   52|   declare_ptable(definition)
#   53|-> implement_ptable(definition)
#   54|   
#   55|   PTABLE(definition) macro_table;

Error: COMPILER_WARNING (CWE-457): [#def68]
groff-1.23.0/src/preproc/eqn/lex.cpp: scope_hint: In function ‘get_delimited_text()’
groff-1.23.0/src/preproc/eqn/lex.cpp:709:30: warning[-Wmaybe-uninitialized]: ‘filename’ may be used uninitialized
#  709 |   last_seen_filename = strdup(filename);
#      |                        ~~~~~~^~~~~~~~~~
groff-1.23.0/src/preproc/eqn/lex.cpp:705:9: note: ‘filename’ declared here
#  705 |   char *filename, *last_seen_filename;
#      |         ^~~~~~~~
#  707|     int got_location = get_location(&filename, &lineno);
#  708|     // `filename` gets invalidated if we iterate off the end of the file.
#  709|->   last_seen_filename = strdup(filename);
#  710|     int start = get_char();
#  711|     while (start == ' ' || start == '\t' || start == '\n')

Error: CPPCHECK_WARNING (CWE-476): [#def69]
groff-1.23.0/src/preproc/eqn/text.cpp:483: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#  481|   
#  482|   declare_ptable(char_info)
#  483|-> implement_ptable(char_info)
#  484|   
#  485|   PTABLE(char_info) special_char_table;

Error: COMPILER_WARNING (CWE-457): [#def70]
groff-1.23.0/src/preproc/grn/hgraph.cpp: scope_hint: In function ‘PeriodicSpline(double*, int*, double*, double*, double*, int)’
groff-1.23.0/src/preproc/grn/hgraph.cpp:835:33: warning[-Wmaybe-uninitialized]: ‘deltaz’ may be used uninitialized
#  835 |   deltaz[0] = deltaz[npoints - 1];
#      |               ~~~~~~~~~~~~~~~~~~^
groff-1.23.0/src/preproc/grn/hgraph.cpp:826:10: note: ‘deltaz’ declared here
#  826 |   double deltaz[MAXPOINTS], a[MAXPOINTS], b[MAXPOINTS];
#      |          ^~~~~~
#  833|     }
#  834|     h[0] = h[npoints - 1];
#  835|->   deltaz[0] = deltaz[npoints - 1];
#  836|   
#  837|     /* step 2 */

Error: CPPCHECK_WARNING (CWE-476): [#def71]
groff-1.23.0/src/preproc/html/pre-html.cpp:1209: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1207|       i++;
# 1208|     }
# 1209|->   new_argv[i] = newarg;
# 1210|     while (i < argc) {
# 1211|       new_argv[i + 1] = argv[i];

Error: CPPCHECK_WARNING (CWE-476): [#def72]
groff-1.23.0/src/preproc/html/pre-html.cpp:1211: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1209|     new_argv[i] = newarg;
# 1210|     while (i < argc) {
# 1211|->     new_argv[i + 1] = argv[i];
# 1212|       i++;
# 1213|     }

Error: CPPCHECK_WARNING (CWE-476): [#def73]
groff-1.23.0/src/preproc/html/pre-html.cpp:1215: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1213|     }
# 1214|     argc++;
# 1215|->   new_argv[argc] = 0 /* nullptr */;
# 1216|     return new_argv;
# 1217|   }

Error: CPPCHECK_WARNING (CWE-476): [#def74]
groff-1.23.0/src/preproc/html/pre-html.cpp:1233: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1231|   
# 1232|     while (i < argc) {
# 1233|->     new_argv[i] = argv[i];
# 1234|       i++;
# 1235|     }

Error: CPPCHECK_WARNING (CWE-476): [#def75]
groff-1.23.0/src/preproc/html/pre-html.cpp:1236: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1234|       i++;
# 1235|     }
# 1236|->   new_argv[argc] = strsave(numReg);
# 1237|     argc++;
# 1238|     new_argv[argc] = 0 /* nullptr */;

Error: CPPCHECK_WARNING (CWE-476): [#def76]
groff-1.23.0/src/preproc/html/pre-html.cpp:1238: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_argv
# 1236|     new_argv[argc] = strsave(numReg);
# 1237|     argc++;
# 1238|->   new_argv[argc] = 0 /* nullptr */;
# 1239|     return new_argv;
# 1240|   }

Error: CPPCHECK_WARNING (CWE-457): [#def77]
groff-1.23.0/src/preproc/html/pre-html.cpp:1421: warning[uninitvar]: Uninitialized variable: wstatus
# 1419|   #endif /* MAY_FORK_CHILD_PROCESS or MAY_SPAWN_ASYNCHRONOUS_CHILD */
# 1420|   
# 1421|->   return wstatus;
# 1422|   }
# 1423|   

Error: COMPILER_WARNING: [#def78]
groff-1.23.0/src/preproc/html/pushback.cpp: scope_hint: In member function ‘int pushBackBuffer::readInt()’
groff-1.23.0/src/preproc/html/pushback.cpp:242:8: warning[-Wunused-but-set-variable=]: variable ‘c’ set but not used
#  242 |   int  c =0;
#      |        ^
#  240|   int pushBackBuffer::readInt (void)
#  241|   {
#  242|->   int  c =0;
#  243|     int  i =0;
#  244|     int  s =1;

Error: CPPCHECK_WARNING (CWE-476): [#def79]
groff-1.23.0/src/preproc/html/pushback.cpp:327: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: str
#  325|       buffer[i] = (char)0;
#  326|       str = (char *)malloc(strlen(buffer)+1);
#  327|->     strcpy(str, buffer);
#  328|     }
#  329|     return( str );

Error: CPPCHECK_WARNING (CWE-476): [#def80]
groff-1.23.0/src/preproc/pic/lex.cpp:26: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   24|   
#   25|   declare_ptable(char)
#   26|-> implement_ptable(char)
#   27|   
#   28|   PTABLE(char) macro_table;

Error: CPPCHECK_WARNING (CWE-416): [#def81]
groff-1.23.0/src/preproc/pic/main.cpp:320: error[deallocuse]: Dereferencing 'out' after it is deallocated / released
#  318|     normalize_for_lf(fn);
#  319|     current_filename = fn.contents();
#  320|->   out->set_location(current_filename, 1);
#  321|     current_lineno = 1;
#  322|     enum { START, MIDDLE, HAD_DOT, HAD_P, HAD_PS, HAD_l, HAD_lf } state = START;

Error: CPPCHECK_WARNING (CWE-476): [#def82]
groff-1.23.0/src/preproc/pic/main.cpp:324: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  322|     enum { START, MIDDLE, HAD_DOT, HAD_P, HAD_PS, HAD_l, HAD_lf } state = START;
#  323|     for (;;) {
#  324|->     int c = getc(fp);
#  325|       while (is_invalid_input_char(c)) {
#  326|         error("invalid input character code %1", int(c));

Error: COMPILER_WARNING (CWE-595): [#def83]
groff-1.23.0/src/preproc/refer/ref.cpp: scope_hint: In function ‘int same_reference(const reference&, const reference&)’
groff-1.23.0/src/preproc/refer/ref.cpp:539:24: warning[-Warray-compare]: comparison between two arrays is deprecated in C++20
#  539 |     if (r1.field_index != r2.field_index)
#      |         ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
groff-1.23.0/src/preproc/refer/ref.cpp:539:24: note: use unary ‘+’ which decays operands to pointers or ‘&(r1.reference::field_index)[0] != &(r2.reference::field_index)[0]’ to compare the addresses
#  537|     int i = 0; 
#  538|     for (i = 0; i < 256; i++)
#  539|->     if (r1.field_index != r2.field_index)
#  540|         return 0;
#  541|     for (i = 0; i < r1.nfields; i++)

Error: CPPCHECK_WARNING (CWE-476): [#def84]
groff-1.23.0/src/roff/groff/groff.cpp:648: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: name
#  646|     free(name);
#  647|     name = (char*)malloc(strlen(s1) + strlen(s2) + 1);
#  648|->   strcpy(name, s1);
#  649|     strcat(name, s2);
#  650|   }

Error: CPPCHECK_WARNING (CWE-476): [#def85]
groff-1.23.0/src/roff/groff/groff.cpp:649: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: name
#  647|     name = (char*)malloc(strlen(s1) + strlen(s2) + 1);
#  648|     strcpy(name, s1);
#  649|->   strcat(name, s2);
#  650|   }
#  651|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def86]
groff-1.23.0/src/roff/groff/pipeline.c:468:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:468:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: danger: ‘last_input’ leaks here
#  466|         /* child */
#  467|         if (last_input != 0) {
#  468|-> 	if (close(0) < 0)
#  469|   	  sys_fatal("close");
#  470|   	if (dup(last_input) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def87]
groff-1.23.0/src/roff/groff/pipeline.c:468:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:468:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: danger: ‘pdes[0]’ leaks here
#  466|         /* child */
#  467|         if (last_input != 0) {
#  468|-> 	if (close(0) < 0)
#  469|   	  sys_fatal("close");
#  470|   	if (dup(last_input) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def88]
groff-1.23.0/src/roff/groff/pipeline.c:468:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: release_resource: closed here
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:468:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: danger: ‘pdes[1]’ leaks here
#  466|         /* child */
#  467|         if (last_input != 0) {
#  468|-> 	if (close(0) < 0)
#  469|   	  sys_fatal("close");
#  470|   	if (dup(last_input) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
groff-1.23.0/src/roff/groff/pipeline.c:470:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(last_input)’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:470:13: acquire_resource: opened here
groff-1.23.0/src/roff/groff/pipeline.c:470:12: danger: ‘dup(last_input)’ leaks here; was opened at [(22)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/21)
#  468|   	if (close(0) < 0)
#  469|   	  sys_fatal("close");
#  470|-> 	if (dup(last_input) < 0)
#  471|   	  sys_fatal("dup");
#  472|   	if (close(last_input) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def90]
groff-1.23.0/src/roff/groff/pipeline.c:472:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:472:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:472:13: danger: ‘last_input’ leaks here
#  470|   	if (dup(last_input) < 0)
#  471|   	  sys_fatal("dup");
#  472|-> 	if (close(last_input) < 0)
#  473|   	  sys_fatal("close");
#  474|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def91]
groff-1.23.0/src/roff/groff/pipeline.c:472:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:472:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:472:13: danger: ‘pdes[0]’ leaks here
#  470|   	if (dup(last_input) < 0)
#  471|   	  sys_fatal("dup");
#  472|-> 	if (close(last_input) < 0)
#  473|   	  sys_fatal("close");
#  474|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def92]
groff-1.23.0/src/roff/groff/pipeline.c:472:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: release_resource: closed here
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:468:13: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:472:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:472:13: danger: ‘pdes[1]’ leaks here
#  470|   	if (dup(last_input) < 0)
#  471|   	  sys_fatal("dup");
#  472|-> 	if (close(last_input) < 0)
#  473|   	  sys_fatal("close");
#  474|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def93]
groff-1.23.0/src/roff/groff/pipeline.c:476:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:9: branch_true: following ‘true’ branch (when ‘no_pipe == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:459:11: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:460:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: danger: ‘last_input’ leaks here
#  474|         }
#  475|         if ((i != ncommands - 1) && !no_pipe) {
#  476|-> 	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|   	if (dup(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def94]
groff-1.23.0/src/roff/groff/pipeline.c:476:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: danger: ‘pdes[0]’ leaks here
#  474|         }
#  475|         if ((i != ncommands - 1) && !no_pipe) {
#  476|-> 	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|   	if (dup(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def95]
groff-1.23.0/src/roff/groff/pipeline.c:476:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: danger: ‘pdes[1]’ leaks here
#  474|         }
#  475|         if ((i != ncommands - 1) && !no_pipe) {
#  476|-> 	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|   	if (dup(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def96]
groff-1.23.0/src/roff/groff/pipeline.c:476:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[i]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:476:13: danger: ‘pdes[i]’ leaks here
#  474|         }
#  475|         if ((i != ncommands - 1) && !no_pipe) {
#  476|-> 	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|   	if (dup(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def97]
groff-1.23.0/src/roff/groff/pipeline.c:478:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup(pdes[1])’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:478:13: acquire_resource: opened here
groff-1.23.0/src/roff/groff/pipeline.c:478:12: danger: ‘dup(pdes[1])’ leaks here; was opened at [(14)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/13)
#  476|   	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|-> 	if (dup(pdes[1]) < 0)
#  479|   	  sys_fatal("dup");
#  480|   	if (close(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def98]
groff-1.23.0/src/roff/groff/pipeline.c:478:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:460:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:478:13: danger: use of uninitialized value ‘pdes[1]’ here
#  476|   	if (close(1) < 0)
#  477|   	  sys_fatal("close");
#  478|-> 	if (dup(pdes[1]) < 0)
#  479|   	  sys_fatal("dup");
#  480|   	if (close(pdes[1]) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def99]
groff-1.23.0/src/roff/groff/pipeline.c:480:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: danger: ‘pdes[0]’ leaks here
#  478|   	if (dup(pdes[1]) < 0)
#  479|   	  sys_fatal("dup");
#  480|-> 	if (close(pdes[1]) < 0)
#  481|   	  sys_fatal("close");
#  482|   	if (close(pdes[0]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def100]
groff-1.23.0/src/roff/groff/pipeline.c:480:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: danger: ‘pdes[1]’ leaks here
#  478|   	if (dup(pdes[1]) < 0)
#  479|   	  sys_fatal("dup");
#  480|-> 	if (close(pdes[1]) < 0)
#  481|   	  sys_fatal("close");
#  482|   	if (close(pdes[0]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def101]
groff-1.23.0/src/roff/groff/pipeline.c:480:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[i]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:480:13: danger: ‘pdes[i]’ leaks here
#  478|   	if (dup(pdes[1]) < 0)
#  479|   	  sys_fatal("dup");
#  480|-> 	if (close(pdes[1]) < 0)
#  481|   	  sys_fatal("close");
#  482|   	if (close(pdes[0]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def102]
groff-1.23.0/src/roff/groff/pipeline.c:482:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:482:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:482:13: danger: ‘pdes[0]’ leaks here
#  480|   	if (close(pdes[1]) < 0)
#  481|   	  sys_fatal("close");
#  482|-> 	if (close(pdes[0]))
#  483|   	  sys_fatal("close");
#  484|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def103]
groff-1.23.0/src/roff/groff/pipeline.c:482:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[i]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_true: following ‘true’ branch (when ‘pid == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:482:13: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:482:13: danger: ‘pdes[i]’ leaks here
#  480|   	if (close(pdes[1]) < 0)
#  481|   	  sys_fatal("close");
#  482|-> 	if (close(pdes[0]))
#  483|   	  sys_fatal("close");
#  484|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def104]
groff-1.23.0/src/roff/groff/pipeline.c:486:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:467:10: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:475:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:485:38: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:486:7: throw: if ‘c_error’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:486:7: danger: ‘last_input’ leaks here
#  484|         }
#  485|         execvp(commands[i][0], commands[i]);
#  486|->       c_error("couldn't exec %1: %2",
#  487|   	      commands[i][0], strerror(errno), (char *)0);
#  488|         if (strcmp(commands[i][0], "gxditview") == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def105]
groff-1.23.0/src/roff/groff/pipeline.c:494:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:494:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:494:11: danger: ‘last_input’ leaks here
#  492|       /* in the parent */
#  493|       if (last_input != 0) {
#  494|->       if (close(last_input) < 0)
#  495|   	sys_fatal("close");
#  496|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
groff-1.23.0/src/roff/groff/pipeline.c:494:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:494:11: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:494:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:494:11: danger: ‘pdes[0]’ leaks here
#  492|       /* in the parent */
#  493|       if (last_input != 0) {
#  494|->       if (close(last_input) < 0)
#  495|   	sys_fatal("close");
#  496|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
groff-1.23.0/src/roff/groff/pipeline.c:494:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: release_resource: closed here
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_true: following ‘true’ branch (when ‘last_input != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:494:11: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:494:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:494:11: danger: ‘pdes[1]’ leaks here
#  492|       /* in the parent */
#  493|       if (last_input != 0) {
#  494|->       if (close(last_input) < 0)
#  495|   	sys_fatal("close");
#  496|       }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def108]
groff-1.23.0/src/roff/groff/pipeline.c:498:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: danger: ‘pdes[0]’ leaks here
#  496|       }
#  497|       if ((i != ncommands - 1) && !no_pipe) {
#  498|->       if (close(pdes[1]) < 0)
#  499|   	sys_fatal("close");
#  500|         last_input = pdes[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def109]
groff-1.23.0/src/roff/groff/pipeline.c:498:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: danger: ‘pdes[1]’ leaks here
#  496|       }
#  497|       if ((i != ncommands - 1) && !no_pipe) {
#  498|->       if (close(pdes[1]) < 0)
#  499|   	sys_fatal("close");
#  500|         last_input = pdes[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def110]
groff-1.23.0/src/roff/groff/pipeline.c:498:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[i]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: throw: if ‘close’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: danger: ‘pdes[i]’ leaks here
#  496|       }
#  497|       if ((i != ncommands - 1) && !no_pipe) {
#  498|->       if (close(pdes[1]) < 0)
#  499|   	sys_fatal("close");
#  500|         last_input = pdes[0];

Error: GCC_ANALYZER_WARNING (CWE-457): [#def111]
groff-1.23.0/src/roff/groff/pipeline.c:498:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:460:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:11: danger: use of uninitialized value ‘pdes[1]’ here
#  496|       }
#  497|       if ((i != ncommands - 1) && !no_pipe) {
#  498|->       if (close(pdes[1]) < 0)
#  499|   	sys_fatal("close");
#  500|         last_input = pdes[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def112]
groff-1.23.0/src/roff/groff/pipeline.c:506:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:504:10: branch_true: following ‘true’ branch (when ‘proc_count > 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:506:17: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:506:17: throw: if ‘wait’ throws an exception...
groff-1.23.0/src/roff/groff/pipeline.c:506:17: danger: ‘last_input’ leaks here
#  504|     while (proc_count > 0) {
#  505|       int status;
#  506|->     PID_T pid = wait(&status);
#  507|   
#  508|       if (pid < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def113]
groff-1.23.0/src/roff/groff/pipeline.c:565:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘last_input’
groff-1.23.0/src/roff/groff/pipeline.c:446:5: enter_function: entry to ‘run_pipeline’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:504:10: branch_true: following ‘true’ branch (when ‘proc_count > 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:506:17: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:508:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:509:7: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:509:7: call_function: calling ‘sys_fatal’ from ‘run_pipeline’
#  563|   static void sys_fatal(const char *s)
#  564|   {
#  565|->   c_fatal("%1: %2", s, strerror(errno), (char *)0);
#  566|   }
#  567|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def114]
groff-1.23.0/src/roff/groff/pipeline.c:565:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[0]’
groff-1.23.0/src/roff/groff/pipeline.c:446:5: enter_function: entry to ‘run_pipeline’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:465:8: branch_false: following ‘false’ branch (when ‘pid != 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:493:8: branch_false: following ‘false’ branch (when ‘last_input == 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:497:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:498:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:499:9: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_true: following ‘true’ branch (when ‘pid < 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:464:7: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:464:7: call_function: calling ‘sys_fatal’ from ‘run_pipeline’
#  563|   static void sys_fatal(const char *s)
#  564|   {
#  565|->   c_fatal("%1: %2", s, strerror(errno), (char *)0);
#  566|   }
#  567|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def115]
groff-1.23.0/src/roff/groff/pipeline.c:565:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[1]’
groff-1.23.0/src/roff/groff/pipeline.c:446:5: enter_function: entry to ‘run_pipeline’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_true: following ‘true’ branch (when ‘pid < 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:464:7: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:464:7: call_function: calling ‘sys_fatal’ from ‘run_pipeline’
#  563|   static void sys_fatal(const char *s)
#  564|   {
#  565|->   c_fatal("%1: %2", s, strerror(errno), (char *)0);
#  566|   }
#  567|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def116]
groff-1.23.0/src/roff/groff/pipeline.c:565:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pdes[i]’
groff-1.23.0/src/roff/groff/pipeline.c:446:5: enter_function: entry to ‘run_pipeline’
groff-1.23.0/src/roff/groff/pipeline.c:454:15: branch_true: following ‘true’ branch (when ‘i < ncommands’)...
groff-1.23.0/src/roff/groff/pipeline.c:458:15: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:458:8: branch_true: following ‘true’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:459:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/roff/groff/pipeline.c:462:11: branch_false: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:463:8: branch_true: following ‘true’ branch (when ‘pid < 0’)...
groff-1.23.0/src/roff/groff/pipeline.c:464:7: branch_true: ...to here
groff-1.23.0/src/roff/groff/pipeline.c:464:7: call_function: calling ‘sys_fatal’ from ‘run_pipeline’
#  563|   static void sys_fatal(const char *s)
#  564|   {
#  565|->   c_fatal("%1: %2", s, strerror(errno), (char *)0);
#  566|   }
#  567|   

Error: CPPCHECK_WARNING (CWE-401): [#def117]
groff-1.23.0/src/roff/troff/env.cpp:1260: error[memleak]: Memory leak: sizes
# 1258|     char *buf = read_string();
# 1259|     if (!buf)
# 1260|->     return;
# 1261|     char *p = strtok(buf, " \t");
# 1262|     for (;;) {

Error: COMPILER_WARNING: [#def118]
groff-1.23.0/src/roff/troff/node.cpp: scope_hint: In function ‘tfont* make_tfont(tfont_spec&)’
groff-1.23.0/src/roff/troff/node.cpp:277:15: warning: C++20 says that these are ambiguous, even though the second is reversed:
#  277 |     if (*p == spec)
#      |               ^~~~
groff-1.23.0/src/roff/troff/node.cpp:194:7: note: candidate 1: ‘int tfont_spec::operator==(const tfont_spec&)’
#  194 |   int operator==(const tfont_spec &);
#      |       ^~~~~~~~
groff-1.23.0/src/roff/troff/node.cpp:194:7: note: candidate 2: ‘int tfont_spec::operator==(const tfont_spec&)’ (reversed)
groff-1.23.0/src/roff/troff/node.cpp:194:7: note: try making the operator a ‘const’ member function
#  275|   {
#  276|     for (tfont *p = tfont::tfont_list; p; p = p->next)
#  277|->     if (*p == spec)
#  278|         return p;
#  279|     return new tfont(spec);

Error: COMPILER_WARNING: [#def119]
groff-1.23.0/src/roff/troff/node.cpp: scope_hint: In constructor ‘tfont::tfont(tfont_spec&)’
groff-1.23.0/src/roff/troff/node.cpp:713:15: warning: C++20 says that these are ambiguous, even though the second is reversed:
#  713 |     if (*p == plain_spec) {
#      |               ^~~~~~~~~~
groff-1.23.0/src/roff/troff/node.cpp:493:5: note: candidate 1: ‘int tfont_spec::operator==(const tfont_spec&)’
#  493 | int tfont_spec::operator==(const tfont_spec &spec)
#      |     ^~~~~~~~~~
groff-1.23.0/src/roff/troff/node.cpp:493:5: note: candidate 2: ‘int tfont_spec::operator==(const tfont_spec&)’ (reversed)
groff-1.23.0/src/roff/troff/node.cpp:493:5: note: try making the operator a ‘const’ member function
#  711|     tfont *p;
#  712|     for (p = tfont_list; p; p = p->next)
#  713|->     if (*p == plain_spec) {
#  714|         plain_version = p;
#  715|         break;

Error: CPPCHECK_WARNING (CWE-476): [#def120]
groff-1.23.0/src/roff/troff/node.cpp:4128: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_name
# 4126|   	  fatal("memory allocation failure");
# 4127|   	ptrdiff_t prefix_length = percent_position - image_filename;
# 4128|-> 	strncpy(new_name, image_filename, prefix_length);
# 4129|   	sprintf(subimage_number, "%d", subimage_counter);
# 4130|   	size_t number_length = strlen(subimage_number);

Error: CPPCHECK_WARNING (CWE-682): [#def121]
groff-1.23.0/src/roff/troff/node.cpp:4131: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
# 4129|   	sprintf(subimage_number, "%d", subimage_counter);
# 4130|   	size_t number_length = strlen(subimage_number);
# 4131|-> 	strcpy(new_name + prefix_length, subimage_number);
# 4132|   	// Skip over the format in the source string.
# 4133|   	const char *suffix_src = image_filename + prefix_length

Error: CPPCHECK_WARNING (CWE-682): [#def122]
groff-1.23.0/src/roff/troff/node.cpp:4135: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
# 4133|   	const char *suffix_src = image_filename + prefix_length
# 4134|   	  + format_len;
# 4135|-> 	char *suffix_dst = new_name + prefix_length + number_length;
# 4136|   	strcpy(suffix_dst, suffix_src);
# 4137|   	// Ensure the new string fits with room for a terminal '\0'.

Error: CPPCHECK_WARNING (CWE-476): [#def123]
groff-1.23.0/src/roff/troff/node.cpp:4138: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: new_name
# 4136|   	strcpy(suffix_dst, suffix_src);
# 4137|   	// Ensure the new string fits with room for a terminal '\0'.
# 4138|-> 	const size_t len = strlen(new_name);
# 4139|   	if (len > (namebuflen - 1))
# 4140|   	  error("constructed file name in suppressed output escape"

Error: CPPCHECK_WARNING (CWE-476): [#def124]
groff-1.23.0/src/utils/hpftodit/hpuni.cpp:31: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: temp
#   29|   
#   30|   declare_ptable(hp_msl_to_unicode)
#   31|-> implement_ptable(hp_msl_to_unicode)
#   32|   
#   33|   PTABLE(hp_msl_to_unicode) hp_msl_to_unicode_table;

Error: CPPCHECK_WARNING (CWE-476): [#def125]
groff-1.23.0/src/utils/indxbib/indxbib.cpp:261: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  259|       for (;;) {
#  260|         int c;
#  261|->       for (c = getc(fp); c != '\n' && c != EOF; c = getc(fp)) {
#  262|   	if (c == '\0')
#  263|   	  error_with_file_and_line(foption, lineno,

Error: CPPCHECK_WARNING (CWE-476): [#def126]
groff-1.23.0/src/utils/indxbib/indxbib.cpp:398: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  396|     int key_len = 0;
#  397|     for (;;) {
#  398|->     int c = getc(fp);
#  399|       while (c != EOF && !csalnum(c))
#  400|         c = getc(fp);

Error: CPPCHECK_WARNING (CWE-404): [#def127]
groff-1.23.0/src/utils/tfmtodit/tfmtodit.cpp:425: error[resourceLeak]: Resource leak: fp
#  423|     if (getc(fp) != pre || getc(fp) != gf_id_byte) {
#  424|       error("bad gf file");
#  425|->     return 0;
#  426|     }
#  427|     int n = getc(fp);

Error: CPPCHECK_WARNING (CWE-457): [#def128]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:109: error[legacyUninitvar]: Uninitialized variable: name1
#  107|   
#  108|     for (i = 0; i < count; i++) {
#  109|->     if (!CanonicalizeFontName(names[i], 0 == i ? name1 : name2)) {
#  110|         fprintf(stderr, "%s: invalid font name: \"%s\"\n", program_name,
#  111|   	      names[i]);

Error: CPPCHECK_WARNING (CWE-457): [#def129]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:109: error[legacyUninitvar]: Uninitialized variable: name2
#  107|   
#  108|     for (i = 0; i < count; i++) {
#  109|->     if (!CanonicalizeFontName(names[i], 0 == i ? name1 : name2)) {
#  110|         fprintf(stderr, "%s: invalid font name: \"%s\"\n", program_name,
#  111|   	      names[i]);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:215:10: warning[-Wanalyzer-malloc-leak]: leak of ‘file_name’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  213|       int fd;
#  214|       (void) unlink(file_name);
#  215|->     fd = open(file_name, O_WRONLY | O_CREAT | O_EXCL, 0600);
#  216|       out = fdopen(fd, "w");
#  217|     }

Error: GCC_ANALYZER_WARNING (CWE-590): [#def131]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:222:5: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘file_name’ which points to memory on the stack
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  220|       fprintf(stderr, "%s: unable to create '%s': %s\n", program_name,
#  221|   	    file_name, strerror(errno));
#  222|->     free(file_name);
#  223|       return false;
#  224|     }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:264:3: warning[-Wanalyzer-malloc-leak]: leak of ‘file_name’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  262|       }
#  263|     }
#  264|->   XUnloadFont(dpy, fi->fid);
#  265|     fclose(out);
#  266|     free(file_name);

Error: GCC_ANALYZER_WARNING (CWE-590): [#def133]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:266:3: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘file_name’ which points to memory on the stack
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  264|     XUnloadFont(dpy, fi->fid);
#  265|     fclose(out);
#  266|->   free(file_name);
#  267|     return true;
#  268|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "r")’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:9: acquire_resource: opened here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: danger: ‘fopen(*<unknown>, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  343|     }
#  344|   
#  345|->   while (fgets(line, sizeof(line), map)) {
#  346|       for (a = line, b = troff_name; *a; a++, b++) {
#  347|         c = (*b = *a);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "r")’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:9: acquire_memory: allocated here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: danger: ‘fopen(*<unknown>, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  343|     }
#  344|   
#  345|->   while (fgets(line, sizeof(line), map)) {
#  346|       for (a = line, b = troff_name; *a; a++, b++) {
#  347|         c = (*b = *a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def136]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:36: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "r")’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:9: acquire_resource: opened here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  344|   
#  345|     while (fgets(line, sizeof(line), map)) {
#  346|->     for (a = line, b = troff_name; *a; a++, b++) {
#  347|         c = (*b = *a);
#  348|         if (' ' == c || '\t' == c)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:36: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "r")’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:280:5: enter_function: entry to ‘main’
groff-1.23.0/src/utils/xtotroff/xtotroff.c:325:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:330:9: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:331:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:19: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:338:9: acquire_memory: allocated here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:339:6: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:345:10: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:348:10: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:346:40: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:18: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: following ‘false’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:352:12: branch_false: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:354:25: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:11: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:355:10: branch_true: following ‘true’ branch...
groff-1.23.0/src/utils/xtotroff/xtotroff.c:357:5: branch_true: ...to here
groff-1.23.0/src/utils/xtotroff/xtotroff.c:358:10: call_function: calling ‘MapFont’ from ‘main’
#  344|   
#  345|     while (fgets(line, sizeof(line), map)) {
#  346|->     for (a = line, b = troff_name; *a; a++, b++) {
#  347|         c = (*b = *a);
#  348|         if (' ' == c || '\t' == c)

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-16.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namegroff-1.23.0-11.fc44
store-results-to/tmp/tmp64ppse4f/groff-1.23.0-11.fc44.tar.xz
time-created2026-01-08 16:51:52
time-finished2026-01-08 16:54:16
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp64ppse4f/groff-1.23.0-11.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp64ppse4f/groff-1.23.0-11.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9