ncurses-6.5-8.20250614.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/usr/bin/ncurses6-config:44:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   42|   bindir="/usr/bin"
#   43|   includedir="/usr/include"
#   44|-> datarootdir="${prefix}/share"
#   45|   datadir="/usr/share"
#   46|   mandir="/usr/share/man"

Error: SHELLCHECK_WARNING (CWE-457): [#def2]
/usr/bin/ncurses6-config:50:13: warning[SC2154]: libdir is referenced but not assigned.
#   48|   THIS="ncurses"
#   49|   TINFO_LIB="tinfo"
#   50|-> RPATH_LIST="${libdir}"
#   51|   
#   52|   # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.

Error: SHELLCHECK_WARNING (CWE-398): [#def3]
/usr/bin/ncurses6-config:79:11: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   77|   # the headers to include like this:
#   78|   #	<ncurses/curses.h>
#   79|-> if [ xyes = xno ]; then
#   80|   	includesubdir="/usr/include/${THIS}"
#   81|   	case $includedir in

Error: SHELLCHECK_WARNING (CWE-691): [#def4]
/usr/bin/ncurses6-config:82:2: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#   80|   	includesubdir="/usr/include/${THIS}"
#   81|   	case $includedir in
#   82|-> 	$prefix/include/ncurses)
#   83|   		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
#   84|   		;;

Error: SHELLCHECK_WARNING (CWE-398): [#def5]
/usr/bin/ncurses6-config:91:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   89|   
#   90|   LIBS=""
#   91|-> if [ "tinfo" = "ncurses" ]; then
#   92|   	LIBS="-l${THIS} $LIBS"
#   93|   else

Error: SHELLCHECK_WARNING (CWE-398): [#def6]
/usr/bin/ncurses6-config:101:10: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   99|   	CFLAGS="$CFLAGS -I${includesubdir}"
#  100|   	if [ "$includedir" != "/usr/include" ]; then
#  101|-> 		[ xyes = xno ] && CFLAGS="$CFLAGS -I${includedir}"
#  102|   	fi
#  103|   fi

Error: SHELLCHECK_WARNING (CWE-398): [#def7]
/usr/bin/ncurses6-config:318:15: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  316|   	--includedir)
#  317|   		INCS=
#  318|-> 		if [ "xyes" = xno ]; then
#  319|   			INCS="${includesubdir}"
#  320|   		elif [ "${includedir}" != /usr/include ]; then

Error: SHELLCHECK_WARNING (CWE-563): [#def8]
/usr/bin/ncursesw6-config:44:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   42|   bindir="/usr/bin"
#   43|   includedir="/usr/include"
#   44|-> datarootdir="${prefix}/share"
#   45|   datadir="/usr/share"
#   46|   mandir="/usr/share/man"

Error: SHELLCHECK_WARNING (CWE-457): [#def9]
/usr/bin/ncursesw6-config:50:13: warning[SC2154]: libdir is referenced but not assigned.
#   48|   THIS="ncursesw"
#   49|   TINFO_LIB="tinfo"
#   50|-> RPATH_LIST="${libdir}"
#   51|   
#   52|   # Ensure that RPATH_LIST contains only absolute pathnames, if it is nonempty.

Error: SHELLCHECK_WARNING (CWE-398): [#def10]
/usr/bin/ncursesw6-config:79:11: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   77|   # the headers to include like this:
#   78|   #	<ncursesw/curses.h>
#   79|-> if [ xyes = xno ]; then
#   80|   	includesubdir="/usr/include/${THIS}"
#   81|   	case $includedir in

Error: SHELLCHECK_WARNING (CWE-691): [#def11]
/usr/bin/ncursesw6-config:82:2: warning[SC2254]: Quote expansions in case patterns to match literally rather than as a glob.
#   80|   	includesubdir="/usr/include/${THIS}"
#   81|   	case $includedir in
#   82|-> 	$prefix/include/ncursesw)
#   83|   		includedir=`echo "$includedir" | sed -e 's,/[^/]*$,,'`
#   84|   		;;

Error: SHELLCHECK_WARNING (CWE-398): [#def12]
/usr/bin/ncursesw6-config:91:14: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   89|   
#   90|   LIBS=""
#   91|-> if [ "tinfo" = "ncurses" ]; then
#   92|   	LIBS="-l${THIS} $LIBS"
#   93|   else

Error: SHELLCHECK_WARNING (CWE-398): [#def13]
/usr/bin/ncursesw6-config:101:10: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#   99|   	CFLAGS="$CFLAGS -I${includesubdir}"
#  100|   	if [ "$includedir" != "/usr/include" ]; then
#  101|-> 		[ xyes = xno ] && CFLAGS="$CFLAGS -I${includedir}"
#  102|   	fi
#  103|   fi

Error: SHELLCHECK_WARNING (CWE-398): [#def14]
/usr/bin/ncursesw6-config:318:15: warning[SC2050]: This expression is constant. Did you forget the $ on a variable?
#  316|   	--includedir)
#  317|   		INCS=
#  318|-> 		if [ "xyes" = xno ]; then
#  319|   			INCS="${includesubdir}"
#  320|   		elif [ "${includedir}" != /usr/include ]; then

Error: COMPILER_WARNING (CWE-569): [#def15]
ncurses-6.5-20250614/configure: scope_hint: In function 'int main()'
ncurses-6.5-20250614/configure:27168:18: warning[-Wbool-compare]: comparison of constant '0' with boolean expression is always true
#27168 | fi
#      |                  ^   
#27166|   cat "conftest.$ac_ext" >&5
#27167|   cf_cv_type_of_bool=unknown
#27168|-> fi
#27169|   rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext"
#27170|   fi

Error: COMPILER_WARNING (CWE-563): [#def16]
ncurses-6.5-20250614/configure: scope_hint: In function 'int main()'
ncurses-6.5-20250614/configure:27449:14: warning[-Wunused-variable]: unused variable 'p_UserData'
#27449 | 
#      |              ^         
#27447|   main (void)
#27448|   {
#27449|-> 
#27450|   	const char* p_UserData = static_cast<char*>(0)
#27451|     ;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
ncurses-6.5-20250614/form/fld_def.c:156:43: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/form/fld_def.c:276:1: enter_function: entry to ‘new_field’
ncurses-6.5-20250614/form/fld_def.c:285:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:287:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:289:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:292:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_def.c:295:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:308:29: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_def.c:311:11: call_function: calling ‘_nc_Copy_Type’ from ‘new_field’
#  154|   	  if (typ->copyarg != (void *)0)
#  155|   	    {
#  156|-> 	      if (!(res = (TypeArgument *)(typ->copyarg((const void *)argp))))
#  157|   		{
#  158|   		  *err += 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
ncurses-6.5-20250614/form/fld_def.c:156:43: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_def.c:276:1: enter_function: entry to ‘new_field’
ncurses-6.5-20250614/form/fld_def.c:285:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:287:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:289:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:292:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:292:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_def.c:295:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:311:11: call_function: calling ‘_nc_Copy_Type’ from ‘new_field’
#  154|   	  if (typ->copyarg != (void *)0)
#  155|   	    {
#  156|-> 	      if (!(res = (TypeArgument *)(typ->copyarg((const void *)argp))))
#  157|   		{
#  158|   		  *err += 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
ncurses-6.5-20250614/form/fld_def.c:156:43: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
ncurses-6.5-20250614/form/fld_def.c:276:1: enter_function: entry to ‘new_field’
ncurses-6.5-20250614/form/fld_def.c:285:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:287:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:289:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:292:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_def.c:295:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:311:11: call_function: calling ‘_nc_Copy_Type’ from ‘new_field’
#  154|   	  if (typ->copyarg != (void *)0)
#  155|   	    {
#  156|-> 	      if (!(res = (TypeArgument *)(typ->copyarg((const void *)argp))))
#  157|   		{
#  158|   		  *err += 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
ncurses-6.5-20250614/form/fld_def.c:294:7: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_def.c:285:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:287:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:289:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:292:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:292:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_def.c:294:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:294:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:294:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:294:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fld_def.c:294:7: danger: ‘New_Field’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  292|         (New_Field = typeMalloc(FIELD, 1)) != NULL)
#  293|       {
#  294|->       T((T_CREATE("field %p"), (void *)New_Field));
#  295|         *New_Field = default_field;
#  296|         New_Field->rows = (short)rows;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
ncurses-6.5-20250614/form/fld_def.c:307:28: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_def.c:285:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:287:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:289:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_def.c:292:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:292:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_def.c:285:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_def.c:295:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_def.c:307:28: throw: if ‘newpad’ throws an exception...
ncurses-6.5-20250614/form/fld_def.c:307:28: danger: ‘New_Field’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  305|   
#  306|   #if USE_WIDEC_SUPPORT
#  307|->       New_Field->working = newpad(1, Buffer_Length(New_Field) + 1);
#  308|         New_Field->expanded = typeCalloc(char *, 1 + (unsigned)nbuf);
#  309|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
ncurses-6.5-20250614/form/fld_dup.c:62:7: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_dup.c:58:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_dup.c:60:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_dup.c:58:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_dup.c:62:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_dup.c:62:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_dup.c:62:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_dup.c:62:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fld_dup.c:62:7: danger: ‘New_Field’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   60|         (New_Field = typeMalloc(FIELD, 1)))
#   61|       {
#   62|->       T((T_CREATE("field %p"), (void *)New_Field));
#   63|         *New_Field = *_nc_Default_Field;
#   64|         New_Field->frow = (short)frow;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
ncurses-6.5-20250614/form/fld_dup.c:81:11: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_dup.c:58:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_dup.c:60:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_dup.c:58:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_dup.c:63:20: branch_true: ...to here
ncurses-6.5-20250614/form/fld_dup.c:81:11: throw: if ‘_nc_Copy_Type’ throws an exception...
ncurses-6.5-20250614/form/fld_dup.c:81:11: danger: ‘New_Field’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   79|         New_Field->usrptr = field->usrptr;
#   80|   
#   81|->       if (_nc_Copy_Type(New_Field, field))
#   82|   	{
#   83|   	  size_t len;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: warning[-Wanalyzer-malloc-leak]: leak of ‘nftyp’
ncurses-6.5-20250614/form/fld_ftlink.c:58:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_ftlink.c:60:15: branch_true: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:60:15: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_ftlink.c:62:10: branch_true: following ‘true’ branch (when ‘nftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: danger: ‘nftyp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   62|         if (nftyp)
#   63|   	{
#   64|-> 	  T((T_CREATE("fieldtype %p"), (void *)nftyp));
#   65|   	  *nftyp = *_nc_Default_FieldType;
#   66|   	  SetStatus(nftyp, _LINKED_TYPE);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
ncurses-6.5-20250614/form/fld_ftlink.c:85:3: warning[-Wanalyzer-malloc-leak]: leak of ‘nftyp’
ncurses-6.5-20250614/form/fld_ftlink.c:58:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_ftlink.c:60:15: branch_true: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:60:15: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_ftlink.c:62:10: branch_true: following ‘true’ branch (when ‘nftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:64:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/fld_ftlink.c:65:20: branch_false: ...to here
ncurses-6.5-20250614/form/fld_ftlink.c:85:3: throw: if ‘_nc_retrace_field_type’ throws an exception...
ncurses-6.5-20250614/form/fld_ftlink.c:85:3: danger: ‘nftyp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   83|         SET_ERROR(E_BAD_ARGUMENT);
#   84|       }
#   85|->   returnFieldType(nftyp);
#   86|   }
#   87|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
ncurses-6.5-20250614/form/fld_link.c:63:7: warning[-Wanalyzer-malloc-leak]: leak of ‘New_Field’
ncurses-6.5-20250614/form/fld_link.c:59:6: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_link.c:61:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_link.c:59:7: branch_true: following ‘true’ branch (when ‘New_Field’ is non-NULL)...
ncurses-6.5-20250614/form/fld_link.c:63:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_link.c:63:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_link.c:63:7: branch_true: ...to here
ncurses-6.5-20250614/form/fld_link.c:63:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fld_link.c:63:7: danger: ‘New_Field’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   61|         (New_Field = typeMalloc(FIELD, 1)))
#   62|       {
#   63|->       T((T_CREATE("field %p"), (void *)New_Field));
#   64|         *New_Field = *_nc_Default_Field;
#   65|         New_Field->frow = (short)frow;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: warning[-Wanalyzer-malloc-leak]: leak of ‘nftyp’
ncurses-6.5-20250614/form/fld_newftyp.c:88:15: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_newftyp.c:90:10: branch_true: following ‘true’ branch (when ‘nftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: danger: ‘nftyp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   90|         if (nftyp)
#   91|   	{
#   92|-> 	  T((T_CREATE("fieldtype %p"), (void *)nftyp));
#   93|   	  *nftyp = default_fieldtype;
#   94|   #if NCURSES_INTEROP_FUNCS

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
ncurses-6.5-20250614/form/fld_newftyp.c:111:3: warning[-Wanalyzer-malloc-leak]: leak of ‘nftyp’
ncurses-6.5-20250614/form/fld_newftyp.c:88:15: acquire_memory: allocated here
ncurses-6.5-20250614/form/fld_newftyp.c:90:10: branch_true: following ‘true’ branch (when ‘nftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: branch_true: ...to here
ncurses-6.5-20250614/form/fld_newftyp.c:92:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/fld_newftyp.c:93:11: branch_false: ...to here
ncurses-6.5-20250614/form/fld_newftyp.c:111:3: throw: if ‘_nc_retrace_field_type’ throws an exception...
ncurses-6.5-20250614/form/fld_newftyp.c:111:3: danger: ‘nftyp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  109|         SET_ERROR(E_BAD_ARGUMENT);
#  110|       }
#  111|->   returnFieldType(nftyp);
#  112|   }
#  113|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def29]
ncurses-6.5-20250614/form/fld_type.c:61:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/form/fld_type.c:58:3: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/form/fld_type.c:61:3: throw: if ‘_nc_Free_Type’ throws an exception...
ncurses-6.5-20250614/form/fld_type.c:61:3: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   59|   
#   60|     Normalize_Field(field);
#   61|->   _nc_Free_Type(field);
#   62|   
#   63|     field->type = type;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
ncurses-6.5-20250614/form/frm_def.c:191:7: warning[-Wanalyzer-malloc-leak]: leak of ‘pg’
ncurses-6.5-20250614/form/frm_def.c:178:10: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:180:10: branch_false: ...to here
ncurses-6.5-20250614/form/frm_def.c:180:10: branch_true: following ‘true’ branch (when ‘field_cnt == 0’)...
ncurses-6.5-20250614/form/frm_def.c:182:9: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:185:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:189:13: acquire_memory: allocated here
ncurses-6.5-20250614/form/frm_def.c:189:6: branch_true: following ‘true’ branch (when ‘pg’ is non-NULL)...
ncurses-6.5-20250614/form/frm_def.c:191:7: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:191:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/frm_def.c:191:7: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:191:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/frm_def.c:191:7: danger: ‘pg’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  189|     if ((pg = typeMalloc(_PAGE, page_nr)) != (_PAGE *) 0)
#  190|       {
#  191|->       T((T_CREATE("_PAGE %p"), (void *)pg));
#  192|         form->page = pg;
#  193|       }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def31]
ncurses-6.5-20250614/form/frm_def.c:234:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>.pmin’
ncurses-6.5-20250614/form/frm_def.c:178:10: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:180:10: branch_false: ...to here
ncurses-6.5-20250614/form/frm_def.c:180:10: branch_true: following ‘true’ branch (when ‘field_cnt == 0’)...
ncurses-6.5-20250614/form/frm_def.c:182:9: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:178:10: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:180:10: branch_false: ...to here
ncurses-6.5-20250614/form/frm_def.c:185:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:189:6: branch_true: following ‘true’ branch (when ‘pg’ is non-NULL)...
ncurses-6.5-20250614/form/frm_def.c:191:7: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:191:7: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_def.c:192:7: branch_false: ...to here
ncurses-6.5-20250614/form/frm_def.c:199:15: branch_false: following ‘false’ branch (when ‘field_cnt <= j’)...
ncurses-6.5-20250614/form/frm_def.c:225:21: branch_false: ...to here
ncurses-6.5-20250614/form/frm_def.c:230:21: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/frm_def.c:234:26: branch_true: ...to here
ncurses-6.5-20250614/form/frm_def.c:234:16: danger: use of uninitialized value ‘*<unknown>.pmin’ here
#  232|         FIELD *fld = (FIELD *)0;
#  233|   
#  234|->       for (j = form->page[page_nr].pmin; j <= form->page[page_nr].pmax; j++)
#  235|   	{
#  236|   	  fields[j]->index = (short)j;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
ncurses-6.5-20250614/form/frm_def.c:314:11: warning[-Wanalyzer-malloc-leak]: leak of ‘form’
ncurses-6.5-20250614/form/frm_def.c:350:1: enter_function: entry to ‘new_form’
ncurses-6.5-20250614/form/frm_def.c:352:10: call_function: calling ‘new_form_sp’ from ‘new_form’
#  312|         if (form)
#  313|   	{
#  314|-> 	  T((T_CREATE("form %p"), (void *)form));
#  315|   	  *form = *_nc_Default_Form;
#  316|   	  /* This ensures win and sub are always non-null,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
ncurses-6.5-20250614/form/frm_driver.c:714:11: warning[-Wanalyzer-malloc-leak]: leak of ‘newbuf’
ncurses-6.5-20250614/form/frm_driver.c:675:10: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/frm_driver.c:677:20: branch_true: ...to here
ncurses-6.5-20250614/form/frm_driver.c:681:14: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:694:20: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:695:30: acquire_memory: allocated here
ncurses-6.5-20250614/form/frm_driver.c:696:10: branch_false: following ‘false’ branch (when ‘newbuf’ is non-NULL)...
ncurses-6.5-20250614/form/frm_driver.c:714:11: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:714:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/frm_driver.c:714:11: branch_true: ...to here
ncurses-6.5-20250614/form/frm_driver.c:714:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/frm_driver.c:714:11: danger: ‘newbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  712|   	  result = TRUE;	/* allow sharing of recovery on failure */
#  713|   
#  714|-> 	  T((T_CREATE("fieldcell %p"), (void *)newbuf));
#  715|   	  field->buf = newbuf;
#  716|   	  for (i = 0; i <= field->nbuf; i++)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
ncurses-6.5-20250614/form/frm_driver.c:729:15: warning[-Wanalyzer-malloc-leak]: leak of ‘newbuf’
ncurses-6.5-20250614/form/frm_driver.c:4572:1: enter_function: entry to ‘form_driver_w’
ncurses-6.5-20250614/form/frm_driver.c:4579:6: branch_false: following ‘false’ branch (when ‘form’ is non-NULL)...
ncurses-6.5-20250614/form/frm_driver.c:4582:8: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4582:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4587:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4587:6: branch_false: following ‘false’ branch (when ‘c != -291056’)...
ncurses-6.5-20250614/form/frm_driver.c:4598:7: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4598:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4598:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4601:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4605:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4643:11: branch_false: following ‘false’ branch (when ‘c != 409’)...
ncurses-6.5-20250614/form/frm_driver.c:4718:11: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4718:11: branch_true: following ‘true’ branch (when ‘type == 0’)...
ncurses-6.5-20250614/form/frm_driver.c:4720:13: branch_true: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4720:13: call_function: calling ‘Data_Entry_w’ from ‘form_driver_w’
#  727|   
#  728|   #if USE_WIDEC_SUPPORT && NCURSES_EXT_FUNCS
#  729|-> 	  if (wresize(field->working, 1, Buffer_Length(field) + 1) == ERR)
#  730|   	    result = FALSE;
#  731|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
ncurses-6.5-20250614/form/frm_driver.c:786:10: warning[-Wanalyzer-malloc-leak]: leak of ‘newbuf’
ncurses-6.5-20250614/form/frm_driver.c:4572:1: enter_function: entry to ‘form_driver_w’
ncurses-6.5-20250614/form/frm_driver.c:4579:6: branch_false: following ‘false’ branch (when ‘form’ is non-NULL)...
ncurses-6.5-20250614/form/frm_driver.c:4582:8: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4582:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4587:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4587:6: branch_false: following ‘false’ branch (when ‘c != -291056’)...
ncurses-6.5-20250614/form/frm_driver.c:4598:7: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4598:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4598:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4601:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4605:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4643:11: branch_false: following ‘false’ branch (when ‘c != 409’)...
ncurses-6.5-20250614/form/frm_driver.c:4718:11: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4718:11: branch_true: following ‘true’ branch (when ‘type == 0’)...
ncurses-6.5-20250614/form/frm_driver.c:4720:13: branch_true: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4720:13: call_function: calling ‘Data_Entry_w’ from ‘form_driver_w’
#  784|   	}
#  785|       }
#  786|->   return (result);
#  787|   }
#  788|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
ncurses-6.5-20250614/form/frm_driver.c:4818:17: warning[-Wanalyzer-malloc-leak]: leak of ‘widevalue’
ncurses-6.5-20250614/form/frm_driver.c:4766:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4810:20: acquire_memory: allocated here
ncurses-6.5-20250614/form/frm_driver.c:4810:6: branch_false: following ‘false’ branch (when ‘widevalue’ is non-NULL)...
ncurses-6.5-20250614/form/frm_driver.c:4810:6: branch_false: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4816:19: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/frm_driver.c:4818:17: branch_true: ...to here
ncurses-6.5-20250614/form/frm_driver.c:4818:17: throw: if ‘wmove’ throws an exception...
ncurses-6.5-20250614/form/frm_driver.c:4818:17: danger: ‘widevalue’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 4816|         for (i = 0; i < field->drows; ++i)
# 4817|   	{
# 4818|-> 	  (void)mvwin_wchnstr(field->working, 0, (int)i * field->dcols,
# 4819|   			      widevalue + ((int)i * field->dcols),
# 4820|   			      field->dcols);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
ncurses-6.5-20250614/form/fty_alnum.c:67:11: warning[-Wanalyzer-malloc-leak]: leak of ‘argp’
ncurses-6.5-20250614/form/fty_alnum.c:61:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alnum.c:63:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alnum.c:63:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_alnum.c:65:10: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alnum.c:67:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alnum.c:67:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_alnum.c:67:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alnum.c:67:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_alnum.c:67:11: danger: ‘argp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   65|         if (argp)
#   66|   	{
#   67|-> 	  T((T_CREATE("thisARG %p"), (void *)argp));
#   68|   	  argp->width = *((int *)arg);
#   69|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
ncurses-6.5-20250614/form/fty_alnum.c:106:7: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/form/fty_alnum.c:102:21: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_alnum.c:104:6: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alnum.c:106:7: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alnum.c:106:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_alnum.c:106:7: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alnum.c:106:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_alnum.c:106:7: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  104|     if (result)
#  105|       {
#  106|->       T((T_CREATE("thisARG %p"), (void *)result));
#  107|         *result = *ap;
#  108|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
ncurses-6.5-20250614/form/fty_alpha.c:67:11: warning[-Wanalyzer-malloc-leak]: leak of ‘argp’
ncurses-6.5-20250614/form/fty_alpha.c:61:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alpha.c:63:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alpha.c:63:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_alpha.c:65:10: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alpha.c:67:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alpha.c:67:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_alpha.c:67:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alpha.c:67:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_alpha.c:67:11: danger: ‘argp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   65|         if (argp)
#   66|   	{
#   67|-> 	  T((T_CREATE("thisARG %p"), (void *)argp));
#   68|   	  argp->width = *((int *)arg);
#   69|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
ncurses-6.5-20250614/form/fty_alpha.c:106:7: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/form/fty_alpha.c:102:21: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_alpha.c:104:6: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/form/fty_alpha.c:106:7: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alpha.c:106:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_alpha.c:106:7: branch_true: ...to here
ncurses-6.5-20250614/form/fty_alpha.c:106:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_alpha.c:106:7: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  104|     if (result)
#  105|       {
#  106|->       T((T_CREATE("thisARG %p"), (void *)result));
#  107|         *result = *ap;
#  108|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
ncurses-6.5-20250614/form/fty_enum.c:82:11: warning[-Wanalyzer-malloc-leak]: leak of ‘argp’
ncurses-6.5-20250614/form/fty_enum.c:130:1: enter_function: entry to ‘Make_Enum_Type’
ncurses-6.5-20250614/form/fty_enum.c:138:10: call_function: calling ‘Generic_Enum_Type’ from ‘Make_Enum_Type’
#   80|   	  int ccase, cunique;
#   81|   
#   82|-> 	  T((T_CREATE("enumARG %p"), (void *)argp));
#   83|   	  kwds = params->kwds;
#   84|   	  ccase = params->ccase;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
ncurses-6.5-20250614/form/fty_enum.c:162:11: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/form/fty_enum.c:154:6: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_enum.c:158:16: branch_true: ...to here
ncurses-6.5-20250614/form/fty_enum.c:158:16: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_enum.c:160:10: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/form/fty_enum.c:162:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_enum.c:162:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_enum.c:162:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_enum.c:162:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_enum.c:162:11: danger: ‘result’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  160|         if (result)
#  161|   	{
#  162|-> 	  T((T_CREATE("enumARG %p"), (void *)result));
#  163|   	  *result = *ap;
#  164|   

Error: COMPILER_WARNING: [#def43]
ncurses-6.5-20250614/form/fty_enum.c: scope_hint: In function ‘Free_Enum_Type’
ncurses-6.5-20250614/form/fty_enum.c:203:15: warning[-Wunused-but-set-variable=]: variable ‘cnt’ set but not used
#  203 |           int cnt = 0;
#      |               ^~~
#  201|   	{
#  202|   	  char **kp = ap->kwds;
#  203|-> 	  int cnt = 0;
#  204|   
#  205|   	  while (kp && (*kp))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
ncurses-6.5-20250614/form/fty_generic.c:200:27: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
ncurses-6.5-20250614/form/fty_generic.c:228:1: enter_function: entry to ‘_nc_set_generic_fieldtype’
ncurses-6.5-20250614/form/fty_generic.c:235:6: branch_true: following ‘true’ branch (when ‘field’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:237:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:241:10: branch_true: following ‘true’ branch (when ‘ftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:243:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:243:14: branch_true: following ‘true’ branch (when ‘argiterator’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:246:36: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:246:36: call_function: calling ‘GenericArgument’ from ‘_nc_set_generic_fieldtype’
#  198|   	    {
#  199|   	      void *argp;
#  200|-> 	      int valid = argiterator(&argp);
#  201|   
#  202|   	      if (valid == 0 || argp == NULL ||

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
ncurses-6.5-20250614/form/fty_generic.c:203:43: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
ncurses-6.5-20250614/form/fty_generic.c:228:1: enter_function: entry to ‘_nc_set_generic_fieldtype’
ncurses-6.5-20250614/form/fty_generic.c:235:6: branch_true: following ‘true’ branch (when ‘field’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:237:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:241:10: branch_true: following ‘true’ branch (when ‘ftyp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:243:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:243:14: branch_true: following ‘true’ branch (when ‘argiterator’ is non-NULL)...
ncurses-6.5-20250614/form/fty_generic.c:246:36: branch_true: ...to here
ncurses-6.5-20250614/form/fty_generic.c:246:36: call_function: calling ‘GenericArgument’ from ‘_nc_set_generic_fieldtype’
#  201|   
#  202|   	      if (valid == 0 || argp == NULL ||
#  203|-> 		  !(res = (TypeArgument *)typ->genericarg(argp)))
#  204|   		{
#  205|   		  *err += 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
ncurses-6.5-20250614/form/fty_int.c:84:11: warning[-Wanalyzer-malloc-leak]: leak of ‘argp’
ncurses-6.5-20250614/form/fty_int.c:78:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_int.c:80:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:80:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_int.c:82:10: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_int.c:84:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:84:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_int.c:84:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:84:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_int.c:84:11: danger: ‘argp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   82|         if (argp)
#   83|   	{
#   84|-> 	  T((T_CREATE("thisARG %p"), (void *)argp));
#   85|   	  *argp = *param;
#   86|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def47]
ncurses-6.5-20250614/form/fty_int.c:131:11: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/form/fty_int.c:125:6: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_int.c:127:16: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:127:16: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_int.c:129:10: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/form/fty_int.c:131:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:131:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_int.c:131:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_int.c:131:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_int.c:131:11: danger: ‘result’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  129|         if (result)
#  130|   	{
#  131|-> 	  T((T_CREATE("thisARG %p"), (void *)result));
#  132|   	  *result = *ap;
#  133|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
ncurses-6.5-20250614/form/fty_num.c:95:11: warning[-Wanalyzer-malloc-leak]: leak of ‘argn’
ncurses-6.5-20250614/form/fty_num.c:89:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_num.c:91:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:91:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_num.c:93:10: branch_true: following ‘true’ branch (when ‘argn’ is non-NULL)...
ncurses-6.5-20250614/form/fty_num.c:95:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:95:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_num.c:95:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:95:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_num.c:95:11: danger: ‘argn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   93|         if (argn)
#   94|   	{
#   95|-> 	  T((T_CREATE("thisARG %p"), (void *)argn));
#   96|   	  argn->precision = args->precision;
#   97|   	  argn->low = args->low;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
ncurses-6.5-20250614/form/fty_num.c:150:11: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/form/fty_num.c:144:6: branch_true: following ‘true’ branch (when ‘argp’ is non-NULL)...
ncurses-6.5-20250614/form/fty_num.c:146:16: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:146:16: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_num.c:148:10: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/form/fty_num.c:150:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:150:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_num.c:150:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_num.c:150:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_num.c:150:11: danger: ‘result’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  148|         if (result)
#  149|   	{
#  150|-> 	  T((T_CREATE("thisARG %p"), (void *)result));
#  151|   	  *result = *ap;
#  152|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
ncurses-6.5-20250614/form/fty_regex.c:159:11: warning[-Wanalyzer-malloc-leak]: leak of ‘preg’
ncurses-6.5-20250614/form/fty_regex.c:153:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:155:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:155:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_regex.c:157:10: branch_true: following ‘true’ branch (when ‘preg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:159:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_regex.c:159:11: danger: ‘preg’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  157|         if (preg)
#  158|   	{
#  159|-> 	  T((T_CREATE("RegExp_Arg %p"), (void *)preg));
#  160|   	  if (((preg->pRegExp = typeMalloc(regex_t, 1)) != NULL)
#  161|   	      && !regcomp(preg->pRegExp, rx,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
ncurses-6.5-20250614/form/fty_regex.c:161:19: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/form/fty_regex.c:153:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:155:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:157:10: branch_true: following ‘true’ branch (when ‘preg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/fty_regex.c:160:33: branch_false: ...to here
ncurses-6.5-20250614/form/fty_regex.c:160:33: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_regex.c:160:14: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:161:19: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:161:19: throw: if ‘regcomp’ throws an exception...
ncurses-6.5-20250614/form/fty_regex.c:161:19: danger: ‘<unknown>’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  159|   	  T((T_CREATE("RegExp_Arg %p"), (void *)preg));
#  160|   	  if (((preg->pRegExp = typeMalloc(regex_t, 1)) != NULL)
#  161|-> 	      && !regcomp(preg->pRegExp, rx,
#  162|   			  (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
#  163|   	    {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
ncurses-6.5-20250614/form/fty_regex.c:161:19: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(64)’
ncurses-6.5-20250614/form/fty_regex.c:153:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:155:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:157:10: branch_true: following ‘true’ branch (when ‘preg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:160:33: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:160:33: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_regex.c:160:14: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:161:19: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:161:19: throw: if ‘regcomp’ throws an exception...
ncurses-6.5-20250614/form/fty_regex.c:161:19: danger: ‘malloc(64)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  159|   	  T((T_CREATE("RegExp_Arg %p"), (void *)preg));
#  160|   	  if (((preg->pRegExp = typeMalloc(regex_t, 1)) != NULL)
#  161|-> 	      && !regcomp(preg->pRegExp, rx,
#  162|   			  (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
#  163|   	    {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
ncurses-6.5-20250614/form/fty_regex.c:161:19: warning[-Wanalyzer-malloc-leak]: leak of ‘preg’
ncurses-6.5-20250614/form/fty_regex.c:153:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:155:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:155:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_regex.c:157:10: branch_true: following ‘true’ branch (when ‘preg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/fty_regex.c:160:33: branch_false: ...to here
ncurses-6.5-20250614/form/fty_regex.c:160:14: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:161:19: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:161:19: throw: if ‘regcomp’ throws an exception...
ncurses-6.5-20250614/form/fty_regex.c:161:19: danger: ‘preg’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  159|   	  T((T_CREATE("RegExp_Arg %p"), (void *)preg));
#  160|   	  if (((preg->pRegExp = typeMalloc(regex_t, 1)) != NULL)
#  161|-> 	      && !regcomp(preg->pRegExp, rx,
#  162|   			  (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
#  163|   	    {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
ncurses-6.5-20250614/form/fty_regex.c:164:15: warning[-Wanalyzer-malloc-leak]: leak of ‘preg’
ncurses-6.5-20250614/form/fty_regex.c:153:6: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:155:14: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:155:14: acquire_memory: allocated here
ncurses-6.5-20250614/form/fty_regex.c:157:10: branch_true: following ‘true’ branch (when ‘preg’ is non-NULL)...
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:159:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/form/fty_regex.c:160:33: branch_false: ...to here
ncurses-6.5-20250614/form/fty_regex.c:160:14: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:161:19: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:160:15: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:164:15: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:164:15: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/form/fty_regex.c:164:15: branch_true: ...to here
ncurses-6.5-20250614/form/fty_regex.c:164:15: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/form/fty_regex.c:164:15: danger: ‘preg’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  162|   			  (REG_EXTENDED | REG_NOSUB | REG_NEWLINE)))
#  163|   	    {
#  164|-> 	      T((T_CREATE("regex_t %p"), (void *)preg->pRegExp));
#  165|   	      if ((preg->refCount = typeMalloc(unsigned long, 1)) != NULL)
#  166|   		 *(preg->refCount) = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
ncurses-6.5-20250614/menu/m_item_new.c:130:11: warning[-Wanalyzer-malloc-leak]: leak of ‘item’
ncurses-6.5-20250614/menu/m_item_new.c:119:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:119:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:126:14: branch_true: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:126:14: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_item_new.c:128:10: branch_true: following ‘true’ branch (when ‘item’ is non-NULL)...
ncurses-6.5-20250614/menu/m_item_new.c:130:11: branch_true: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:130:11: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:130:11: branch_true: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:130:11: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/menu/m_item_new.c:130:11: danger: ‘item’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  128|         if (item)
#  129|   	{
#  130|-> 	  T((T_CREATE("item %p"), (void *)item));
#  131|   	  *item = _nc_Default_Item;	/* hope we have struct assignment */
#  132|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
ncurses-6.5-20250614/menu/m_item_new.c:151:3: warning[-Wanalyzer-malloc-leak]: leak of ‘item’
ncurses-6.5-20250614/menu/m_item_new.c:119:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:119:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:126:14: branch_true: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:126:14: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_item_new.c:128:10: branch_true: following ‘true’ branch (when ‘item’ is non-NULL)...
ncurses-6.5-20250614/menu/m_item_new.c:130:11: branch_true: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:130:11: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/menu/m_item_new.c:131:11: branch_false: ...to here
ncurses-6.5-20250614/menu/m_item_new.c:151:3: throw: if ‘_nc_retrace_item’ throws an exception...
ncurses-6.5-20250614/menu/m_item_new.c:151:3: danger: ‘item’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  149|   	SET_ERROR(E_SYSTEM_ERROR);
#  150|       }
#  151|->   returnItem(item);
#  152|   }
#  153|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
ncurses-6.5-20250614/menu/m_new.c:60:3: warning[-Wanalyzer-malloc-leak]: leak of ‘menu’
ncurses-6.5-20250614/menu/m_new.c:58:16: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_new.c:60:3: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_new.c:60:3: branch_true: ...to here
ncurses-6.5-20250614/menu/m_new.c:60:3: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/menu/m_new.c:60:3: danger: ‘menu’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   58|     MENU *menu = typeCalloc(MENU, 1);
#   59|   
#   60|->   T((T_CALLED("new_menu(%p,%p)"), (void *)SP_PARM, (void *)items));
#   61|     if (menu)
#   62|       {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
ncurses-6.5-20250614/menu/m_new.c:63:7: warning[-Wanalyzer-malloc-leak]: leak of ‘menu’
ncurses-6.5-20250614/menu/m_new.c:58:16: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_new.c:61:6: branch_true: following ‘true’ branch (when ‘menu’ is non-NULL)...
ncurses-6.5-20250614/menu/m_new.c:63:7: branch_true: ...to here
ncurses-6.5-20250614/menu/m_new.c:63:7: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_new.c:63:7: branch_true: ...to here
ncurses-6.5-20250614/menu/m_new.c:63:7: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/menu/m_new.c:63:7: danger: ‘menu’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   61|     if (menu)
#   62|       {
#   63|->       T((T_CREATE("menu %p"), (void *)menu));
#   64|         *menu = _nc_Default_Menu;
#   65|         menu->status = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
ncurses-6.5-20250614/menu/m_new.c:77:16: warning[-Wanalyzer-malloc-leak]: leak of ‘menu’
ncurses-6.5-20250614/menu/m_new.c:58:16: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_new.c:61:6: branch_true: following ‘true’ branch (when ‘menu’ is non-NULL)...
ncurses-6.5-20250614/menu/m_new.c:64:7: branch_true: ...to here
ncurses-6.5-20250614/menu/m_new.c:75:10: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/menu/m_new.c:77:16: throw: if ‘_nc_Connect_Items’ throws an exception...
ncurses-6.5-20250614/menu/m_new.c:77:16: danger: ‘menu’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   75|         if (items && *items)
#   76|   	{
#   77|-> 	  if (!_nc_Connect_Items(menu, items))
#   78|   	    {
#   79|   	      err = E_NOT_CONNECTED;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
ncurses-6.5-20250614/menu/m_new.c:91:3: warning[-Wanalyzer-malloc-leak]: leak of ‘menu’
ncurses-6.5-20250614/menu/m_new.c:58:16: acquire_memory: allocated here
ncurses-6.5-20250614/menu/m_new.c:61:6: branch_true: following ‘true’ branch (when ‘menu’ is non-NULL)...
ncurses-6.5-20250614/menu/m_new.c:63:7: branch_true: ...to here
ncurses-6.5-20250614/menu/m_new.c:63:7: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/menu/m_new.c:64:7: branch_false: ...to here
ncurses-6.5-20250614/menu/m_new.c:91:3: throw: if ‘_nc_retrace_menu’ throws an exception...
ncurses-6.5-20250614/menu/m_new.c:91:3: danger: ‘menu’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   89|       SET_ERROR(err);
#   90|   
#   91|->   returnMenu(menu);
#   92|   }
#   93|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def61]
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:369:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:368:44: branch_true: following ‘true’ branch (when ‘cc <= 31’)...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:369:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:369:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  367|   					}
#  368|   					if (cc < 32)
#  369|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "^%c", cc + '@');
#  370|   					else if (cc == 127)
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def62]
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:373:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:368:44: branch_false: following ‘false’ branch (when ‘cc > 31’)...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:370:49: branch_false: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:370:49: branch_false: following ‘false’ branch (when ‘cc != 127’)...
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:373:49: branch_false: ...to here
ncurses-6.5-20250614/narrowc5/ncurses/lib_keyname.c:373:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);
#  372|   					else
#  373|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "%c", cc);
#  374|   					MyTable[c] = strdup(name);
#  375|   				}

Error: GCC_ANALYZER_WARNING (CWE-121): [#def63]
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:369:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:368:44: branch_true: following ‘true’ branch (when ‘cc <= 31’)...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:369:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:369:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  367|   					}
#  368|   					if (cc < 32)
#  369|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "^%c", cc + '@');
#  370|   					else if (cc == 127)
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def64]
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:373:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:368:44: branch_false: following ‘false’ branch (when ‘cc > 31’)...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:370:49: branch_false: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:370:49: branch_false: following ‘false’ branch (when ‘cc != 127’)...
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:373:49: branch_false: ...to here
ncurses-6.5-20250614/narrowc6/ncurses/lib_keyname.c:373:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);
#  372|   					else
#  373|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "%c", cc);
#  374|   					MyTable[c] = strdup(name);
#  375|   				}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
ncurses-6.5-20250614/ncurses/base/lib_color.c:538:9: warning[-Wanalyzer-malloc-leak]: leak of ‘next’
ncurses-6.5-20250614/ncurses/base/lib_color.c:1108:1: enter_function: entry to ‘extended_pair_content_sp’
ncurses-6.5-20250614/ncurses/base/lib_color.c:1112:12: call_function: calling ‘_nc_pair_content’ from ‘extended_pair_content_sp’
#  536|   	    _nc_err_abort(MSG_NO_MEMORY);
#  537|   	memcpy(next, sp->_color_pairs, (size_t) sp->_pair_alloc * sizeof(*next));
#  538|-> 	_nc_copy_pairs(sp, next, sp->_color_pairs, sp->_pair_alloc);
#  539|   	free(sp->_color_pairs);
#  540|   	sp->_color_pairs = next;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:63:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:67:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: throw: if ‘newterm’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: danger: ‘name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   92|   	}
#   93|   #endif
#   94|-> 	if (newterm(name, stdout, stdin) == NULL) {
#   95|   	    fprintf(stderr, "ncurses: cannot initialize terminal type"
#   96|   		    " ($TERM=\"%s\"); exiting\n", name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:102:9: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:63:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:67:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:102:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:102:9: throw: if ‘def_prog_mode_sp’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:102:9: danger: ‘name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  100|   	/* def_shell_mode - done in newterm/_nc_setupscreen */
#  101|   #if NCURSES_SP_FUNCS
#  102|-> 	NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
#  103|   #else
#  104|   	def_prog_mode();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:104:9: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:63:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:67:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:72:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:94:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:104:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:104:9: throw: if ‘def_prog_mode’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_initscr.c:104:9: danger: ‘name’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  102|   	NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN);
#  103|   #else
#  104|-> 	def_prog_mode();
#  105|   #endif
#  106|   	free(name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
ncurses-6.5-20250614/ncurses/base/lib_instr.c:80:25: warning[-Wanalyzer-malloc-leak]: leak of ‘wch’
ncurses-6.5-20250614/ncurses/base/lib_instr.c:54:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_instr.c:57:19: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_instr.c:64:16: branch_true: following ‘true’ branch (when ‘i < n’)...
ncurses-6.5-20250614/ncurses/base/lib_instr.c:66:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_instr.c:76:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_instr.c:77:31: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_instr.c:77:31: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/lib_instr.c:76:21: branch_true: following ‘true’ branch (when ‘wch’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/lib_instr.c:80:25: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_instr.c:80:25: throw: if ‘getcchar’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_instr.c:80:25: danger: ‘wch’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#   78|   		    bool done = FALSE;
#   79|   
#   80|-> 		    if (getcchar(cell, wch, &attrs, &pair, NULL) == OK) {
#   81|   			mbstate_t state;
#   82|   			size_t n3;

Error: COMPILER_WARNING (CWE-704): [#def70]
ncurses-6.5-20250614/ncurses/base/lib_mouse.c: scope_hint: In function ‘init_xterm_mouse’
ncurses-6.5-20250614/ncurses/base/lib_mouse.c:393:22: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  393 |         char *code = strstr(sp->_mouse_xtermcap, "[?");
#      |                      ^~~~~~
#  391|       sp->_mouse_xtermcap = tigetstr(UserCap(XM));
#  392|       if (VALID_STRING(sp->_mouse_xtermcap)) {
#  393|-> 	char *code = strstr(sp->_mouse_xtermcap, "[?");
#  394|   	if (code != NULL) {
#  395|   	    code += 2;

Error: COMPILER_WARNING (CWE-704): [#def71]
ncurses-6.5-20250614/ncurses/base/lib_mouse.c:393:22: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  391|       sp->_mouse_xtermcap = tigetstr(UserCap(XM));
#  392|       if (VALID_STRING(sp->_mouse_xtermcap)) {
#  393|-> 	char *code = strstr(sp->_mouse_xtermcap, "[?");
#  394|   	if (code != NULL) {
#  395|   	    code += 2;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def72]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:54:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:53:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:54:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:54:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:54:5: throw: if ‘_nc_varargs’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:54:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   52|       va_list argq;
#   53|       va_start(argq, fmt);
#   54|->     T((T_CALLED("printw(%s%s)"),
#   55|          _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
#   56|       va_end(argq);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def73]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:74:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: throw: if ‘_nc_varargs’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   73|       va_list argq;
#   74|       va_start(argq, fmt);
#   75|->     T((T_CALLED("wprintw(%p,%s%s)"),
#   76|          (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
#   77|       va_end(argq);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def74]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:95:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:94:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:95:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:95:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:95:5: throw: if ‘_nc_varargs’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:95:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   93|       va_list argq;
#   94|       va_start(argq, fmt);
#   95|->     T((T_CALLED("mvprintw(%d,%d,%s%s)"),
#   96|          y, x, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
#   97|       va_end(argq);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def75]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:118:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:117:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:118:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:118:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:118:5: throw: if ‘_nc_varargs’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:118:5: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  116|       va_list argq;
#  117|       va_start(argq, fmt);
#  118|->     T((T_CALLED("mvwprintw(%d,%d,%p,%s%s)"),
#  119|          y, x, (void *) win, _nc_visbuf(fmt), _nc_varargs(fmt, argq)));
#  120|       va_end(argq);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def76]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:157:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:67:1: enter_function: entry to ‘wprintw’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:80:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:81:12: call_function: calling ‘vw_printw’ from ‘wprintw’
#  155|       int code = ERR;
#  156|   #if NCURSES_SP_FUNCS
#  157|->     SCREEN *sp = _nc_screen_of(win);
#  158|   #endif
#  159|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def77]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:160:5: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:67:1: enter_function: entry to ‘wprintw’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_printw.c:75:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:80:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:81:12: call_function: calling ‘vw_printw’ from ‘wprintw’
#  158|   #endif
#  159|   
#  160|->     T((T_CALLED("vw_printw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt)));
#  161|   
#  162|       buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def78]
ncurses-6.5-20250614/ncurses/base/lib_printw.c:162:11: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:67:1: enter_function: entry to ‘wprintw’
ncurses-6.5-20250614/ncurses/base/lib_printw.c:80:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_printw.c:81:12: call_function: calling ‘vw_printw’ from ‘wprintw’
#  160|       T((T_CALLED("vw_printw(%p,%s,va_list)"), (void *) win, _nc_visbuf(fmt)));
#  161|   
#  162|->     buf = NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_ARGx fmt, argp);
#  163|       if (buf != NULL) {
#  164|   	code = waddstr(win, buf);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def79]
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:67:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:91:1: enter_function: entry to ‘wscanw’
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:98:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:99:12: call_function: calling ‘vw_scanw’ from ‘wscanw’
#   65|       int code = ERR;
#   66|   
#   67|->     if (wgetnstr(win, buf, (int) sizeof(buf) - 1) != ERR) {
#   68|   	if ((code = vsscanf(buf, fmt, argp)) == EOF) {
#   69|   	    code = ERR;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def80]
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:111:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:110:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:111:13: throw: if ‘wmove’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:111:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  109|   
#  110|       va_start(ap, fmt);
#  111|->     code = (move(y, x) == OK) ? vw_scanw(stdscr, fmt, ap) : ERR;
#  112|       va_end(ap);
#  113|       return (code);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def81]
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:123:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:122:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:123:13: throw: if ‘wmove’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_scanw.c:123:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  121|   
#  122|       va_start(ap, fmt);
#  123|->     code = (wmove(win, y, x) == OK) ? vw_scanw(win, fmt, ap) : ERR;
#  124|       va_end(ap);
#  125|       return (code);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:345:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:335:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:339:8: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:339:8: branch_false: following ‘false’ branch (when ‘spp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:341:5: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:343:8: branch_true: following ‘true’ branch (when ‘sp’ is NULL)...
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:344:14: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:344:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:345:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:345:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:345:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:345:9: danger: ‘sp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  343|       if (!sp) {
#  344|   	sp = _nc_alloc_screen_sp();
#  345|-> 	T(("_nc_alloc_screen_sp %p", (void *) sp));
#  346|   	*spp = sp;
#  347|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:352:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:773:1: enter_function: entry to ‘_nc_setupscreen’
ncurses-6.5-20250614/ncurses/base/lib_set_term.c:780:14: call_function: calling ‘_nc_setupscreen_sp’ from ‘_nc_setupscreen’
#  350|       }
#  351|       if ((sp->_acs_map = typeCalloc(chtype, ACS_LEN)) == NULL) {
#  352|-> 	ReturnScreenError();
#  353|       }
#  354|       if ((sp->_screen_acs_map = typeCalloc(bool, ACS_LEN)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
ncurses-6.5-20250614/ncurses/base/tries.c:77:13: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/ncurses/base/tries.c:51:1: enter_function: entry to ‘_nc_expand_try’
ncurses-6.5-20250614/ncurses/base/tries.c:56:8: branch_true: following ‘true’ branch (when ‘code != 0’)...
ncurses-6.5-20250614/ncurses/base/tries.c:56:8: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:57:16: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/tries.c:58:27: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:58:27: call_function: calling ‘_nc_expand_try’ from ‘_nc_expand_try’
ncurses-6.5-20250614/ncurses/base/tries.c:58:27: return_function: returning to ‘_nc_expand_try’ from ‘_nc_expand_try’
ncurses-6.5-20250614/ncurses/base/tries.c:58:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/base/tries.c:62:17: branch_false: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:62:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/tries.c:63:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:64:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/tries.c:65:30: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:65:30: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/base/tries.c:72:8: branch_true: following ‘true’ branch (when ‘result’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/tries.c:73:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:73:12: branch_true: following ‘true’ branch (when ‘ptr’ is non-NULL)...
ncurses-6.5-20250614/ncurses/base/tries.c:73:50: branch_true: ...to here
ncurses-6.5-20250614/ncurses/base/tries.c:76:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/base/tries.c:77:13: throw: if ‘_nc_visbuf’ throws an exception...
ncurses-6.5-20250614/ncurses/base/tries.c:77:13: danger: ‘result’ leaks here; was allocated at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#   75|   #ifdef TRACE
#   76|   	if (len == 0 && USE_TRACEF(TRACE_MAXIMUM)) {
#   77|-> 	    _tracef("expand_key %s %s",
#   78|   		    _nc_tracechar(CURRENT_SCREEN, (int) code),
#   79|   		    _nc_visbuf(result));

Error: GCC_ANALYZER_WARNING (CWE-457): [#def85]
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:205:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘offsets[i]’
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:139:1: enter_function: entry to ‘_nc_wrap_entry’
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:150:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:155:8: branch_true: following ‘true’ branch (when ‘copy_strings != 0’)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:156:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:159:26: call_function: calling ‘_nc_save_str’ from ‘_nc_wrap_entry’
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:159:26: return_function: returning to ‘_nc_wrap_entry’ from ‘_nc_save_str’
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:161:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:160:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:161:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:160:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:166:21: branch_false: following ‘false’ branch (when ‘i >= nuses’)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:172:14: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:177:5: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:177:5: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:189:17: branch_false: following ‘false’ branch (when ‘i >= nuses’)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:196:5: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:196:5: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:197:8: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:197:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:200:16: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:203:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:204:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:204:12: branch_true: following ‘true’ branch (when ‘i <= 2047’)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:205:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_entry.c:205:17: danger: use of uninitialized value ‘offsets[i]’ here
#  203|       for_each_string(i, &(ep->tterm)) {
#  204|   	if (i < SIZEOF(offsets)) {
#  205|-> 	    if (offsets[i] == ABSENT_OFFSET) {
#  206|   		tp->Strings[i] = ABSENT_STRING;
#  207|   	    } else if (offsets[i] == CANCELLED_OFFSET) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:338:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ext_Names’
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:428:1: enter_function: entry to ‘_nc_align_termtype’
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:441:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:469:9: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:469:9: branch_false: following ‘false’ branch (when ‘ext_Names’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:471:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:471:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:472:13: call_function: calling ‘adjust_cancels’ from ‘_nc_align_termtype’
#  336|       }
#  337|   
#  338|->     TYPE_REALLOC(char *, total, tp->ext_Names);
#  339|       for (k = total - 1; k > j; k--)
#  340|   	tp->ext_Names[k] = tp->ext_Names[k - 1];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:348:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ext_Names’
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:428:1: enter_function: entry to ‘_nc_align_termtype’
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:441:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:469:9: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:469:9: branch_false: following ‘false’ branch (when ‘ext_Names’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:471:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:471:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/alloc_ttype.c:472:13: call_function: calling ‘adjust_cancels’ from ‘_nc_align_termtype’
#  346|   	tp->ext_Booleans++;
#  347|   	tp->num_Booleans++;
#  348|-> 	TYPE_REALLOC(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans);
#  349|   	for (k = (unsigned) (tp->num_Booleans - 1); k > j; k--)
#  350|   	    tp->Booleans[k] = tp->Booleans[k - 1];

Error: COMPILER_WARNING (CWE-704): [#def88]
ncurses-6.5-20250614/ncurses/tinfo/captoinfo.c: scope_hint: In function ‘_nc_infotocap’
ncurses-6.5-20250614/ncurses/tinfo/captoinfo.c:848:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  848 |                    && (cp = strchr(str, '+'))) {
#      |                           ^
#  846|   		    || sscanf(str, "%%'%c'%%+%%%c", &ch1, &ch2) == 2)
#  847|   		   && ch2 == 'c'
#  848|-> 		   && (cp = strchr(str, '+'))) {
#  849|   	    str = cp + 2;
#  850|   	    bufptr = save_string(bufptr, "%+");

Error: COMPILER_WARNING (CWE-704): [#def89]
ncurses-6.5-20250614/ncurses/tinfo/captoinfo.c:848:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  846|   		    || sscanf(str, "%%'%c'%%+%%%c", &ch1, &ch2) == 2)
#  847|   		   && ch2 == 'c'
#  848|-> 		   && (cp = strchr(str, '+'))) {
#  849|   	    str = cp + 2;
#  850|   	    bufptr = save_string(bufptr, "%+");

Error: COMPILER_WARNING (CWE-704): [#def90]
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c: scope_hint: In function ‘check_collisions’
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c:128:29: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  128 |     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#      |                             ^
#  126|   #endif
#  127|   
#  128|->     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|   	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)

Error: COMPILER_WARNING (CWE-704): [#def91]
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c:128:29: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126|   #endif
#  127|   
#  128|->     for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|   	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)

Error: COMPILER_WARNING (CWE-704): [#def92]
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c:129:33: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  129 |         for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#      |                                 ^
#  127|   
#  128|       for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|-> 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)
#  131|   		&& memcmp(pstart, qstart, (size_t) (pend - pstart)) == 0) {

Error: COMPILER_WARNING (CWE-704): [#def93]
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c:129:33: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  127|   
#  128|       for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) {
#  129|-> 	for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) {
#  130|   	    if ((pend - pstart == qend - qstart)
#  131|   		&& memcmp(pstart, qstart, (size_t) (pend - pstart)) == 0) {

Error: COMPILER_WARNING: [#def94]
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c: scope_hint: In function ‘_nc_read_entry_source’
ncurses-6.5-20250614/ncurses/tinfo/comp_parse.c:224:9: warning[-Wunused-but-set-variable=]: variable ‘immediate’ set but not used
#  224 |     int immediate = 0;
#      |         ^~~~~~~~~
#  222|       ENTRY thisentry;
#  223|       bool oldsuppress = _nc_suppress_warnings;
#  224|->     int immediate = 0;
#  225|   
#  226|       DEBUG(2,

Error: CPPCHECK_WARNING (CWE-682): [#def95]
ncurses-6.5-20250614/ncurses/tinfo/comp_scan.c:494: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  492|   #endif
#  493|   	tok_ptr = tok_buf;
#  494|-> 	AddCh(ch);
#  495|   
#  496|   	if (first_column) {

Error: CPPCHECK_WARNING (CWE-476): [#def96]
ncurses-6.5-20250614/ncurses/tinfo/comp_scan.c:494: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: tok_ptr++
#  492|   #endif
#  493|   	tok_ptr = tok_buf;
#  494|-> 	AddCh(ch);
#  495|   
#  496|   	if (first_column) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def97]
ncurses-6.5-20250614/ncurses/tinfo/db_iterator.c:136:24: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘value’ where non-null expected
ncurses-6.5-20250614/ncurses/tinfo/db_iterator.c:178:1: enter_function: entry to ‘cache_expired’
ncurses-6.5-20250614/ncurses/tinfo/db_iterator.c:183:8: branch_false: following ‘false’ branch...
 branch_false: ...to here
 call_function: calling ‘cache_expired’ from ‘cache_expired’
#  134|   		      (value != NULL &&
#  135|   		       cached_value != NULL &&
#  136|-> 		       strcmp(value, cached_value) == 0));
#  137|   
#  138|   	/* Set variable name to enable checks in cache_expired(). */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:94:20: warning[-Wanalyzer-malloc-leak]: leak of ‘mybuf’
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:9: branch_false: following ‘false’ branch (when ‘len > 0’)...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:58:14: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:76:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:75:9: branch_false: following ‘false’ branch (when ‘mybuf’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:82:5: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:94:20: throw: if ‘write’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:94:20: danger: ‘mybuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   92|        * operation is truly atomic we're protected from this.
#   93|        */
#   94|->     result = (int) write(SP_PARM->_ofd, mybuf, need);
#   95|   
#   96|       /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:102:12: warning[-Wanalyzer-malloc-leak]: leak of ‘mybuf’
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:56:9: branch_false: following ‘false’ branch (when ‘len > 0’)...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:58:14: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:76:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:75:9: branch_false: following ‘false’ branch (when ‘mybuf’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:82:5: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:102:12: throw: if ‘sleep’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_print.c:102:12: danger: ‘mybuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  100|        */
#  101|   #ifndef _NC_WINDOWS_NATIVE
#  102|->     (void) sleep(0);
#  103|   #endif
#  104|       free(mybuf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:557:21: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:821:1: enter_function: entry to ‘_nc_setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1041:5: call_function: calling ‘_nc_get_screensize’ from ‘_nc_setupterm’
#  555|   		 */
#  556|   		if ((sp == NULL || !sp->_filtered) &&
#  557|-> 		    _nc_getenv_num("LINES") > 0) {
#  558|   		    _nc_setenv_num("LINES", *linep);
#  559|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:558:21: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:821:1: enter_function: entry to ‘_nc_setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1041:5: call_function: calling ‘_nc_get_screensize’ from ‘_nc_setupterm’
#  556|   		if ((sp == NULL || !sp->_filtered) &&
#  557|   		    _nc_getenv_num("LINES") > 0) {
#  558|-> 		    _nc_setenv_num("LINES", *linep);
#  559|   		}
#  560|   		if (_nc_getenv_num("COLUMNS") > 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:560:21: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:821:1: enter_function: entry to ‘_nc_setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1041:5: call_function: calling ‘_nc_get_screensize’ from ‘_nc_setupterm’
#  558|   		    _nc_setenv_num("LINES", *linep);
#  559|   		}
#  560|-> 		if (_nc_getenv_num("COLUMNS") > 0) {
#  561|   		    _nc_setenv_num("COLUMNS", *colp);
#  562|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:674:18: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:821:1: enter_function: entry to ‘_nc_setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:945:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:969:18: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:969:18: call_function: calling ‘_nc_setup_tinfo’ from ‘_nc_setupterm’
#  672|   {
#  673|       char filename[PATH_MAX];
#  674|->     int status = _nc_read_entry2(tn, filename, tp);
#  675|   
#  676|       /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:674:18: warning[-Wanalyzer-malloc-leak]: leak of ‘termp’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:821:1: enter_function: entry to ‘_nc_setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:925:17: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:945:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:969:18: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:969:18: call_function: calling ‘_nc_setup_tinfo’ from ‘_nc_setupterm’
#  672|   {
#  673|       char filename[PATH_MAX];
#  674|->     int status = _nc_read_entry2(tn, filename, tp);
#  675|   
#  676|       /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  874|       }
#  875|   
#  876|->     T(("your terminal name is %s", myname));
#  877|   
#  878|       /*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:910:12: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:907:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:908:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:909:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch (when the strings are equal)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:910:27: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:910:12: throw: if ‘_nc_name_match’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:910:12: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  908|   	&& termp->_termname != NULL
#  909|   	&& !strcmp(termp->_termname, myname)
#  910|-> 	&& _nc_name_match(TerminalType(termp).term_names, myname, "|")) {
#  911|   	T(("reusing existing terminal information and mode-settings"));
#  912|   	code = OK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:882:8: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:907:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:908:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:909:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch (when the strings are equal)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:910:27: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:905:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:911:9: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  909|   	&& !strcmp(termp->_termname, myname)
#  910|   	&& _nc_name_match(TerminalType(termp).term_names, myname, "|")) {
#  911|-> 	T(("reusing existing terminal information and mode-settings"));
#  912|   	code = OK;
#  913|   #ifdef USE_TERM_DRIVER

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:882:8: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:945:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  947|   	}
#  948|   #endif /* HAVE_SYSCONF */
#  949|-> 	T(("using %d for getstr limit", _nc_globals.getstr_limit));
#  950|   
#  951|   #ifdef USE_TERM_DRIVER

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: warning[-Wanalyzer-malloc-leak]: leak of ‘termp’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:876:5: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:882:8: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:925:17: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:945:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:949:9: danger: ‘termp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  947|   	}
#  948|   #endif /* HAVE_SYSCONF */
#  949|-> 	T(("using %d for getstr limit", _nc_globals.getstr_limit));
#  950|   
#  951|   #ifdef USE_TERM_DRIVER

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: throw: if ‘_nc_fallback’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  976|   	/* try fallback list if entry on disk */
#  977|   	if (status != TGETENT_YES) {
#  978|-> 	    const TERMTYPE2 *fallback = _nc_fallback2(myname);
#  979|   
#  980|   	    if (fallback) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: throw: if ‘_nc_fallback2’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  976|   	/* try fallback list if entry on disk */
#  977|   	if (status != TGETENT_YES) {
#  978|-> 	    const TERMTYPE2 *fallback = _nc_fallback2(myname);
#  979|   
#  980|   	    if (fallback) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:980:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: throw: if ‘_nc_copy_termtype’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  980|   	    if (fallback) {
#  981|   		T(("found fallback entry"));
#  982|-> 		_nc_copy_termtype2(&(TerminalType(termp)), fallback);
#  983|   		status = TGETENT_YES;
#  984|   	    }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:980:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: throw: if ‘_nc_copy_termtype2’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  980|   	    if (fallback) {
#  981|   		T(("found fallback entry"));
#  982|-> 		_nc_copy_termtype2(&(TerminalType(termp)), fallback);
#  983|   		status = TGETENT_YES;
#  984|   	    }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:988:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:980:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:988:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:988:13: throw: if ‘del_curterm’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:988:13: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  986|   
#  987|   	if (status != TGETENT_YES) {
#  988|-> 	    del_curterm(termp);
#  989|   	    if (status == TGETENT_ERR) {
#  990|   		free(myname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1001:9: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:980:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1001:9: throw: if ‘_nc_export_termtype2’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1001:9: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  999|   	}
# 1000|   #if NCURSES_EXT_NUMBERS
# 1001|-> 	_nc_export_termtype2(&termp->type, &TerminalType(termp));
# 1002|   #endif
# 1003|   #if !USE_REENTRANT

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1010:9: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:978:41: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:980:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:982:17: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1010:9: throw: if ‘set_curterm’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1010:9: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1008|   	termp->_termname = strdup(myname);
# 1009|   
# 1010|-> 	set_curterm(termp);
# 1011|   
# 1012|   	if (VALID_STRING(command_character))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1022:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1207:1: enter_function: entry to ‘setupterm’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1210:12: call_function: calling ‘_nc_setupterm’ from ‘setupterm’
# 1020|   	 */
# 1021|   	if (NC_ISATTY(Filedes)) {
# 1022|-> 	    NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
# 1023|   	    NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
# 1024|   	    NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1023:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1004:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1012:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1013:36: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1021:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1022:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1023:13: throw: if ‘def_prog_mode’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1023:13: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1021|   	if (NC_ISATTY(Filedes)) {
# 1022|   	    NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
# 1023|-> 	    NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
# 1024|   	    NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
# 1025|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def119]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1024:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myname’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:868:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:869:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:927:12: branch_false: following ‘false’ branch (when ‘termp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:932:11: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:977:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1004:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1012:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1013:36: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1021:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1022:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1024:13: throw: if ‘baudrate’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1024:13: danger: ‘myname’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1022|   	    NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG);
# 1023|   	    NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG);
# 1024|-> 	    NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG);
# 1025|   	}
# 1026|   	code = OK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def120]
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1135:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sp’
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1133:8: branch_true: following ‘true’ branch (when ‘sp’ is NULL)...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1134:14: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1134:14: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1135:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1135:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1135:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/lib_setup.c:1135:9: danger: ‘sp’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
# 1133|       if ((sp = _nc_find_prescr()) == NULL) {
# 1134|   	sp = _nc_alloc_screen_sp();
# 1135|-> 	T(("_nc_alloc_screen_sp %p", (void *) sp));
# 1136|   	if (sp != NULL) {
# 1137|   #ifdef USE_PTHREADS

Error: GCC_ANALYZER_WARNING (CWE-401): [#def121]
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:660:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:1288:1: enter_function: entry to ‘tiscan_s’
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:1298:9: call_function: calling ‘tparm_setup’ from ‘tiscan_s’
#  658|   		    *fs = *result;
#  659|   		    if ((fs->format = strdup(string)) != NULL) {
#  660|-> 			if (tsearch(fs, &MyCache, cmp_format) != NULL) {
#  661|   			    ++MyCount;
#  662|   			} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:660:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fs’
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:1288:1: enter_function: entry to ‘tiscan_s’
ncurses-6.5-20250614/ncurses/tinfo/lib_tparm.c:1298:9: call_function: calling ‘tparm_setup’ from ‘tiscan_s’
#  658|   		    *fs = *result;
#  659|   		    if ((fs->format = strdup(string)) != NULL) {
#  660|-> 			if (tsearch(fs, &MyCache, cmp_format) != NULL) {
#  661|   			    ++MyCount;
#  662|   			} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:73:5: warning[-Wanalyzer-malloc-leak]: leak of ‘hash_table’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:247:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:252:29: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:8: branch_false: following ‘false’ branch (when ‘argc > 3’)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:271:22: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:273:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:274:25: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:275:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:280:16: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:286:17: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:289:12: branch_true: following ‘true’ branch (when ‘nlp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:290:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:293:16: call_function: calling ‘parse_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:293:16: return_function: returning to ‘main’ from ‘parse_columns’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:294:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:296:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:299:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:36: call_function: inlined call to ‘count_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:36: call_function: inlined call to ‘count_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:13: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:310:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:310:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:319:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:319:12: branch_true: following ‘true’ branch (when ‘nn == tableused’)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:320:23: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:321:39: call_function: calling ‘strmalloc’ from ‘main’
#   71|   failed(const char *s)
#   72|   {
#   73|->     perror(s);
#   74|       exit(EXIT_FAILURE);
#   75|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:73:5: warning[-Wanalyzer-malloc-leak]: leak of ‘name_table’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:247:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:250:43: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:8: branch_false: following ‘false’ branch (when ‘argc > 3’)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:271:22: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:273:13: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:274:25: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:275:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:270:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:280:16: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:286:17: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:289:12: branch_true: following ‘true’ branch (when ‘nlp’ is non-NULL)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:290:13: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:293:16: call_function: calling ‘parse_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:293:16: return_function: returning to ‘main’ from ‘parse_columns’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:294:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:296:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:299:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:36: call_function: inlined call to ‘count_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:36: call_function: inlined call to ‘count_columns’ from ‘main’
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:302:13: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:310:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:310:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:319:12: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:319:12: branch_true: following ‘true’ branch (when ‘nn == tableused’)...
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:320:23: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/make_hash.c:321:39: call_function: calling ‘strmalloc’ from ‘main’
#   71|   failed(const char *s)
#   72|   {
#   73|->     perror(s);
#   74|       exit(EXIT_FAILURE);
#   75|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def125]
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:129:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:582:1: enter_function: entry to ‘_nc_read_file_entry’
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:588:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:596:23: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:597:12: branch_true: following ‘true’ branch (when ‘limit > 0’)...
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:598:38: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:603:25: call_function: calling ‘_nc_read_termtype’ from ‘_nc_read_file_entry’
#  127|       int i;
#  128|       for (i = 0; i < count; i++) {
#  129|-> 	if (IS_NEG1(buf + 2 * i))
#  130|   	    Numbers[i] = ABSENT_NUMERIC;
#  131|   	else if (IS_NEG2(buf + 2 * i))

Error: COMPILER_WARNING: [#def126]
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c: scope_hint: In function ‘_nc_read_termtype’
ncurses-6.5-20250614/ncurses/tinfo/read_entry.c:496:17: warning[-Wunused-but-set-variable=]: variable ‘check’ set but not used
#  496 |             int check = (ext_bool_count + ext_num_count + ext_str_count);
#      |                 ^~~~~
#  494|   
#  495|   	if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) {
#  496|-> 	    int check = (ext_bool_count + ext_num_count + ext_str_count);
#  497|   
#  498|   	    TR(TRACE_DATABASE,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:180:17: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:301:1: enter_function: entry to ‘_nc_trim_sgr0’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: call_function: calling ‘set_attribute_9’ from ‘_nc_trim_sgr0’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: return_function: returning to ‘_nc_trim_sgr0’ from ‘set_attribute_9’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:319:30: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:319:14: call_function: inlined call to ‘rewrite_sgr’ from ‘_nc_trim_sgr0’
#  178|   	    if (len_s > len_a && !strncmp(attr, s, len_a)) {
#  179|   		unsigned n;
#  180|-> 		TR(TRACE_DATABASE, ("rewrite:\n\t%s", s));
#  181|   		for (n = 0; n < len_s - len_a; ++n) {
#  182|   		    s[n] = s[n + len_a];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:185:17: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:301:1: enter_function: entry to ‘_nc_trim_sgr0’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: call_function: calling ‘set_attribute_9’ from ‘_nc_trim_sgr0’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: return_function: returning to ‘_nc_trim_sgr0’ from ‘set_attribute_9’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:319:30: branch_false: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:319:14: call_function: inlined call to ‘rewrite_sgr’ from ‘_nc_trim_sgr0’
#  183|   		}
#  184|   		_nc_STRCPY(s + n, attr, strlen(s) + 1);
#  185|-> 		TR(TRACE_DATABASE, ("to:\n\t%s", s));
#  186|   	    }
#  187|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def129]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:233: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: string
#  231|   {
#  232|       TR(TRACE_DATABASE, ("chop_out %d..%d from %s", i, j, _nc_visbuf(string)));
#  233|->     while (string[j] != '\0') {
#  234|   	string[i++] = string[j++];
#  235|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def130]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:314:9: danger: ‘end’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  312|   	char *tmp;
#  313|   
#  314|-> 	TR(TRACE_DATABASE, ("checking if we can trim sgr0 based on sgr"));
#  315|   	TR(TRACE_DATABASE, ("sgr0       %s", _nc_visbuf(end)));
#  316|   	TR(TRACE_DATABASE, ("sgr(9:off) %s", _nc_visbuf(off)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: throw: if ‘_nc_visbuf’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:315:9: danger: ‘end’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  313|   
#  314|   	TR(TRACE_DATABASE, ("checking if we can trim sgr0 based on sgr"));
#  315|-> 	TR(TRACE_DATABASE, ("sgr0       %s", _nc_visbuf(end)));
#  316|   	TR(TRACE_DATABASE, ("sgr(9:off) %s", _nc_visbuf(off)));
#  317|   	TR(TRACE_DATABASE, ("sgr(9:on)  %s", _nc_visbuf(on)));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: throw: if ‘_nc_visbuf’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:316:9: danger: ‘end’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  314|   	TR(TRACE_DATABASE, ("checking if we can trim sgr0 based on sgr"));
#  315|   	TR(TRACE_DATABASE, ("sgr0       %s", _nc_visbuf(end)));
#  316|-> 	TR(TRACE_DATABASE, ("sgr(9:off) %s", _nc_visbuf(off)));
#  317|   	TR(TRACE_DATABASE, ("sgr(9:on)  %s", _nc_visbuf(on)));
#  318|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: warning[-Wanalyzer-malloc-leak]: leak of ‘end’
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:308:12: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:307:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:309:20: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:311:21: acquire_memory: allocated here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: branch_true: ...to here
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: throw: if ‘_nc_visbuf’ throws an exception...
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:317:9: danger: ‘end’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  315|   	TR(TRACE_DATABASE, ("sgr0       %s", _nc_visbuf(end)));
#  316|   	TR(TRACE_DATABASE, ("sgr(9:off) %s", _nc_visbuf(off)));
#  317|-> 	TR(TRACE_DATABASE, ("sgr(9:on)  %s", _nc_visbuf(on)));
#  318|   
#  319|   	if (!rewrite_sgr(on, enter_alt_charset_mode)

Error: CPPCHECK_WARNING (CWE-476): [#def134]
ncurses-6.5-20250614/ncurses/tinfo/trim_sgr0.c:382: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: result
#  380|   	    }
#  381|   	    TR(TRACE_DATABASE, ("...adjusted sgr0 : %s", _nc_visbuf(result)));
#  382|-> 	    if (!strcmp(result, exit_attribute_mode)) {
#  383|   		TR(TRACE_DATABASE, ("...same result, discard"));
#  384|   		free(result);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def135]
ncurses-6.5-20250614/ncurses/tinfo/write_entry.c:580:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘src’
ncurses-6.5-20250614/ncurses/tinfo/write_entry.c:733:1: enter_function: entry to ‘_nc_write_object’
ncurses-6.5-20250614/ncurses/tinfo/write_entry.c:817:9: call_function: calling ‘fake_write’ from ‘_nc_write_object’
#  578|   	if (want > have)
#  579|   	    want = have;
#  580|-> 	memcpy(dst + *offset, src, want);
#  581|   	*offset += (unsigned) want;
#  582|       } else {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def136]
ncurses-6.5-20250614/ncurses/trace/lib_trace.c:278:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
ncurses-6.5-20250614/ncurses/trace/lib_trace.c:288:1: enter_function: entry to ‘_tracef’
ncurses-6.5-20250614/ncurses/trace/lib_trace.c:292:5: acquire_resource: ‘va_start’ called here
ncurses-6.5-20250614/ncurses/trace/lib_trace.c:293:5: call_function: calling ‘_nc_va_tracef’ from ‘_tracef’
#  276|   	vfprintf(fp, fmt, ap);
#  277|   	fputc('\n', fp);
#  278|-> 	fflush(fp);
#  279|       }
#  280|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
ncurses-6.5-20250614/panel/p_new.c:53:3: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/panel/p_new.c:51:19: acquire_memory: allocated here
ncurses-6.5-20250614/panel/p_new.c:53:3: throw: if ‘_tracef’ throws an exception...
ncurses-6.5-20250614/panel/p_new.c:53:3: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   51|     PANEL *result = typeMalloc(PANEL, 1);
#   52|   
#   53|->   _tracef("create :%s %p", name, (void *)result);
#   54|     return result;
#   55|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
ncurses-6.5-20250614/panel/p_new.c:126:13: warning[-Wanalyzer-malloc-leak]: leak of ‘pan’
ncurses-6.5-20250614/panel/p_new.c:113:6: branch_false: following ‘false’ branch (when ‘win’ is non-NULL)...
ncurses-6.5-20250614/panel/p_new.c:116:8: branch_false: ...to here
ncurses-6.5-20250614/panel/p_new.c:116:6: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/panel/p_new.c:120:14: branch_false: ...to here
ncurses-6.5-20250614/panel/p_new.c:120:14: acquire_memory: allocated here
ncurses-6.5-20250614/panel/p_new.c:120:6: branch_true: following ‘true’ branch (when ‘pan’ is non-NULL)...
ncurses-6.5-20250614/panel/p_new.c:122:7: branch_true: ...to here
ncurses-6.5-20250614/panel/p_new.c:126:13: throw: if ‘show_panel’ throws an exception...
ncurses-6.5-20250614/panel/p_new.c:126:13: danger: ‘pan’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  124|         pan->below = (PANEL *)0;
#  125|         InitUser(new);
#  126|->       (void)show_panel(pan);
#  127|       }
#  128|     returnPanel(pan);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
ncurses-6.5-20250614/progs/dump_entry.c:533:28: warning[-Wanalyzer-malloc-leak]: leak of ‘fill_spaces(src)’
ncurses-6.5-20250614/progs/dump_entry.c:1480:1: enter_function: entry to ‘dump_entry’
ncurses-6.5-20250614/progs/dump_entry.c:1491:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/dump_entry.c:1493:18: branch_true: ...to here
ncurses-6.5-20250614/progs/dump_entry.c:1499:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/dump_entry.c:1503:17: branch_true: ...to here
ncurses-6.5-20250614/progs/dump_entry.c:1503:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/dump_entry.c:1504:21: branch_true: ...to here
ncurses-6.5-20250614/progs/dump_entry.c:1504:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/dump_entry.c:1505:21: branch_true: ...to here
ncurses-6.5-20250614/progs/dump_entry.c:1505:21: call_function: calling ‘wrap_concat1’ from ‘dump_entry’
#  531|       size_t s, d;
#  532|       for (pass = 0; pass < 2; ++pass) {
#  533|-> 	for (s = d = 0; src[s] != '\0'; ++s) {
#  534|   	    if (src[s] == ' ') {
#  535|   		if (pass) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
ncurses-6.5-20250614/progs/infocmp.c:130:5: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_true: following ‘true’ branch (when ‘tfile’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1878:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1878:9: call_function: calling ‘failed’ from ‘main’
#  128|   failed(const char *s)
#  129|   {
#  130|->     perror(s);
#  131|       ExitProgram(EXIT_FAILURE);
#  132|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
ncurses-6.5-20250614/progs/infocmp.c:130:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_true: following ‘true’ branch (when ‘tname’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1880:11: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1880:11: call_function: calling ‘failed’ from ‘main’
#  128|   failed(const char *s)
#  129|   {
#  130|->     perror(s);
#  131|       ExitProgram(EXIT_FAILURE);
#  132|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
ncurses-6.5-20250614/progs/infocmp.c:130:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1882:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1882:9: call_function: calling ‘failed’ from ‘main’
#  128|   failed(const char *s)
#  129|   {
#  130|->     perror(s);
#  131|       ExitProgram(EXIT_FAILURE);
#  132|   }

Error: CPPCHECK_WARNING (CWE-401): [#def143]
ncurses-6.5-20250614/progs/infocmp.c:1397: error[memleakOnRealloc]: Common realloc mistake: 'known' nulled but not freed upon failure
# 1395|   	    if (dumped + 2 > length) {
# 1396|   		length += 100;
# 1397|-> 		known = realloc(known, length * sizeof(*known));
# 1398|   	    }
# 1399|   	    printf("\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
ncurses-6.5-20250614/progs/infocmp.c:1627:5: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1728:13: call_function: calling ‘show_databases’ from ‘main’
# 1625|       const char *path2;
# 1626|   
# 1627|->     _nc_first_db(&state, &offset);
# 1628|       while ((path2 = _nc_next_db(&state, &offset)) != NULL) {
# 1629|   	printf("%s\n", path2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
ncurses-6.5-20250614/progs/infocmp.c:1628:21: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1728:13: call_function: calling ‘show_databases’ from ‘main’
# 1626|   
# 1627|       _nc_first_db(&state, &offset);
# 1628|->     while ((path2 = _nc_next_db(&state, &offset)) != NULL) {
# 1629|   	printf("%s\n", path2);
# 1630|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
ncurses-6.5-20250614/progs/infocmp.c:1631:5: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1728:13: call_function: calling ‘show_databases’ from ‘main’
# 1629|   	printf("%s\n", path2);
# 1630|       }
# 1631|->     _nc_last_db();
# 1632|   }
# 1633|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
ncurses-6.5-20250614/progs/infocmp.c:1710:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1710:13: throw: if ‘use_extended_names’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1710:13: danger: ‘myargv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1708|   	case 'a':
# 1709|   	    _nc_disable_period = TRUE;
# 1710|-> 	    use_extended_names(TRUE);
# 1711|   	    break;
# 1712|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
ncurses-6.5-20250614/progs/infocmp.c:1849:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1849:13: throw: if ‘curses_version’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1849:13: danger: ‘myargv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1847|   
# 1848|   	case 'V':
# 1849|-> 	    puts(curses_version());
# 1850|   	    ExitProgram(EXIT_SUCCESS);
# 1851|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
ncurses-6.5-20250614/progs/infocmp.c:1867:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1867:13: throw: if ‘use_extended_names’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1867:13: danger: ‘myargv’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1865|   #if NCURSES_XNAMES
# 1866|   	case 'x':
# 1867|-> 	    use_extended_names(TRUE);
# 1868|   	    break;
# 1869|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
ncurses-6.5-20250614/progs/infocmp.c:1923:5: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1923:5: throw: if ‘dump_init’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1923:5: danger: ‘myargv’ leaks here; was allocated at [(2)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/1)
# 1921|   
# 1922|       /* set up for display */
# 1923|->     dump_init(tversion, outform, sortmode,
# 1924|   	      wrap_strings, mwidth, mheight, itrace,
# 1925|   	      formatted, FALSE, quickdump);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
ncurses-6.5-20250614/progs/infocmp.c:1923:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1923:5: throw: if ‘dump_init’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1923:5: danger: ‘tfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/3)
# 1921|   
# 1922|       /* set up for display */
# 1923|->     dump_init(tversion, outform, sortmode,
# 1924|   	      wrap_strings, mwidth, mheight, itrace,
# 1925|   	      formatted, FALSE, quickdump);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
ncurses-6.5-20250614/progs/infocmp.c:1923:5: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1923:5: throw: if ‘dump_init’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1923:5: danger: ‘tname’ leaks here; was allocated at [(6)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/5)
# 1921|   
# 1922|       /* set up for display */
# 1923|->     dump_init(tversion, outform, sortmode,
# 1924|   	      wrap_strings, mwidth, mheight, itrace,
# 1925|   	      formatted, FALSE, quickdump);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
ncurses-6.5-20250614/progs/infocmp.c:1954:26: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1896:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1897:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1900:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1901:14: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1904:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1909:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1909:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1910:17: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_true: following ‘true’ branch (when ‘directory’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1947:29: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1948:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1955:54: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1954:26: throw: if ‘_nc_read_file_entry’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1954:26: danger: ‘myargv’ leaks here; was allocated at [(2)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/1)
# 1952|   				   argv[optind], tfile[termcount]);
# 1953|   
# 1954|-> 		status = _nc_read_file_entry(tfile[termcount],
# 1955|   					     &entries[termcount].tterm);
# 1956|   #else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
ncurses-6.5-20250614/progs/infocmp.c:1954:26: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1896:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1897:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1900:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1901:14: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1904:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1909:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1909:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1910:17: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_true: following ‘true’ branch (when ‘directory’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1947:29: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1948:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1955:54: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1954:26: throw: if ‘_nc_read_file_entry’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1954:26: danger: ‘tfile’ leaks here; was allocated at [(6)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/5)
# 1952|   				   argv[optind], tfile[termcount]);
# 1953|   
# 1954|-> 		status = _nc_read_file_entry(tfile[termcount],
# 1955|   					     &entries[termcount].tterm);
# 1956|   #else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def155]
ncurses-6.5-20250614/progs/infocmp.c:1954:26: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1896:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1897:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1900:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1901:14: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1904:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1909:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1909:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1910:17: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_true: following ‘true’ branch (when ‘directory’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1947:29: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1948:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1955:54: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1954:26: throw: if ‘_nc_read_file_entry’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1954:26: danger: ‘tname’ leaks here; was allocated at [(8)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/7)
# 1952|   				   argv[optind], tfile[termcount]);
# 1953|   
# 1954|-> 		status = _nc_read_file_entry(tfile[termcount],
# 1955|   					     &entries[termcount].tterm);
# 1956|   #else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
ncurses-6.5-20250614/progs/infocmp.c:1969:26: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1969:26: throw: if ‘_nc_read_entry2’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1969:26: danger: ‘myargv’ leaks here; was allocated at [(2)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/1)
# 1967|   				   tname[termcount]);
# 1968|   
# 1969|-> 		status = _nc_read_entry2(tname[termcount],
# 1970|   					 tfile[termcount],
# 1971|   					 &entries[termcount].tterm);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
ncurses-6.5-20250614/progs/infocmp.c:1969:26: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1969:26: throw: if ‘_nc_read_entry2’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1969:26: danger: ‘tfile’ leaks here; was allocated at [(4)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/3)
# 1967|   				   tname[termcount]);
# 1968|   
# 1969|-> 		status = _nc_read_entry2(tname[termcount],
# 1970|   					 tfile[termcount],
# 1971|   					 &entries[termcount].tterm);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def158]
ncurses-6.5-20250614/progs/infocmp.c:1969:26: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1969:26: throw: if ‘_nc_read_entry2’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:1969:26: danger: ‘tname’ leaks here; was allocated at [(6)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/5)
# 1967|   				   tname[termcount]);
# 1968|   
# 1969|-> 		status = _nc_read_entry2(tname[termcount],
# 1970|   					 tfile[termcount],
# 1971|   					 &entries[termcount].tterm);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
ncurses-6.5-20250614/progs/infocmp.c:2004:13: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2004:13: throw: if ‘repair_acsc’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2004:13: danger: ‘myargv’ leaks here; was allocated at [(2)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/1)
# 2002|   		ExitProgram(EXIT_FAILURE);
# 2003|   	    }
# 2004|-> 	    repair_acsc(&entries[termcount].tterm);
# 2005|   	    termcount++;
# 2006|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
ncurses-6.5-20250614/progs/infocmp.c:2004:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1896:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1897:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1900:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1901:14: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1904:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1909:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1909:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1910:17: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_true: following ‘true’ branch (when ‘directory’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1947:29: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1948:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1955:54: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2004:13: throw: if ‘repair_acsc’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2004:13: danger: ‘tfile’ leaks here; was allocated at [(6)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/5)
# 2002|   		ExitProgram(EXIT_FAILURE);
# 2003|   	    }
# 2004|-> 	    repair_acsc(&entries[termcount].tterm);
# 2005|   	    termcount++;
# 2006|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
ncurses-6.5-20250614/progs/infocmp.c:2004:13: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2004:13: throw: if ‘repair_acsc’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2004:13: danger: ‘tname’ leaks here; was allocated at [(6)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/5)
# 2002|   		ExitProgram(EXIT_FAILURE);
# 2003|   	    }
# 2004|-> 	    repair_acsc(&entries[termcount].tterm);
# 2005|   	    termcount++;
# 2006|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
ncurses-6.5-20250614/progs/infocmp.c:2017:17: warning[-Wanalyzer-malloc-leak]: leak of ‘myargv’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1683:14: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:13: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2016:25: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2017:56: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2017:17: throw: if ‘_nc_align_termtype’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2017:17: danger: ‘myargv’ leaks here; was allocated at [(2)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/1)
# 2015|   	     */
# 2016|   	    for (c = 1; c < termcount; ++c)
# 2017|-> 		_nc_align_termtype(&entries[c].tterm, &entries[0].tterm);
# 2018|   	}
# 2019|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
ncurses-6.5-20250614/progs/infocmp.c:2017:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tfile’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1690:12: branch_true: following ‘true’ branch (when ‘c != -1’)...
ncurses-6.5-20250614/progs/infocmp.c:1693:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1896:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1897:9: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1900:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1901:14: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1904:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1909:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1909:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1910:17: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_true: following ‘true’ branch (when ‘directory’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1947:29: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1948:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1955:54: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:13: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2016:25: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2017:56: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2017:17: throw: if ‘_nc_align_termtype’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2017:17: danger: ‘tfile’ leaks here; was allocated at [(6)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/5)
# 2015|   	     */
# 2016|   	    for (c = 1; c < termcount; ++c)
# 2017|-> 		_nc_align_termtype(&entries[c].tterm, &entries[0].tterm);
# 2018|   	}
# 2019|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
ncurses-6.5-20250614/progs/infocmp.c:2017:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tname’
ncurses-6.5-20250614/progs/infocmp.c:1652:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1684:8: branch_false: following ‘false’ branch (when ‘myargv’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1687:44: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1877:8: branch_false: following ‘false’ branch (when ‘tfile’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1879:18: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1879:18: acquire_memory: allocated here
ncurses-6.5-20250614/progs/infocmp.c:1879:8: branch_false: following ‘false’ branch (when ‘tname’ is non-NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1881:20: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1881:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1896:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1901:24: call_function: calling ‘terminal_env’ from ‘main’
ncurses-6.5-20250614/progs/infocmp.c:1901:24: return_function: returning to ‘main’ from ‘terminal_env’
ncurses-6.5-20250614/progs/infocmp.c:1927:8: branch_false: following ‘false’ branch (when ‘filecompare == 0’)...
ncurses-6.5-20250614/progs/infocmp.c:1929:9: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:47: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:1931:25: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1936:16: branch_false: following ‘false’ branch (when ‘directory’ is NULL)...
ncurses-6.5-20250614/progs/infocmp.c:1963:21: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1974:16: branch_false: following ‘false’ branch (when ‘status > 0’)...
ncurses-6.5-20250614/progs/infocmp.c:2004:33: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:1930:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:13: branch_false: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2009:12: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2016:25: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/infocmp.c:2017:56: branch_true: ...to here
ncurses-6.5-20250614/progs/infocmp.c:2017:17: throw: if ‘_nc_align_termtype’ throws an exception...
ncurses-6.5-20250614/progs/infocmp.c:2017:17: danger: ‘tname’ leaks here; was allocated at [(6)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/5)
# 2015|   	     */
# 2016|   	    for (c = 1; c < termcount; ++c)
# 2017|-> 		_nc_align_termtype(&entries[c].tterm, &entries[0].tterm);
# 2018|   	}
# 2019|   #endif

Error: GCC_ANALYZER_WARNING (CWE-688): [#def165]
ncurses-6.5-20250614/progs/tabs.c:125:19: warning[-Wanalyzer-null-argument]: use of NULL ‘tab_list’ where non-null expected
ncurses-6.5-20250614/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/tabs.c:487:11: release_memory: ‘append’ is NULL
ncurses-6.5-20250614/progs/tabs.c:637:8: branch_false: following ‘false’ branch (when ‘margin <= 0’)...
ncurses-6.5-20250614/progs/tabs.c:640:10: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:640:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tabs.c:644:17: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:644:15: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tabs.c:648:16: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:648:16: call_function: calling ‘legal_tab_list’ from ‘main’
ncurses-6.5-20250614/progs/tabs.c:648:16: return_function: returning to ‘main’ from ‘legal_tab_list’
ncurses-6.5-20250614/progs/tabs.c:648:15: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tabs.c:651:12: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:651:12: branch_true: following ‘true’ branch (when ‘tab_list’ is NULL)...
ncurses-6.5-20250614/progs/tabs.c:652:24: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:652:24: call_function: calling ‘add_to_tab_list’ from ‘main’
ncurses-6.5-20250614/progs/tabs.c:652:24: return_function: returning to ‘main’ from ‘add_to_tab_list’
ncurses-6.5-20250614/progs/tabs.c:654:12: branch_false: following ‘false’ branch (when ‘no_op == 0’)...
ncurses-6.5-20250614/progs/tabs.c:657:17: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:657:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tabs.c:666:18: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:671:12: branch_false: following ‘false’ branch (when ‘margin < 0’)...
ncurses-6.5-20250614/progs/tabs.c:671:12: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:684:16: call_function: calling ‘decode_tabs’ from ‘main’
#  123|   decode_tabs(const char *tab_list, int margin)
#  124|   {
#  125|->     int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols);
#  126|       int n = 0;
#  127|       int value = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def166]
ncurses-6.5-20250614/progs/tabs.c:256:38: warning[-Wanalyzer-malloc-leak]: leak of ‘trimmed_tab_list(value)’
ncurses-6.5-20250614/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/tabs.c:500:17: branch_true: following ‘true’ branch (when ‘n < argc’)...
ncurses-6.5-20250614/progs/tabs.c:501:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:620:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tabs.c:627:24: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:627:24: call_function: calling ‘add_to_tab_list’ from ‘main’
#  254|   	int j, k, last;
#  255|   
#  256|-> 	for (j = k = last = 0; result[j] != 0; ++j) {
#  257|   	    int ch = UChar(result[j]);
#  258|   	    if (isspace(ch)) {

Error: CPPCHECK_WARNING (CWE-476): [#def167]
ncurses-6.5-20250614/progs/tabs.c:433: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  431|   skip_list(char *value)
#  432|   {
#  433|->     while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||

Error: GCC_ANALYZER_WARNING (CWE-476): [#def168]
ncurses-6.5-20250614/progs/tabs.c:433:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘value’
ncurses-6.5-20250614/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/tabs.c:500:17: branch_true: following ‘true’ branch (when ‘n < argc’)...
ncurses-6.5-20250614/progs/tabs.c:501:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:574:24: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tabs.c:575:38: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:575:38: acquire_memory: this call could return NULL
ncurses-6.5-20250614/progs/tabs.c:576:26: call_function: calling ‘skip_list’ from ‘main’
#  431|   skip_list(char *value)
#  432|   {
#  433|->     while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||

Error: CPPCHECK_WARNING (CWE-476): [#def169]
ncurses-6.5-20250614/progs/tabs.c:434: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  432|   {
#  433|       while (*value != '\0' &&
#  434|-> 	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||
#  436|   	    strchr("+,", UChar(*value)) != NULL)) {

Error: CPPCHECK_WARNING (CWE-476): [#def170]
ncurses-6.5-20250614/progs/tabs.c:435: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  433|       while (*value != '\0' &&
#  434|   	   (isdigit(UChar(*value)) ||
#  435|-> 	    isspace(UChar(*value)) ||
#  436|   	    strchr("+,", UChar(*value)) != NULL)) {
#  437|   	++value;

Error: CPPCHECK_WARNING (CWE-476): [#def171]
ncurses-6.5-20250614/progs/tabs.c:436: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: value
#  434|   	   (isdigit(UChar(*value)) ||
#  435|   	    isspace(UChar(*value)) ||
#  436|-> 	    strchr("+,", UChar(*value)) != NULL)) {
#  437|   	++value;
#  438|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
ncurses-6.5-20250614/progs/tabs.c:472:5: warning[-Wanalyzer-malloc-leak]: leak of ‘copy’
ncurses-6.5-20250614/progs/tabs.c:479:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/tabs.c:500:17: branch_true: following ‘true’ branch (when ‘n < argc’)...
ncurses-6.5-20250614/progs/tabs.c:501:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:574:24: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tabs.c:575:38: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:575:38: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tabs.c:576:26: call_function: calling ‘skip_list’ from ‘main’
ncurses-6.5-20250614/progs/tabs.c:576:26: return_function: returning to ‘main’ from ‘skip_list’
ncurses-6.5-20250614/progs/tabs.c:578:34: call_function: calling ‘skip_list’ from ‘main’
ncurses-6.5-20250614/progs/tabs.c:578:34: return_function: returning to ‘main’ from ‘skip_list’
ncurses-6.5-20250614/progs/tabs.c:504:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tabs.c:505:17: branch_true: ...to here
ncurses-6.5-20250614/progs/tabs.c:574:24: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tabs.c:580:25: branch_false: ...to here
ncurses-6.5-20250614/progs/tabs.c:580:25: call_function: calling ‘usage’ from ‘main’
#  470|       FILE *fp = stderr;
#  471|   
#  472|->     fflush(stdout);
#  473|       fprintf(fp, "Usage: %s [options] [tabstop-list]\n", _nc_progname);
#  474|       fputs(msg, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
ncurses-6.5-20250614/progs/tic.c:141:5: warning[-Wanalyzer-malloc-leak]: leak of ‘check’
ncurses-6.5-20250614/progs/tic.c:2752:1: enter_function: entry to ‘check_conflict’
ncurses-6.5-20250614/progs/tic.c:2755:23: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2756:29: call_function: calling ‘get_fkey_list’ from ‘check_conflict’
#  139|   failed(const char *msg)
#  140|   {
#  141|->     perror(msg);
#  142|       ExitProgram(EXIT_FAILURE);
#  143|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
ncurses-6.5-20250614/progs/tic.c:141:5: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
ncurses-6.5-20250614/progs/tic.c:494:1: enter_function: entry to ‘make_namelist’
ncurses-6.5-20250614/progs/tic.c:502:8: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:504:16: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:504:15: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:505:20: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:505:20: call_function: calling ‘open_input’ from ‘make_namelist’
ncurses-6.5-20250614/progs/tic.c:505:20: return_function: returning to ‘make_namelist’ from ‘open_input’
ncurses-6.5-20250614/progs/tic.c:507:24: branch_true: following ‘true’ branch (when ‘pass != 3’)...
ncurses-6.5-20250614/progs/tic.c:507:24: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:518:16: branch_true: following ‘true’ branch (when ‘pass == 1’)...
ncurses-6.5-20250614/progs/tic.c:519:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:519:28: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:519:20: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:521:17: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:522:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:523:21: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:523:21: call_function: calling ‘failed’ from ‘make_namelist’
#  139|   failed(const char *msg)
#  140|   {
#  141|->     perror(msg);
#  142|       ExitProgram(EXIT_FAILURE);
#  143|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
ncurses-6.5-20250614/progs/tic.c:426:22: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.5-20250614/progs/tic.c:410:1: enter_function: entry to ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:419:8: branch_false: following ‘false’ branch (when ‘source’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:421:26: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:421:26: call_function: calling ‘open_tempfile’ from ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:421:26: return_function: returning to ‘copy_input’ from ‘open_tempfile’
ncurses-6.5-20250614/progs/tic.c:421:15: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:424:9: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:426:22: throw: if ‘fgetc’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:426:22: danger: ‘open_tempfile(alt_file)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7)
#  424|   	clearerr(source);
#  425|   	for (;;) {
#  426|-> 	    int ch = fgetc(source);
#  427|   	    if (feof(source)) {
#  428|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
ncurses-6.5-20250614/progs/tic.c:429:23: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.5-20250614/progs/tic.c:410:1: enter_function: entry to ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:419:8: branch_false: following ‘false’ branch (when ‘source’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:421:26: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:421:26: call_function: calling ‘open_tempfile’ from ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:421:26: return_function: returning to ‘copy_input’ from ‘open_tempfile’
ncurses-6.5-20250614/progs/tic.c:421:15: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:424:9: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:427:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:429:24: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:429:23: danger: ‘open_tempfile(alt_file)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/7)
#  427|   	    if (feof(source)) {
#  428|   		break;
#  429|-> 	    } else if (ferror(source)) {
#  430|   		failed(filename);
#  431|   	    } else if (ch == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
ncurses-6.5-20250614/progs/tic.c:431:23: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.5-20250614/progs/tic.c:410:1: enter_function: entry to ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:419:8: branch_false: following ‘false’ branch (when ‘source’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:421:26: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:421:26: call_function: calling ‘open_tempfile’ from ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:421:26: return_function: returning to ‘copy_input’ from ‘open_tempfile’
ncurses-6.5-20250614/progs/tic.c:421:15: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:424:9: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:427:16: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:429:24: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:429:23: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:431:23: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:431:23: danger: ‘open_tempfile(alt_file)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
#  429|   	    } else if (ferror(source)) {
#  430|   		failed(filename);
#  431|-> 	    } else if (ch == 0) {
#  432|   		/* don't loop in case someone wants to convert /dev/zero */
#  433|   		fprintf(stderr, "%s: %s is not a text-file\n", _nc_progname, filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
ncurses-6.5-20250614/progs/tic.c:445:18: warning[-Wanalyzer-malloc-leak]: leak of ‘open_tempfile(alt_file)’
ncurses-6.5-20250614/progs/tic.c:410:1: enter_function: entry to ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:419:8: branch_false: following ‘false’ branch (when ‘source’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:421:26: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:421:26: call_function: calling ‘open_tempfile’ from ‘copy_input’
ncurses-6.5-20250614/progs/tic.c:421:26: return_function: returning to ‘copy_input’ from ‘open_tempfile’
ncurses-6.5-20250614/progs/tic.c:421:15: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:424:9: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:445:18: throw: if ‘_nc_safe_fopen’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:445:18: danger: ‘open_tempfile(alt_file)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/7)
#  443|   	 * second stream.
#  444|   	 */
#  445|-> 	result = safe_fopen(alt_file, "r+");
#  446|   	fclose(target);
#  447|   	to_remove = strdup(alt_file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
ncurses-6.5-20250614/progs/tic.c:521:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
ncurses-6.5-20250614/progs/tic.c:494:1: enter_function: entry to ‘make_namelist’
ncurses-6.5-20250614/progs/tic.c:502:8: branch_false: following ‘false’ branch (when ‘src’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:504:16: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:504:15: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:505:20: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:505:20: call_function: calling ‘open_input’ from ‘make_namelist’
ncurses-6.5-20250614/progs/tic.c:505:20: return_function: returning to ‘make_namelist’ from ‘open_input’
ncurses-6.5-20250614/progs/tic.c:507:24: branch_true: following ‘true’ branch (when ‘pass != 3’)...
ncurses-6.5-20250614/progs/tic.c:507:24: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:509:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:518:16: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:518:16: branch_true: following ‘true’ branch (when ‘pass == 1’)...
ncurses-6.5-20250614/progs/tic.c:519:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:519:28: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:519:20: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:521:17: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:521:17: throw: if ‘rewind’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:521:17: danger: ‘dst’ leaks here; was allocated at [(29)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/28)
#  519|   		if ((dst = typeCalloc(char *, nn + 1)) == NULL)
#  520|   		      failed("make_namelist (alloc)");
#  521|-> 		rewind(fp);
#  522|   		if (errno != 0)
#  523|   		    failed("make_namelist (rewind)");

Error: GCC_ANALYZER_WARNING (CWE-688): [#def180]
ncurses-6.5-20250614/progs/tic.c:598:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected
ncurses-6.5-20250614/progs/tic.c:594:20: acquire_memory: this call could return NULL
ncurses-6.5-20250614/progs/tic.c:598:9: danger: argument 1 (‘result’) from [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#  596|   
#  597|       DEBUG(1, ("** stat(%s)", result));
#  598|->     if (stat(result, &sb) >= 0) {
#  599|   #if USE_HASHED_DB
#  600|   	if (!S_ISREG(sb.st_mode)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
ncurses-6.5-20250614/progs/tic.c:607:14: warning[-Wanalyzer-malloc-leak]: leak of ‘valid_db_path(_nc_home_terminfo())’
ncurses-6.5-20250614/progs/tic.c:646:1: enter_function: entry to ‘show_databases’
ncurses-6.5-20250614/progs/tic.c:648:21: branch_true: following ‘true’ branch (when ‘outdir’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:655:19: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:655:19: call_function: calling ‘valid_db_path’ from ‘show_databases’
ncurses-6.5-20250614/progs/tic.c:655:19: return_function: returning to ‘show_databases’ from ‘valid_db_path’
ncurses-6.5-20250614/progs/tic.c:655:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:662:19: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:662:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:663:23: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:663:23: call_function: calling ‘valid_db_path’ from ‘show_databases’
ncurses-6.5-20250614/progs/tic.c:663:23: return_function: returning to ‘show_databases’ from ‘valid_db_path’
ncurses-6.5-20250614/progs/tic.c:607:14: danger: ‘valid_db_path(_nc_home_terminfo())’ leaks here; was allocated at [(15)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/14)
#  605|   	}
#  606|   #else
#  607|-> 	if (!S_ISDIR(sb.st_mode)
#  608|   	    || access(result, R_OK | W_OK | X_OK) != 0) {
#  609|   	    DEBUG(1, ("...not a writable directory"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
ncurses-6.5-20250614/progs/tic.c:607:14: warning[-Wanalyzer-malloc-leak]: leak of ‘valid_db_path(outdir)’
ncurses-6.5-20250614/progs/tic.c:646:1: enter_function: entry to ‘show_databases’
ncurses-6.5-20250614/progs/tic.c:648:21: branch_true: following ‘true’ branch (when ‘outdir’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:655:19: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:655:19: call_function: calling ‘valid_db_path’ from ‘show_databases’
ncurses-6.5-20250614/progs/tic.c:655:19: return_function: returning to ‘show_databases’ from ‘valid_db_path’
ncurses-6.5-20250614/progs/tic.c:607:14: danger: ‘valid_db_path(outdir)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/5)
#  605|   	}
#  606|   #else
#  607|-> 	if (!S_ISDIR(sb.st_mode)
#  608|   	    || access(result, R_OK | W_OK | X_OK) != 0) {
#  609|   	    DEBUG(1, ("...not a writable directory"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
ncurses-6.5-20250614/progs/tic.c:616:25: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
ncurses-6.5-20250614/progs/tic.c:594:20: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:598:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:616:25: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:616:25: throw: if ‘_nc_pathlast’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:616:25: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  614|       } else {
#  615|   	/* check if parent is directory and is writable */
#  616|-> 	unsigned leaf = _nc_pathlast(result);
#  617|   
#  618|   	DEBUG(1, ("...not found"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
ncurses-6.5-20250614/progs/tic.c:1224:42: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(value)’
ncurses-6.5-20250614/progs/tic.c:1214:1: enter_function: entry to ‘same_color’
ncurses-6.5-20250614/progs/tic.c:1219:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:1219:8: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:1222:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:1223:42: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:1223:30: call_function: inlined call to ‘safe_strdup’ from ‘same_color’
ncurses-6.5-20250614/progs/tic.c:1224:42: throw: if ‘_nc_tiparm’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:1224:42: danger: ‘strdup(value)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
# 1222|   	for (n = same = 0; n < limit; ++n) {
# 1223|   	    char *oldvalue = safe_strdup(TIPARM_1(oldcap, n));
# 1224|-> 	    char *newvalue = safe_strdup(TIPARM_1(newcap, n));
# 1225|   	    same += !strcmp(oldvalue, newvalue);
# 1226|   	    free(oldvalue);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def185]
ncurses-6.5-20250614/progs/tic.c:1225:22: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘strdup(value)’ where non-null expected
ncurses-6.5-20250614/progs/tic.c:1214:1: enter_function: entry to ‘same_color’
ncurses-6.5-20250614/progs/tic.c:1219:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:1219:8: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:1222:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:1223:42: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:1223:30: call_function: inlined call to ‘safe_strdup’ from ‘same_color’
ncurses-6.5-20250614/progs/tic.c:1224:30: call_function: inlined call to ‘safe_strdup’ from ‘same_color’
ncurses-6.5-20250614/progs/tic.c:1225:22: danger: argument 1 (‘strdup(value)’) from [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8) could be NULL where non-null expected
# 1223|   	    char *oldvalue = safe_strdup(TIPARM_1(oldcap, n));
# 1224|   	    char *newvalue = safe_strdup(TIPARM_1(newcap, n));
# 1225|-> 	    same += !strcmp(oldvalue, newvalue);
# 1226|   	    free(oldvalue);
# 1227|   	    free(newvalue);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def186]
ncurses-6.5-20250614/progs/tic.c:2260:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/progs/tic.c:2258:17: branch_true: following ‘true’ branch (when ‘k != 10’)...
ncurses-6.5-20250614/progs/tic.c:2259:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2260:9: danger: out-of-bounds write at byte 90 but ‘blob’ ends at byte 90
# 2258|       for (k = 1; k <= NUM_PARM; k++) {
# 2259|   	numbers[k] = count;
# 2260|-> 	_nc_SPRINTF(next,
# 2261|   		    _nc_SLIMIT(sizeof(blob) - (size_t) (next - blob))
# 2262|   		    "XYZ%d", count);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
ncurses-6.5-20250614/progs/tic.c:2267:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2446:1: enter_function: entry to ‘check_infotocap’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_true: following ‘true’ branch (when ‘params > 0’)...
ncurses-6.5-20250614/progs/tic.c:2470:18: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2477:29: branch_true: following ‘true’ branch (when ‘limit > count’)...
ncurses-6.5-20250614/progs/tic.c:2478:34: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2478:34: call_function: calling ‘check_1_infotocap’ from ‘check_infotocap’
# 2265|       }
# 2266|   
# 2267|->     _nc_reset_tparm(NULL);
# 2268|       expect = tparm_type(name);
# 2269|       nparam = _nc_tparm_analyze(NULL, value, p_is_s, &ignored);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
ncurses-6.5-20250614/progs/tic.c:2268:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2446:1: enter_function: entry to ‘check_infotocap’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_true: following ‘true’ branch (when ‘params > 0’)...
ncurses-6.5-20250614/progs/tic.c:2470:18: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2477:29: branch_true: following ‘true’ branch (when ‘limit > count’)...
ncurses-6.5-20250614/progs/tic.c:2478:34: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2478:34: call_function: calling ‘check_1_infotocap’ from ‘check_infotocap’
# 2266|   
# 2267|       _nc_reset_tparm(NULL);
# 2268|->     expect = tparm_type(name);
# 2269|       nparam = _nc_tparm_analyze(NULL, value, p_is_s, &ignored);
# 2270|       actual = guess_tparm_type(nparam, p_is_s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
ncurses-6.5-20250614/progs/tic.c:2269:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2446:1: enter_function: entry to ‘check_infotocap’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_true: following ‘true’ branch (when ‘params > 0’)...
ncurses-6.5-20250614/progs/tic.c:2470:18: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2477:29: branch_true: following ‘true’ branch (when ‘limit > count’)...
ncurses-6.5-20250614/progs/tic.c:2478:34: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2478:34: call_function: calling ‘check_1_infotocap’ from ‘check_infotocap’
# 2267|       _nc_reset_tparm(NULL);
# 2268|       expect = tparm_type(name);
# 2269|->     nparam = _nc_tparm_analyze(NULL, value, p_is_s, &ignored);
# 2270|       actual = guess_tparm_type(nparam, p_is_s);
# 2271|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
ncurses-6.5-20250614/progs/tic.c:2270:14: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2446:1: enter_function: entry to ‘check_infotocap’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:12: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2465:19: branch_true: following ‘true’ branch (when ‘params > 0’)...
ncurses-6.5-20250614/progs/tic.c:2470:18: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2477:29: branch_true: following ‘true’ branch (when ‘limit > count’)...
ncurses-6.5-20250614/progs/tic.c:2478:34: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2478:34: call_function: calling ‘check_1_infotocap’ from ‘check_infotocap’
# 2268|       expect = tparm_type(name);
# 2269|       nparam = _nc_tparm_analyze(NULL, value, p_is_s, &ignored);
# 2270|->     actual = guess_tparm_type(nparam, p_is_s);
# 2271|   
# 2272|       if (expect != actual) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def191]
ncurses-6.5-20250614/progs/tic.c:2353:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘always’
ncurses-6.5-20250614/progs/tic.c:2394:1: enter_function: entry to ‘same_ti_tc’
ncurses-6.5-20250614/progs/tic.c:2403:10: call_function: inlined call to ‘parse_tc_delay’ from ‘same_ti_tc’
# 2351|   	    star = 1;
# 2352|   	} else {
# 2353|-> 	    *always = 1;
# 2354|   	}
# 2355|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
ncurses-6.5-20250614/progs/tic.c:2461:28: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: following ‘false’ branch (when ‘i > 413’)...
ncurses-6.5-20250614/progs/tic.c:2459:27: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2459:25: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:2461:28: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2461:28: throw: if ‘has_params’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:2461:28: danger: ‘ti_value’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
# 2459|   		      : ((*value == 'k')
# 2460|   			 ? 0
# 2461|-> 			 : has_params(value, FALSE)));
# 2462|   
# 2463|   	if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
ncurses-6.5-20250614/progs/tic.c:2463:25: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:25: throw: if ‘_nc_infotocap’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:2463:25: danger: ‘ti_value’ leaks here; was allocated at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
# 2461|   			 : has_params(value, FALSE)));
# 2462|   
# 2463|-> 	if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) {
# 2464|   	    _nc_warning("tic-conversion of %s failed", name);
# 2465|   	} else if (params > 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
ncurses-6.5-20250614/progs/tic.c:2464:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ti_value’
ncurses-6.5-20250614/progs/tic.c:2452:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/tic.c:2452:45: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2452:45: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tic.c:2452:9: branch_false: following ‘false’ branch (when ‘ti_value’ is non-NULL)...
ncurses-6.5-20250614/progs/tic.c:2457:22: branch_false: ...to here
ncurses-6.5-20250614/progs/tic.c:2463:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tic.c:2464:13: branch_true: ...to here
ncurses-6.5-20250614/progs/tic.c:2464:13: throw: if ‘_nc_warning’ throws an exception...
ncurses-6.5-20250614/progs/tic.c:2464:13: danger: ‘ti_value’ leaks here; was allocated at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
# 2462|   
# 2463|   	if ((tc_value = _nc_infotocap(name, ti_value, params)) == ABSENT_STRING) {
# 2464|-> 	    _nc_warning("tic-conversion of %s failed", name);
# 2465|   	} else if (params > 0) {
# 2466|   	    int limit = 5;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
ncurses-6.5-20250614/progs/tic.c:2703:26: warning[-Wanalyzer-malloc-leak]: leak of ‘get_fkey_list(tp)’
ncurses-6.5-20250614/progs/tic.c:2752:1: enter_function: entry to ‘check_conflict’
ncurses-6.5-20250614/progs/tic.c:2756:29: call_function: calling ‘get_fkey_list’ from ‘check_conflict’
ncurses-6.5-20250614/progs/tic.c:2756:29: return_function: returning to ‘check_conflict’ from ‘get_fkey_list’
ncurses-6.5-20250614/progs/tic.c:2703:26: danger: ‘get_fkey_list(tp)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/3)
# 2701|   get_fkey_list(TERMTYPE2 *tp)
# 2702|   {
# 2703|->     NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1);
# 2704|       const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys;
# 2705|       int used = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
ncurses-6.5-20250614/progs/toe.c:81:5: warning[-Wanalyzer-malloc-leak]: leak of ‘eargv’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: following ‘true’ branch (when ‘all_dirs != 0’)...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:748:16: branch_true: following ‘true’ branch (when ‘pass == 0’)...
ncurses-6.5-20250614/progs/toe.c:749:25: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:749:25: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:749:25: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:740:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:741:21: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:743:20: branch_true: following ‘true’ branch (when ‘pass != 0’)...
ncurses-6.5-20250614/progs/toe.c:744:26: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:744:36: call_function: calling ‘strmalloc’ from ‘main’
#   79|   failed(const char *msg)
#   80|   {
#   81|->     perror(msg);
#   82|       ExitProgram(EXIT_FAILURE);
#   83|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
ncurses-6.5-20250614/progs/toe.c:219:21: warning[-Wanalyzer-malloc-leak]: leak of ‘allocArgv(2)’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: following ‘false’ branch (when ‘all_dirs == 0’)...
ncurses-6.5-20250614/progs/toe.c:761:24: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:761:24: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:761:24: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:766:9: throw: if ‘_nc_first_db’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:219:21: danger: ‘allocArgv(2)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/13)
#  217|   allocArgv(size_t count)
#  218|   {
#  219|->     char **result = typeCalloc(char *, count + 1);
#  220|       if (result == NULL)
#  221|   	failed("realloc eargv");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
ncurses-6.5-20250614/progs/toe.c:390:18: warning[-Wanalyzer-malloc-leak]: leak of ‘copy_entryname(readdir(opendir(".")))’
ncurses-6.5-20250614/progs/toe.c:402:1: enter_function: entry to ‘typelist’
ncurses-6.5-20250614/progs/toe.c:409:17: branch_true: following ‘true’ branch (when ‘i < eargc’)...
ncurses-6.5-20250614/progs/toe.c:411:34: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:433:26: call_function: calling ‘copy_entryname’ from ‘typelist’
ncurses-6.5-20250614/progs/toe.c:433:26: return_function: returning to ‘typelist’ from ‘copy_entryname’
ncurses-6.5-20250614/progs/toe.c:441:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:446:17: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:464:30: call_function: calling ‘copy_entryname’ from ‘typelist’
ncurses-6.5-20250614/progs/toe.c:464:30: return_function: returning to ‘typelist’ from ‘copy_entryname’
ncurses-6.5-20250614/progs/toe.c:484:25: throw: if the called function throws an exception...
ncurses-6.5-20250614/progs/toe.c:390:18: danger: ‘copy_entryname(readdir(opendir(".")))’ leaks here; was allocated at [(15)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/14)
#  388|   copy_entryname(const DIRENT * src)
#  389|   {
#  390|->     size_t len = NAMLEN(src);
#  391|       char *result = malloc(len + 1);
#  392|       if (result == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
ncurses-6.5-20250614/progs/toe.c:390:18: warning[-Wanalyzer-malloc-leak]: leak of ‘copy_entryname(readdir(opendir(*<unknown>)))’
ncurses-6.5-20250614/progs/toe.c:402:1: enter_function: entry to ‘typelist’
ncurses-6.5-20250614/progs/toe.c:409:17: branch_true: following ‘true’ branch (when ‘i < eargc’)...
ncurses-6.5-20250614/progs/toe.c:411:34: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:433:26: call_function: calling ‘copy_entryname’ from ‘typelist’
ncurses-6.5-20250614/progs/toe.c:433:26: return_function: returning to ‘typelist’ from ‘copy_entryname’
ncurses-6.5-20250614/progs/toe.c:440:27: throw: if ‘_nc_doalloc’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:390:18: danger: ‘copy_entryname(readdir(opendir(*<unknown>)))’ leaks here; was allocated at [(6)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/5)
#  388|   copy_entryname(const DIRENT * src)
#  389|   {
#  390|->     size_t len = NAMLEN(src);
#  391|       char *result = malloc(len + 1);
#  392|       if (result == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
ncurses-6.5-20250614/progs/toe.c:411:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: following ‘false’ branch (when ‘all_dirs == 0’)...
ncurses-6.5-20250614/progs/toe.c:761:24: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:761:24: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:761:24: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:767:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:768:18: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:768:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:769:34: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:769:34: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.5-20250614/progs/toe.c:772:16: call_function: calling ‘typelist’ from ‘main’
#  409|       for (i = 0; i < eargc; i++) {
#  410|   #if NCURSES_USE_DATABASE
#  411|-> 	if (_nc_is_dir_path(eargv[i])) {
#  412|   	    char *cwd_buf = NULL;
#  413|   	    DIR *termdir;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
ncurses-6.5-20250614/progs/toe.c:416:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: following ‘false’ branch (when ‘all_dirs == 0’)...
ncurses-6.5-20250614/progs/toe.c:761:24: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:761:24: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:761:24: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:767:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:768:18: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:768:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:769:34: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:769:34: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.5-20250614/progs/toe.c:772:16: call_function: calling ‘typelist’ from ‘main’
#  414|   	    const DIRENT *subdir;
#  415|   
#  416|-> 	    if ((termdir = opendir(eargv[i])) == NULL) {
#  417|   		(void) fflush(stdout);
#  418|   		(void) fprintf(stderr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
ncurses-6.5-20250614/progs/toe.c:417:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: following ‘false’ branch (when ‘all_dirs == 0’)...
ncurses-6.5-20250614/progs/toe.c:761:24: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:761:24: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:761:24: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:767:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:768:18: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:768:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:769:34: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:769:34: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.5-20250614/progs/toe.c:772:16: call_function: calling ‘typelist’ from ‘main’
#  415|   
#  416|   	    if ((termdir = opendir(eargv[i])) == NULL) {
#  417|-> 		(void) fflush(stdout);
#  418|   		(void) fprintf(stderr,
#  419|   			       "%s: can't open terminfo directory %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
ncurses-6.5-20250614/progs/toe.c:427:30: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: following ‘false’ branch (when ‘all_dirs == 0’)...
ncurses-6.5-20250614/progs/toe.c:761:24: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:761:24: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:761:24: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:767:12: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:768:18: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:768:16: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/toe.c:769:34: call_function: calling ‘strmalloc’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:769:34: return_function: returning to ‘main’ from ‘strmalloc’
ncurses-6.5-20250614/progs/toe.c:772:16: call_function: calling ‘typelist’ from ‘main’
#  425|   		(void) printf("#\n#%s:\n#\n", eargv[i]);
#  426|   
#  427|-> 	    while ((subdir = readdir(termdir)) != NULL) {
#  428|   		size_t cwd_len;
#  429|   		char *name_1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
ncurses-6.5-20250614/progs/toe.c:427:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(*<unknown>)’
ncurses-6.5-20250614/progs/toe.c:409:17: branch_true: following ‘true’ branch (when ‘i < eargc’)...
ncurses-6.5-20250614/progs/toe.c:411:34: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:416:28: acquire_memory: allocated here
ncurses-6.5-20250614/progs/toe.c:427:30: throw: if ‘readdir’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:427:30: danger: ‘opendir(*<unknown>)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  425|   		(void) printf("#\n#%s:\n#\n", eargv[i]);
#  426|   
#  427|-> 	    while ((subdir = readdir(termdir)) != NULL) {
#  428|   		size_t cwd_len;
#  429|   		char *name_1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
ncurses-6.5-20250614/progs/toe.c:458:33: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
ncurses-6.5-20250614/progs/toe.c:402:1: enter_function: entry to ‘typelist’
ncurses-6.5-20250614/progs/toe.c:409:17: branch_true: following ‘true’ branch (when ‘i < eargc’)...
ncurses-6.5-20250614/progs/toe.c:411:34: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:433:26: call_function: calling ‘copy_entryname’ from ‘typelist’
ncurses-6.5-20250614/progs/toe.c:433:26: return_function: returning to ‘typelist’ from ‘copy_entryname’
ncurses-6.5-20250614/progs/toe.c:441:20: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:446:17: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:453:28: acquire_memory: allocated here
ncurses-6.5-20250614/progs/toe.c:458:33: throw: if ‘readdir’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:458:33: danger: ‘opendir(".")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/10)
#  456|   		    continue;
#  457|   		}
#  458|-> 		while ((entry = readdir(entrydir)) != NULL) {
#  459|   		    char *name_2;
#  460|   		    TERMTYPE2 lterm;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
ncurses-6.5-20250614/progs/toe.c:739:13: warning[-Wanalyzer-malloc-leak]: leak of ‘eargv’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: following ‘true’ branch (when ‘all_dirs != 0’)...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:748:16: branch_true: following ‘true’ branch (when ‘pass == 0’)...
ncurses-6.5-20250614/progs/toe.c:749:25: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:749:25: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:749:25: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:739:13: throw: if ‘_nc_first_db’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:739:13: danger: ‘eargv’ leaks here; was allocated at [(18)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/17)
#  737|   	    const char *path;
#  738|   
#  739|-> 	    _nc_first_db(&state, &offset);
#  740|   	    while ((path = _nc_next_db(&state, &offset)) != NULL) {
#  741|   		if (quick_prefix(path))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
ncurses-6.5-20250614/progs/toe.c:740:28: warning[-Wanalyzer-malloc-leak]: leak of ‘eargv’
ncurses-6.5-20250614/progs/toe.c:602:1: enter_function: entry to ‘main’
ncurses-6.5-20250614/progs/toe.c:663:8: branch_false: following ‘false’ branch (when ‘report_file’ is NULL)...
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:676:8: branch_false: following ‘false’ branch (when ‘direct_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:694:8: branch_false: following ‘false’ branch (when ‘invert_dependencies == 0’)...
ncurses-6.5-20250614/progs/toe.c:726:9: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:726:8: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_false: ...to here
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: following ‘true’ branch (when ‘all_dirs != 0’)...
ncurses-6.5-20250614/progs/toe.c:728:15: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:748:16: branch_true: following ‘true’ branch (when ‘pass == 0’)...
ncurses-6.5-20250614/progs/toe.c:749:25: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:749:25: call_function: calling ‘allocArgv’ from ‘main’
ncurses-6.5-20250614/progs/toe.c:749:25: return_function: returning to ‘main’ from ‘allocArgv’
ncurses-6.5-20250614/progs/toe.c:735:24: branch_true: following ‘true’ branch (when ‘pass != 2’)...
ncurses-6.5-20250614/progs/toe.c:739:13: branch_true: ...to here
ncurses-6.5-20250614/progs/toe.c:740:28: throw: if ‘_nc_next_db’ throws an exception...
ncurses-6.5-20250614/progs/toe.c:740:28: danger: ‘eargv’ leaks here; was allocated at [(18)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/17)
#  738|   
#  739|   	    _nc_first_db(&state, &offset);
#  740|-> 	    while ((path = _nc_next_db(&state, &offset)) != NULL) {
#  741|   		if (quick_prefix(path))
#  742|   		    continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
ncurses-6.5-20250614/progs/tset.c:128:5: warning[-Wanalyzer-malloc-leak]: leak of ‘copy’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:382:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  126|   exit_error(void)
#  127|   {
#  128|->     restore_tty_settings();
#  129|       (void) fprintf(stderr, "\n");
#  130|       fflush(stderr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
ncurses-6.5-20250614/progs/tset.c:128:5: warning[-Wanalyzer-malloc-leak]: leak of ‘mapp’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:383:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  126|   exit_error(void)
#  127|   {
#  128|->     restore_tty_settings();
#  129|       (void) fprintf(stderr, "\n");
#  130|       fflush(stderr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
ncurses-6.5-20250614/progs/tset.c:130:5: warning[-Wanalyzer-malloc-leak]: leak of ‘copy’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:382:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  128|       restore_tty_settings();
#  129|       (void) fprintf(stderr, "\n");
#  130|->     fflush(stderr);
#  131|       ExitProgram(EXIT_FAILURE);
#  132|       /* NOTREACHED */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
ncurses-6.5-20250614/progs/tset.c:130:5: warning[-Wanalyzer-malloc-leak]: leak of ‘mapp’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:383:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  128|       restore_tty_settings();
#  129|       (void) fprintf(stderr, "\n");
#  130|->     fflush(stderr);
#  131|       ExitProgram(EXIT_FAILURE);
#  132|       /* NOTREACHED */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def212]
ncurses-6.5-20250614/progs/tset.c:160:5: warning[-Wanalyzer-malloc-leak]: leak of ‘copy’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:382:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  158|       }
#  159|       _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
#  160|->     perror(temp);
#  161|       exit_error();
#  162|       /* NOTREACHED */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def213]
ncurses-6.5-20250614/progs/tset.c:160:5: warning[-Wanalyzer-malloc-leak]: leak of ‘mapp’
ncurses-6.5-20250614/progs/tset.c:375:1: enter_function: entry to ‘add_mapping’
ncurses-6.5-20250614/progs/tset.c:383:12: acquire_memory: allocated here
ncurses-6.5-20250614/progs/tset.c:384:8: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/progs/tset.c:385:9: branch_true: ...to here
ncurses-6.5-20250614/progs/tset.c:385:9: call_function: calling ‘failed’ from ‘add_mapping’
#  158|       }
#  159|       _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
#  160|->     perror(temp);
#  161|       exit_error();
#  162|       /* NOTREACHED */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def214]
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:369:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:368:44: branch_true: following ‘true’ branch (when ‘cc <= 31’)...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:369:49: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:369:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  367|   					}
#  368|   					if (cc < 32)
#  369|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "^%c", cc + '@');
#  370|   					else if (cc == 127)
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def215]
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:373:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:368:44: branch_false: following ‘false’ branch (when ‘cc > 31’)...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:370:49: branch_false: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:370:49: branch_false: following ‘false’ branch (when ‘cc != 127’)...
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:373:49: branch_false: ...to here
ncurses-6.5-20250614/widec5/ncurses/lib_keyname.c:373:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);
#  372|   					else
#  373|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "%c", cc);
#  374|   					MyTable[c] = strdup(name);
#  375|   				}

Error: GCC_ANALYZER_WARNING (CWE-121): [#def216]
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:369:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:368:44: branch_true: following ‘true’ branch (when ‘cc <= 31’)...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:369:49: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:369:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  367|   					}
#  368|   					if (cc < 32)
#  369|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "^%c", cc + '@');
#  370|   					else if (cc == 127)
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def217]
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:373:49: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:334:29: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:335:29: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:341:20: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:342:29: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:342:28: branch_false: following ‘false’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:345:29: branch_false: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:345:28: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:346:48: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:359:36: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:363:45: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:363:44: branch_true: following ‘true’ branch...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:364:49: branch_true: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:368:44: branch_false: following ‘false’ branch (when ‘cc > 31’)...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:370:49: branch_false: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:370:49: branch_false: following ‘false’ branch (when ‘cc != 127’)...
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:373:49: branch_false: ...to here
ncurses-6.5-20250614/widec6/ncurses/lib_keyname.c:373:49: danger: out-of-bounds write from byte 20 till byte 21 but ‘name’ ends at byte 20
#  371|   						_nc_STRCPY(p, "^?", P_LIMIT);
#  372|   					else
#  373|-> 						_nc_SPRINTF(p, _nc_SLIMIT(P_LIMIT) "%c", cc);
#  374|   					MyTable[c] = strdup(name);
#  375|   				}

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-116.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-namencurses-6.5-8.20250614.fc44
store-results-to/tmp/tmp5d916ujy/ncurses-6.5-8.20250614.fc44.tar.xz
time-created2026-01-08 19:53:52
time-finished2026-01-08 20:13:13
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp5d916ujy/ncurses-6.5-8.20250614.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp5d916ujy/ncurses-6.5-8.20250614.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9