libedit-3.1-57.20251016cvs.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1]
libedit-20251016-3.1/examples/fileman.c:89:4: warning[-Wanalyzer-null-argument]: use of NULL ‘xmalloc(strlen(s) + 1)’ where non-null expected
libedit-20251016-3.1/examples/fileman.c:84:1: enter_function: entry to ‘dupstr’
libedit-20251016-3.1/examples/fileman.c:88:8: call_function: calling ‘xmalloc’ from ‘dupstr’
libedit-20251016-3.1/examples/fileman.c:88:8: return_function: returning to ‘dupstr’ from ‘xmalloc’
libedit-20251016-3.1/examples/fileman.c:89:4: danger: argument 1 (‘xmalloc(strlen(s) + 1)’) NULL where non-null expected
#argument 1 of ‘__builtin_strcpy’ must be non-null
#   87|   
#   88|      r = xmalloc (strlen (s) + 1);
#   89|->    strcpy (r, s);
#   90|      return (r);
#   91|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
libedit-20251016-3.1/examples/tc1.c:98:30: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
libedit-20251016-3.1/examples/tc1.c:95:19: acquire_memory: allocated here
libedit-20251016-3.1/examples/tc1.c:98:30: danger: ‘opendir(".")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   96|   	struct dirent *dp;
#   97|   	const char* ptr;
#   98|-> 	const LineInfo *lf = el_line(el);
#   99|   	size_t len;
#  100|   	int res = CC_ERROR;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def3]
libedit-20251016-3.1/examples/tc1.c:110:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
libedit-20251016-3.1/examples/tc1.c:95:19: acquire_memory: allocated here
libedit-20251016-3.1/examples/tc1.c:110:19: danger: ‘opendir(".")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  108|   	len = lf->cursor - ++ptr;
#  109|   
#  110|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#  111|   		if (len > strlen(dp->d_name))
#  112|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def4]
libedit-20251016-3.1/examples/tc1.c:110:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opendir(".")’ where non-null expected
libedit-20251016-3.1/examples/tc1.c:95:19: acquire_memory: this call could return NULL
libedit-20251016-3.1/examples/tc1.c:110:19: danger: argument 1 (‘opendir(".")’) from [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#  108|   	len = lf->cursor - ++ptr;
#  109|   
#  110|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#  111|   		if (len > strlen(dp->d_name))
#  112|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libedit-20251016-3.1/examples/wtc1.c:63:31: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
libedit-20251016-3.1/examples/wtc1.c:59:19: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:63:31: danger: ‘opendir(".")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   61|   	const wchar_t *ptr;
#   62|   	char *buf, *bptr;
#   63|-> 	const LineInfoW *lf = el_wline(el);
#   64|   	int len, i;
#   65|   	size_t mblen;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libedit-20251016-3.1/examples/wtc1.c:70:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
libedit-20251016-3.1/examples/wtc1.c:59:19: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:70:20: danger: ‘opendir(".")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   68|   
#   69|   	/* Find the last word */
#   70|-> 	for (ptr = lf->cursor -1; !iswspace(*ptr) && ptr > lf->buffer; --ptr)
#   71|   		continue;
#   72|   	len = lf->cursor - ++ptr;

Error: COMPILER_WARNING (CWE-252): [#def7]
libedit-20251016-3.1/examples/wtc1.c: scope_hint: In function ‘complete’
libedit-20251016-3.1/examples/wtc1.c:75:9: warning[-Wunused-result]: ignoring return value of ‘wctomb’ declared with attribute ‘warn_unused_result’
#   75 |         wctomb(NULL, 0); /* Reset shift state */
#      |         ^~~~~~~~~~~~~~~
#   73|   
#   74|   	/* Convert last word to multibyte encoding, so we can compare to it */
#   75|-> 	wctomb(NULL, 0); /* Reset shift state */
#   76|   	mblen = MB_LEN_MAX * len + 1;
#   77|   	buf = bptr = malloc(mblen);

Error: CPPCHECK_WARNING (CWE-456): [#def8]
libedit-20251016-3.1/examples/wtc1.c:85: error[uninitdata]: Memory is allocated but not initialized: bptr
#   83|   	for (i = 0; i < len; ++i) {
#   84|   		/* Note: really should test for -1 return from wctomb */
#   85|-> 		bptr += wctomb(bptr, ptr[i]);
#   86|   	}
#   87|   	*bptr = 0; /* Terminate multibyte string */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libedit-20251016-3.1/examples/wtc1.c:91:19: warning[-Wanalyzer-malloc-leak]: leak of ‘bptr’
libedit-20251016-3.1/examples/wtc1.c:77:22: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:19: danger: ‘bptr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   89|   
#   90|   	/* Scan directory for matching name */
#   91|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#   92|   		if (mblen > strlen(dp->d_name))
#   93|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
libedit-20251016-3.1/examples/wtc1.c:91:19: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(".")’
libedit-20251016-3.1/examples/wtc1.c:59:19: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:19: danger: ‘opendir(".")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   89|   
#   90|   	/* Scan directory for matching name */
#   91|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#   92|   		if (mblen > strlen(dp->d_name))
#   93|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def11]
libedit-20251016-3.1/examples/wtc1.c:91:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘opendir(".")’ where non-null expected
libedit-20251016-3.1/examples/wtc1.c:59:19: acquire_memory: this call could return NULL
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:19: danger: argument 1 (‘opendir(".")’) from [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   89|   
#   90|   	/* Scan directory for matching name */
#   91|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#   92|   		if (mblen > strlen(dp->d_name))
#   93|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libedit-20251016-3.1/examples/wtc1.c:91:49: warning[-Wanalyzer-malloc-leak]: leak of ‘bptr’
libedit-20251016-3.1/examples/wtc1.c:77:22: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:32: branch_true: following ‘true’ branch (when ‘dp’ is non-NULL)...
libedit-20251016-3.1/examples/wtc1.c:92:36: branch_true: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:49: danger: ‘bptr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   89|   
#   90|   	/* Scan directory for matching name */
#   91|-> 	for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) {
#   92|   		if (mblen > strlen(dp->d_name))
#   93|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libedit-20251016-3.1/examples/wtc1.c:97:29: warning[-Wanalyzer-malloc-leak]: leak of ‘bptr’
libedit-20251016-3.1/examples/wtc1.c:77:22: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:91:32: branch_true: following ‘true’ branch (when ‘dp’ is non-NULL)...
libedit-20251016-3.1/examples/wtc1.c:92:36: branch_true: ...to here
libedit-20251016-3.1/examples/wtc1.c:97:29: danger: ‘bptr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#   95|   			mbstowcs(dir, &dp->d_name[mblen],
#   96|   			    sizeof(dir) / sizeof(*dir));
#   97|-> 			if (el_winsertstr(el, dir) == -1)
#   98|   				res = CC_ERROR;
#   99|   			else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libedit-20251016-3.1/examples/wtc1.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bptr’
libedit-20251016-3.1/examples/wtc1.c:77:22: acquire_memory: allocated here
libedit-20251016-3.1/examples/wtc1.c:78:12: branch_false: following ‘false’ branch (when ‘bptr’ is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:83:21: branch_false: following ‘false’ branch (when ‘i >= len’)...
libedit-20251016-3.1/examples/wtc1.c:87:9: branch_false: ...to here
libedit-20251016-3.1/examples/wtc1.c:105:9: danger: ‘bptr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  103|   	}
#  104|   
#  105|-> 	closedir(dd);
#  106|   	free(buf);
#  107|   	return res;

Error: COMPILER_WARNING (CWE-252): [#def15]
libedit-20251016-3.1/src/chartype.c: scope_hint: In function 'ct_encode_char'
libedit-20251016-3.1/src/chartype.c:209:17: warning[-Wunused-result]: ignoring return value of 'wctomb' declared with attribute 'warn_unused_result'
#  209 |                 wctomb(NULL, L'\0');
#      |                 ^~~~~~~~~~~~~~~~~~~
#  207|   
#  208|   	if (l < 0) {
#  209|-> 		wctomb(NULL, L'\0');
#  210|   		l = 0;
#  211|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libedit-20251016-3.1/src/el.c:114:30: warning[-Wanalyzer-malloc-leak]: leak of 'el'
libedit-20251016-3.1/src/el.c:101:24: acquire_memory: allocated here
libedit-20251016-3.1/src/el.c:103:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:106:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:114:30: danger: 'el' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  112|   	el->el_errfd = fderr;
#  113|   
#  114|-> 	el->el_prog = wcsdup(ct_decode_string(prog, &el->el_scratch));
#  115|   	if (el->el_prog == NULL) {
#  116|   		el_free(el);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def17]
libedit-20251016-3.1/src/el.c:220:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:220:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  218|   		el_pfunc_t p = va_arg(ap, el_pfunc_t);
#  219|   
#  220|-> 		rv = prompt_set(el, p, 0, op, 1);
#  221|   		break;
#  222|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def18]
libedit-20251016-3.1/src/el.c:227:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:227:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  225|   		el_zfunc_t p = va_arg(ap, el_zfunc_t);
#  226|   		void *arg = va_arg(ap, void *);
#  227|-> 		rv = ch_resizefun(el, p, arg);
#  228|   		break;
#  229|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def19]
libedit-20251016-3.1/src/el.c:234:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:234:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  232|   		el_afunc_t p = va_arg(ap, el_afunc_t);
#  233|   		void *arg = va_arg(ap, void *);
#  234|-> 		rv = ch_aliasfun(el, p, arg);
#  235|   		break;
#  236|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def20]
libedit-20251016-3.1/src/el.c:243:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:243:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  241|   		int c = va_arg(ap, int);
#  242|   
#  243|-> 		rv = prompt_set(el, p, (wchar_t)c, op, 1);
#  244|   		break;
#  245|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def21]
libedit-20251016-3.1/src/el.c:248:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:248:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  246|   
#  247|   	case EL_TERMINAL:
#  248|-> 		rv = terminal_set(el, va_arg(ap, char *));
#  249|   		break;
#  250|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def22]
libedit-20251016-3.1/src/el.c:252:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:252:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  250|   
#  251|   	case EL_EDITOR:
#  252|-> 		rv = map_set_editor(el, va_arg(ap, wchar_t *));
#  253|   		break;
#  254|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def23]
libedit-20251016-3.1/src/el.c:278:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:271:29: branch_true: following 'true' branch (when 'i != 20')...
libedit-20251016-3.1/src/el.c:272:40: branch_true: ...to here
libedit-20251016-3.1/src/el.c:278:30: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  276|   		case EL_BIND:
#  277|   			argv[0] = L"bind";
#  278|-> 			rv = map_bind(el, i, argv);
#  279|   			break;
#  280|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def24]
libedit-20251016-3.1/src/el.c:283:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:271:29: branch_true: following 'true' branch (when 'i != 20')...
libedit-20251016-3.1/src/el.c:272:40: branch_true: ...to here
libedit-20251016-3.1/src/el.c:283:30: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  281|   		case EL_TELLTC:
#  282|   			argv[0] = L"telltc";
#  283|-> 			rv = terminal_telltc(el, i, argv);
#  284|   			break;
#  285|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def25]
libedit-20251016-3.1/src/el.c:288:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:271:29: branch_true: following 'true' branch (when 'i != 20')...
libedit-20251016-3.1/src/el.c:272:40: branch_true: ...to here
libedit-20251016-3.1/src/el.c:288:30: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  286|   		case EL_SETTC:
#  287|   			argv[0] = L"settc";
#  288|-> 			rv = terminal_settc(el, i, argv);
#  289|   			break;
#  290|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def26]
libedit-20251016-3.1/src/el.c:293:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:271:29: branch_true: following 'true' branch (when 'i != 20')...
libedit-20251016-3.1/src/el.c:272:40: branch_true: ...to here
libedit-20251016-3.1/src/el.c:293:30: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  291|   		case EL_ECHOTC:
#  292|   			argv[0] = L"echotc";
#  293|-> 			rv = terminal_echotc(el, i, argv);
#  294|   			break;
#  295|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def27]
libedit-20251016-3.1/src/el.c:298:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:271:29: branch_true: following 'true' branch (when 'i != 20')...
libedit-20251016-3.1/src/el.c:272:40: branch_true: ...to here
libedit-20251016-3.1/src/el.c:298:30: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  296|   		case EL_SETTY:
#  297|   			argv[0] = L"setty";
#  298|-> 			rv = tty_stty(el, i, argv);
#  299|   			break;
#  300|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def28]
libedit-20251016-3.1/src/el.c:314:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:314:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  312|   		el_func_t func = va_arg(ap, el_func_t);
#  313|   
#  314|-> 		rv = map_addfunc(el, name, help, func);
#  315|   		break;
#  316|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def29]
libedit-20251016-3.1/src/el.c:323:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:323:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  321|   		void *ptr = va_arg(ap, void *);
#  322|   
#  323|-> 		rv = hist_set(el, func, ptr);
#  324|   		if (MB_CUR_MAX == 1)
#  325|   			el->el_flags &= ~NARROW_HISTORY;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def30]
libedit-20251016-3.1/src/el.c:348:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:348:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  346|   	{
#  347|   		el_rfunc_t rc = va_arg(ap, el_rfunc_t);
#  348|-> 		rv = el_read_setfn(el->el_read, rc);
#  349|   		break;
#  350|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def31]
libedit-20251016-3.1/src/el.c:360:25: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:358:20: branch_true: following 'true' branch...
libedit-20251016-3.1/src/el.c:360:25: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  358|   		if (rv && !(el->el_flags & UNBUFFERED)) {
#  359|   			el->el_flags |= UNBUFFERED;
#  360|-> 			read_prepare(el);
#  361|   		} else if (!rv && (el->el_flags & UNBUFFERED)) {
#  362|   			el->el_flags &= ~UNBUFFERED;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def32]
libedit-20251016-3.1/src/el.c:363:25: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:358:20: branch_false: following 'false' branch (when 'rv == 0')...
libedit-20251016-3.1/src/el.c:361:36: branch_false: ...to here
libedit-20251016-3.1/src/el.c:361:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/el.c:362:38: branch_true: ...to here
libedit-20251016-3.1/src/el.c:363:25: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  361|   		} else if (!rv && (el->el_flags & UNBUFFERED)) {
#  362|   			el->el_flags &= ~UNBUFFERED;
#  363|-> 			read_finish(el);
#  364|   		}
#  365|   		rv = 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def33]
libedit-20251016-3.1/src/el.c:371:32: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:370:20: branch_true: following 'true' branch (when 'rv != 0')...
libedit-20251016-3.1/src/el.c:371:32: branch_true: ...to here
libedit-20251016-3.1/src/el.c:371:32: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  369|   		rv = va_arg(ap, int);
#  370|   		if (rv)
#  371|-> 			(void) tty_rawmode(el);
#  372|   		else
#  373|   			(void) tty_cookedmode(el);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def34]
libedit-20251016-3.1/src/el.c:373:32: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:370:20: branch_false: following 'false' branch (when 'rv == 0')...
libedit-20251016-3.1/src/el.c:373:32: branch_false: ...to here
libedit-20251016-3.1/src/el.c:373:32: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  371|   			(void) tty_rawmode(el);
#  372|   		else
#  373|-> 			(void) tty_cookedmode(el);
#  374|   		rv = 0;
#  375|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def35]
libedit-20251016-3.1/src/el.c:407:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:407:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  405|   
#  406|   	case EL_REFRESH:
#  407|-> 		re_clear_display(el);
#  408|   		re_refresh(el);
#  409|   		terminal__flush(el);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def36]
libedit-20251016-3.1/src/el.c:408:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:408:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  406|   	case EL_REFRESH:
#  407|   		re_clear_display(el);
#  408|-> 		re_refresh(el);
#  409|   		terminal__flush(el);
#  410|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def37]
libedit-20251016-3.1/src/el.c:409:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:211:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:213:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:213:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:409:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  407|   		re_clear_display(el);
#  408|   		re_refresh(el);
#  409|-> 		terminal__flush(el);
#  410|   		break;
#  411|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def38]
libedit-20251016-3.1/src/el.c:440:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:440:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  438|   	case EL_RPROMPT: {
#  439|   		el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
#  440|-> 		rv = prompt_get(el, p, 0, op);
#  441|   		break;
#  442|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def39]
libedit-20251016-3.1/src/el.c:448:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:448:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  446|   		wchar_t *c = va_arg(ap, wchar_t *);
#  447|   
#  448|-> 		rv = prompt_get(el, p, c, op);
#  449|   		break;
#  450|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def40]
libedit-20251016-3.1/src/el.c:453:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:453:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  451|   
#  452|   	case EL_EDITOR:
#  453|-> 		rv = map_get_editor(el, va_arg(ap, const wchar_t **));
#  454|   		break;
#  455|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def41]
libedit-20251016-3.1/src/el.c:472:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:472:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  470|   
#  471|   	case EL_TERMINAL:
#  472|-> 		terminal_get(el, va_arg(ap, const char **));
#  473|   		rv = 0;
#  474|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def42]
libedit-20251016-3.1/src/el.c:483:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:483:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  481|   		argv[1] = va_arg(ap, char *);
#  482|   		argv[2] = va_arg(ap, void *);
#  483|-> 		rv = terminal_gettc(el, 3, argv);
#  484|   		break;
#  485|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def43]
libedit-20251016-3.1/src/el.c:488:45: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/el.c:431:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/el.c:434:9: branch_false: ...to here
libedit-20251016-3.1/src/el.c:434:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/el.c:488:45: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  486|   
#  487|   	case EL_GETCFN:
#  488|-> 		*va_arg(ap, el_rfunc_t *) = el_read_getfn(el->el_read);
#  489|   		rv = 0;
#  490|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def44]
libedit-20251016-3.1/src/eln.c:118:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:118:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  116|   	case EL_RPROMPT: {
#  117|   		el_pfunc_t p = va_arg(ap, el_pfunc_t);
#  118|-> 		ret = prompt_set(el, p, 0, op, 0);
#  119|   		break;
#  120|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def45]
libedit-20251016-3.1/src/eln.c:125:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:125:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  123|   		el_zfunc_t p = va_arg(ap, el_zfunc_t);
#  124|   		void *arg = va_arg(ap, void *);
#  125|-> 		ret = ch_resizefun(el, p, arg);
#  126|   		break;
#  127|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def46]
libedit-20251016-3.1/src/eln.c:132:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:132:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  130|   		el_afunc_t p = va_arg(ap, el_afunc_t);
#  131|   		void *arg = va_arg(ap, void *);
#  132|-> 		ret = ch_aliasfun(el, p, arg);
#  133|   		break;
#  134|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def47]
libedit-20251016-3.1/src/eln.c:141:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:141:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  139|   		int c = va_arg(ap, int);
#  140|   
#  141|-> 		ret = prompt_set(el, p, c, op, 0);
#  142|   		break;
#  143|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def48]
libedit-20251016-3.1/src/eln.c:146:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:146:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  144|   
#  145|   	case EL_TERMINAL:       /* const char * */
#  146|-> 		ret = el_wset(el, op, va_arg(ap, char *));
#  147|   		break;
#  148|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def49]
libedit-20251016-3.1/src/eln.c:150:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:150:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  148|   
#  149|   	case EL_EDITOR:		/* const wchar_t * */
#  150|-> 		ret = el_wset(el, op, ct_decode_string(va_arg(ap, char *),
#  151|   		    &el->el_lgcyconv));
#  152|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def50]
libedit-20251016-3.1/src/eln.c:159:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:159:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  157|   	case EL_UNBUFFERED:
#  158|   	case EL_PREP_TERM:
#  159|-> 		ret = el_wset(el, op, va_arg(ap, int));
#  160|   		break;
#  161|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def51]
libedit-20251016-3.1/src/eln.c:174:33: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:170:29: branch_true: following 'true' branch (when 'i != 19')...
libedit-20251016-3.1/src/eln.c:171:40: branch_true: ...to here
libedit-20251016-3.1/src/eln.c:174:33: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  172|   			    break;
#  173|   		argv[0] = argv[i] = NULL;
#  174|-> 		wargv = (void *)ct_decode_argv(i + 1, argv, &el->el_lgcyconv);
#  175|   		if (!wargv) {
#  176|   		    ret = -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def52]
libedit-20251016-3.1/src/eln.c:222:25: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:222:25: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  220|   		func = va_arg(ap, el_func_t);
#  221|   
#  222|-> 		wargv = ct_decode_argv(2, args, &el->el_lgcyconv);
#  223|   		if (!wargv) {
#  224|   		    ret = -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def53]
libedit-20251016-3.1/src/eln.c:228:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:223:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/eln.c:228:57: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:228:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  226|   		}
#  227|   		/* XXX: The two strdup's leak */
#  228|-> 		ret = map_addfunc(el, wcsdup(wargv[0]), wcsdup(wargv[1]),
#  229|   		    func);
#  230|   		el_free(wargv);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libedit-20251016-3.1/src/eln.c:230:17: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(*<unknown>)'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:223:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/eln.c:228:57: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:228:39: acquire_memory: allocated here
libedit-20251016-3.1/src/eln.c:230:17: danger: 'wcsdup(*<unknown>)' leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
#  228|   		ret = map_addfunc(el, wcsdup(wargv[0]), wcsdup(wargv[1]),
#  229|   		    func);
#  230|-> 		el_free(wargv);
#  231|   		break;
#  232|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libedit-20251016-3.1/src/eln.c:230:17: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(<unknown>[1])'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:223:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/eln.c:228:57: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:228:57: acquire_memory: allocated here
libedit-20251016-3.1/src/eln.c:230:17: danger: 'wcsdup(<unknown>[1])' leaks here; was allocated at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  228|   		ret = map_addfunc(el, wcsdup(wargv[0]), wcsdup(wargv[1]),
#  229|   		    func);
#  230|-> 		el_free(wargv);
#  231|   		break;
#  232|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def56]
libedit-20251016-3.1/src/eln.c:236:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:236:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  234|   		hist_fun_t fun = va_arg(ap, hist_fun_t);
#  235|   		void *ptr = va_arg(ap, void *);
#  236|-> 		ret = hist_set(el, fun, ptr);
#  237|   		el->el_flags |= NARROW_HISTORY;
#  238|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def57]
libedit-20251016-3.1/src/eln.c:242:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:242:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/2)
#  240|   
#  241|   	case EL_GETCFN:         /* el_rfunc_t */
#  242|-> 		ret = el_wset(el, op, va_arg(ap, el_rfunc_t));
#  243|   		break;
#  244|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def58]
libedit-20251016-3.1/src/eln.c:246:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:246:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/2)
#  244|   
#  245|   	case EL_CLIENTDATA:     /* void * */
#  246|-> 		ret = el_wset(el, op, va_arg(ap, void *));
#  247|   		break;
#  248|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def59]
libedit-20251016-3.1/src/eln.c:252:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:252:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  250|   		int what = va_arg(ap, int);
#  251|   		FILE *fp = va_arg(ap, FILE *);
#  252|-> 		ret = el_wset(el, op, what, fp);
#  253|   		break;
#  254|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def60]
libedit-20251016-3.1/src/eln.c:257:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:257:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
#  255|   
#  256|   	case EL_REFRESH:
#  257|-> 		re_clear_display(el);
#  258|   		re_refresh(el);
#  259|   		terminal__flush(el);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def61]
libedit-20251016-3.1/src/eln.c:258:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:258:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
#  256|   	case EL_REFRESH:
#  257|   		re_clear_display(el);
#  258|-> 		re_refresh(el);
#  259|   		terminal__flush(el);
#  260|   		ret = 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def62]
libedit-20251016-3.1/src/eln.c:259:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:110:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:112:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:112:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:259:17: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
#  257|   		re_clear_display(el);
#  258|   		re_refresh(el);
#  259|-> 		terminal__flush(el);
#  260|   		ret = 0;
#  261|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def63]
libedit-20251016-3.1/src/eln.c:289:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:289:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
#  287|   	case EL_RPROMPT: {
#  288|   		el_pfunc_t *p = va_arg(ap, el_pfunc_t *);
#  289|-> 		ret = prompt_get(el, p, 0, op);
#  290|   		break;
#  291|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def64]
libedit-20251016-3.1/src/eln.c:298:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:298:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/2)
#  296|   		char *c = va_arg(ap, char *);
#  297|   		wchar_t wc = 0;
#  298|-> 		ret = prompt_get(el, p, &wc, op);
#  299|   		*c = (char)wc;
#  300|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def65]
libedit-20251016-3.1/src/eln.c:306:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:306:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  304|   		const char **p = va_arg(ap, const char **);
#  305|   		const wchar_t *pw;
#  306|-> 		ret = el_wget(el, op, &pw);
#  307|   		*p = ct_encode_string(pw, &el->el_lgcyconv);
#  308|   		if (!el->el_lgcyconv.csize)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def66]
libedit-20251016-3.1/src/eln.c:307:22: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:307:22: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  305|   		const wchar_t *pw;
#  306|   		ret = el_wget(el, op, &pw);
#  307|-> 		*p = ct_encode_string(pw, &el->el_lgcyconv);
#  308|   		if (!el->el_lgcyconv.csize)
#  309|   			ret = -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def67]
libedit-20251016-3.1/src/eln.c:314:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:314:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/2)
#  312|   
#  313|   	case EL_TERMINAL:       /* const char ** */
#  314|-> 		ret = el_wget(el, op, va_arg(ap, const char **));
#  315|   		break;
#  316|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def68]
libedit-20251016-3.1/src/eln.c:322:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:322:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/2)
#  320|   	case EL_UNBUFFERED:
#  321|   	case EL_PREP_TERM:
#  322|-> 		ret = el_wget(el, op, va_arg(ap, int *));
#  323|   		break;
#  324|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def69]
libedit-20251016-3.1/src/eln.c:331:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:331:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/2)
#  329|   		argv[1] = va_arg(ap, char *);
#  330|   		argv[2] = va_arg(ap, void *);
#  331|-> 		ret = terminal_gettc(el, 3, argv);
#  332|   		break;
#  333|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def70]
libedit-20251016-3.1/src/eln.c:336:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:336:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/2)
#  334|   
#  335|   	case EL_GETCFN:         /* el_rfunc_t */
#  336|-> 		ret = el_wget(el, op, va_arg(ap, el_rfunc_t *));
#  337|   		break;
#  338|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def71]
libedit-20251016-3.1/src/eln.c:340:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:340:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/2)
#  338|   
#  339|   	case EL_CLIENTDATA:     /* void ** */
#  340|-> 		ret = el_wget(el, op, va_arg(ap, void **));
#  341|   		break;
#  342|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def72]
libedit-20251016-3.1/src/eln.c:346:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/eln.c:280:12: branch_false: following 'false' branch (when 'el' is non-NULL)...
libedit-20251016-3.1/src/eln.c:283:9: branch_false: ...to here
libedit-20251016-3.1/src/eln.c:283:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/eln.c:346:23: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/2)
#  344|   		int what = va_arg(ap, int);
#  345|   		FILE **fpp = va_arg(ap, FILE **);
#  346|-> 		ret = el_wget(el, op, what, fpp);
#  347|   		break;
#  348|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
libedit-20251016-3.1/src/filecomplete.c:95:21: warning[-Wanalyzer-malloc-leak]: leak of 'find_word_to_complete(*<unknown>.cursor, *<unknown>.buffer,  word_break,  special_prefixes, & len,  do_unescape)'
libedit-20251016-3.1/src/filecomplete.c:843:1: enter_function: entry to '_el_fn_complete'
libedit-20251016-3.1/src/filecomplete.c:845:31: call_function: calling 'fn_complete' from '_el_fn_complete'
#   93|   	if (temp[0] == 0) {
#   94|   #ifdef HAVE_GETPW_R_POSIX
#   95|-> 		if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf),
#   96|   		    &pass) != 0)
#   97|   			pass = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libedit-20251016-3.1/src/filecomplete.c:95:21: warning[-Wanalyzer-malloc-leak]: leak of 'temp'
libedit-20251016-3.1/src/filecomplete.c:81:12: branch_true: following 'true' branch (when 'pos' is NULL)...
libedit-20251016-3.1/src/filecomplete.c:82:24: branch_true: ...to here
libedit-20251016-3.1/src/filecomplete.c:82:24: acquire_memory: allocated here
libedit-20251016-3.1/src/filecomplete.c:83:20: branch_false: following 'false' branch (when 'temp' is non-NULL)...
libedit-20251016-3.1/src/filecomplete.c:93:13: branch_false: ...to here
libedit-20251016-3.1/src/filecomplete.c:93:12: branch_true: following 'true' branch...
libedit-20251016-3.1/src/filecomplete.c:95:21: branch_true: ...to here
libedit-20251016-3.1/src/filecomplete.c:95:21: danger: 'temp' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   93|   	if (temp[0] == 0) {
#   94|   #ifdef HAVE_GETPW_R_POSIX
#   95|-> 		if (getpwuid_r(getuid(), &pwres, pwbuf, sizeof(pwbuf),
#   96|   		    &pass) != 0)
#   97|   			pass = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
libedit-20251016-3.1/src/filecomplete.c:105:21: warning[-Wanalyzer-malloc-leak]: leak of 'find_word_to_complete(*<unknown>.cursor, *<unknown>.buffer,  word_break,  special_prefixes, & len,  do_unescape)'
libedit-20251016-3.1/src/filecomplete.c:843:1: enter_function: entry to '_el_fn_complete'
libedit-20251016-3.1/src/filecomplete.c:845:31: call_function: calling 'fn_complete' from '_el_fn_complete'
#  103|   	} else {
#  104|   #ifdef HAVE_GETPW_R_POSIX
#  105|-> 		if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
#  106|   			pass = NULL;
#  107|   #elif HAVE_GETPW_R_DRAFT

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
libedit-20251016-3.1/src/filecomplete.c:105:21: warning[-Wanalyzer-malloc-leak]: leak of 'temp'
libedit-20251016-3.1/src/filecomplete.c:81:12: branch_true: following 'true' branch (when 'pos' is NULL)...
libedit-20251016-3.1/src/filecomplete.c:82:24: branch_true: ...to here
libedit-20251016-3.1/src/filecomplete.c:82:24: acquire_memory: allocated here
libedit-20251016-3.1/src/filecomplete.c:83:20: branch_false: following 'false' branch (when 'temp' is non-NULL)...
libedit-20251016-3.1/src/filecomplete.c:93:13: branch_false: ...to here
libedit-20251016-3.1/src/filecomplete.c:93:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/filecomplete.c:105:21: branch_false: ...to here
libedit-20251016-3.1/src/filecomplete.c:105:21: danger: 'temp' leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
#  103|   	} else {
#  104|   #ifdef HAVE_GETPW_R_POSIX
#  105|-> 		if (getpwnam_r(temp, &pwres, pwbuf, sizeof(pwbuf), &pass) != 0)
#  106|   			pass = NULL;
#  107|   #elif HAVE_GETPW_R_DRAFT

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
libedit-20251016-3.1/src/filecomplete.c:375:31: warning[-Wanalyzer-malloc-leak]: leak of 'find_word_to_complete(*<unknown>.cursor, *<unknown>.buffer,  word_break,  special_prefixes, & len,  do_unescape)'
libedit-20251016-3.1/src/filecomplete.c:843:1: enter_function: entry to '_el_fn_complete'
libedit-20251016-3.1/src/filecomplete.c:845:31: call_function: calling 'fn_complete' from '_el_fn_complete'
#  373|   
#  374|   		if (dir != NULL) {
#  375|-> 			(void)closedir(dir);
#  376|   			dir = NULL;
#  377|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libedit-20251016-3.1/src/filecomplete.c:395:23: warning[-Wanalyzer-malloc-leak]: leak of 'find_word_to_complete(*<unknown>.cursor, *<unknown>.buffer,  word_break,  special_prefixes, & len,  do_unescape)'
libedit-20251016-3.1/src/filecomplete.c:843:1: enter_function: entry to '_el_fn_complete'
libedit-20251016-3.1/src/filecomplete.c:845:31: call_function: calling 'fn_complete' from '_el_fn_complete'
#  393|   			return NULL;
#  394|   
#  395|-> 		dir = opendir(dirpath);
#  396|   		if (!dir)
#  397|   			return NULL;	/* cannot open the directory */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libedit-20251016-3.1/src/filecomplete.c:471:26: warning[-Wanalyzer-malloc-leak]: leak of 'match_list'
libedit-20251016-3.1/src/filecomplete.c:825:1: enter_function: entry to 'fn_complete'
libedit-20251016-3.1/src/filecomplete.c:832:16: call_function: calling 'fn_complete2' from 'fn_complete'
#  469|   	matches = 0;
#  470|   	match_list_len = 1;
#  471|-> 	while ((retstr = (*genfunc) (text, (int)matches)) != NULL) {
#  472|   		/* allow for list terminator here */
#  473|   		if (matches + 3 >= match_list_len) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libedit-20251016-3.1/src/filecomplete.c:707:21: warning[-Wanalyzer-malloc-leak]: leak of 'find_word_to_complete(*<unknown>.cursor, *<unknown>.buffer,  word_break,  special_prefixes, & len,  do_unescape)'
libedit-20251016-3.1/src/filecomplete.c:825:1: enter_function: entry to 'fn_complete'
libedit-20251016-3.1/src/filecomplete.c:832:16: call_function: calling 'fn_complete2' from 'fn_complete'
#  705|   	    (over != NULL && !*over && !matches))
#  706|   		matches = completion_matches(
#  707|-> 		    ct_encode_string(temp, &el->el_scratch), complete_func);
#  708|   
#  709|   	if (over != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
libedit-20251016-3.1/src/hist.c:198:25: warning[-Wanalyzer-malloc-leak]: leak of 'buf'
libedit-20251016-3.1/src/hist.c:173:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/hist.c:176:12: branch_false: ...to here
libedit-20251016-3.1/src/hist.c:182:43: branch_true: following 'true' branch (when 'str' is non-NULL)...
libedit-20251016-3.1/src/hist.c:184:29: branch_true: ...to here
libedit-20251016-3.1/src/hist.c:189:28: branch_true: following 'true' branch (when 'maxlen <= len')...
libedit-20251016-3.1/src/hist.c:190:33: branch_true: ...to here
libedit-20251016-3.1/src/hist.c:192:36: branch_false: following 'false' branch (when 'nbuf' is non-NULL)...
libedit-20251016-3.1/src/hist.c:198:25: branch_false: ...to here
libedit-20251016-3.1/src/hist.c:198:25: danger: 'buf' leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  196|   				buf = nbuf;
#  197|   			}
#  198|-> 			strvis(buf, ptr, VIS_NL);
#  199|   			(void) fprintf(el->el_outfile, "%d\t%s\n",
#  200|   			    hno++, buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
libedit-20251016-3.1/src/history.c:816:24: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:789:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:792:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:794:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:797:13: branch_false: ...to here
libedit-20251016-3.1/src/history.c:797:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:800:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:800:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:801:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/history.c:803:21: branch_true: following 'true' branch...
libedit-20251016-3.1/src/history.c:804:20: branch_true: ...to here
libedit-20251016-3.1/src/history.c:806:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:816:24: branch_false: ...to here
libedit-20251016-3.1/src/history.c:816:24: danger: 'ptr' leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  814|   			ptr = nptr;
#  815|   		}
#  816|-> 		(void) strunvis(ptr, line);
#  817|   		decode_result = ct_decode_string(ptr, &conv);
#  818|   		if (decode_result == NULL)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def83]
libedit-20251016-3.1/src/history.c:816:24: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1079:26: call_function: calling 'history_load' from 'history_w'
#  814|   			ptr = nptr;
#  815|   		}
#  816|-> 		(void) strunvis(ptr, line);
#  817|   		decode_result = ct_decode_string(ptr, &conv);
#  818|   		if (decode_result == NULL)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def84]
libedit-20251016-3.1/src/history.c:817:33: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1079:26: call_function: calling 'history_load' from 'history_w'
#  815|   		}
#  816|   		(void) strunvis(ptr, line);
#  817|-> 		decode_result = ct_decode_string(ptr, &conv);
#  818|   		if (decode_result == NULL)
#  819|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def85]
libedit-20251016-3.1/src/history.c:820:21: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1079:26: call_function: calling 'history_load' from 'history_w'
#  818|   		if (decode_result == NULL)
#  819|   			continue;
#  820|-> 		if (HENTER(h, &ev, decode_result) == -1) {
#  821|   			i = -1;
#  822|   			goto oomem;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
libedit-20251016-3.1/src/history.c:849:13: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libedit-20251016-3.1/src/history.c:891:1: enter_function: entry to 'history_save'
libedit-20251016-3.1/src/history.c:896:8: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:900:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:900:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:900:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libedit-20251016-3.1/src/history.c:903:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:903:9: call_function: calling 'history_save_fp' from 'history_save'
#  847|   #endif
#  848|   
#  849|-> 	if (ftell(fp) == 0 && fputs(hist_cookie, fp) == EOF)
#  850|   		goto done;
#  851|   	ptr = h_malloc((max_size = 1024) * sizeof(*ptr));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def87]
libedit-20251016-3.1/src/history.c:849:13: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1091:26: call_function: calling 'history_save_fp' from 'history_w'
#  847|   #endif
#  848|   
#  849|-> 	if (ftell(fp) == 0 && fputs(hist_cookie, fp) == EOF)
#  850|   		goto done;
#  851|   	ptr = h_malloc((max_size = 1024) * sizeof(*ptr));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
libedit-20251016-3.1/src/history.c:855:31: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:851:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:852:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
libedit-20251016-3.1/src/history.c:854:12: branch_false: ...to here
libedit-20251016-3.1/src/history.c:854:12: branch_true: following 'true' branch (when 'nelem != 18446744073709551615')...
libedit-20251016-3.1/src/history.c:855:31: branch_true: ...to here
libedit-20251016-3.1/src/history.c:855:31: danger: 'ptr' leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  853|   		goto done;
#  854|   	if (nelem != (size_t)-1) {
#  855|-> 		for (retval = HFIRST(h, &ev); retval != -1 && nelem-- > 0;
#  856|   		    retval = HNEXT(h, &ev))
#  857|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def89]
libedit-20251016-3.1/src/history.c:855:31: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1099:26: call_function: calling 'history_save_fp' from 'history_w'
#  853|   		goto done;
#  854|   	if (nelem != (size_t)-1) {
#  855|-> 		for (retval = HFIRST(h, &ev); retval != -1 && nelem-- > 0;
#  856|   		    retval = HNEXT(h, &ev))
#  857|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
libedit-20251016-3.1/src/history.c:856:30: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:851:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:852:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
libedit-20251016-3.1/src/history.c:854:12: branch_false: ...to here
libedit-20251016-3.1/src/history.c:854:12: branch_true: following 'true' branch (when 'nelem != 18446744073709551615')...
libedit-20251016-3.1/src/history.c:855:31: branch_true: ...to here
libedit-20251016-3.1/src/history.c:855:47: branch_true: following 'true' branch...
libedit-20251016-3.1/src/history.c:856:30: danger: 'ptr' leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  854|   	if (nelem != (size_t)-1) {
#  855|   		for (retval = HFIRST(h, &ev); retval != -1 && nelem-- > 0;
#  856|-> 		    retval = HNEXT(h, &ev))
#  857|   			continue;
#  858|   	} else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def91]
libedit-20251016-3.1/src/history.c:856:30: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1099:26: call_function: calling 'history_save_fp' from 'history_w'
#  854|   	if (nelem != (size_t)-1) {
#  855|   		for (retval = HFIRST(h, &ev); retval != -1 && nelem-- > 0;
#  856|-> 		    retval = HNEXT(h, &ev))
#  857|   			continue;
#  858|   	} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
libedit-20251016-3.1/src/history.c:862:26: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libedit-20251016-3.1/src/history.c:891:1: enter_function: entry to 'history_save'
libedit-20251016-3.1/src/history.c:896:8: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:900:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:900:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:900:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libedit-20251016-3.1/src/history.c:903:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:903:9: call_function: calling 'history_save_fp' from 'history_save'
#  860|   
#  861|   	if (retval == -1)
#  862|-> 		retval = HLAST(h, &ev);
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
libedit-20251016-3.1/src/history.c:862:26: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:851:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:852:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
libedit-20251016-3.1/src/history.c:854:12: branch_false: ...to here
libedit-20251016-3.1/src/history.c:862:26: danger: 'ptr' leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  860|   
#  861|   	if (retval == -1)
#  862|-> 		retval = HLAST(h, &ev);
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def94]
libedit-20251016-3.1/src/history.c:862:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1091:26: call_function: calling 'history_save_fp' from 'history_w'
#  860|   
#  861|   	if (retval == -1)
#  862|-> 		retval = HLAST(h, &ev);
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
libedit-20251016-3.1/src/history.c:864:44: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libedit-20251016-3.1/src/history.c:891:1: enter_function: entry to 'history_save'
libedit-20251016-3.1/src/history.c:896:8: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:900:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:900:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:900:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libedit-20251016-3.1/src/history.c:903:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:903:9: call_function: calling 'history_save_fp' from 'history_save'
#  862|   		retval = HLAST(h, &ev);
#  863|   
#  864|-> 	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {
#  865|   		str = ct_encode_string(ev.str, &conv);
#  866|   		len = strlen(str) * 4 + 1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def96]
libedit-20251016-3.1/src/history.c:864:44: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1091:26: call_function: calling 'history_save_fp' from 'history_w'
#  862|   		retval = HLAST(h, &ev);
#  863|   
#  864|-> 	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {
#  865|   		str = ct_encode_string(ev.str, &conv);
#  866|   		len = strlen(str) * 4 + 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
libedit-20251016-3.1/src/history.c:865:23: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libedit-20251016-3.1/src/history.c:891:1: enter_function: entry to 'history_save'
libedit-20251016-3.1/src/history.c:896:8: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:900:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:900:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:900:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libedit-20251016-3.1/src/history.c:903:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:903:9: call_function: calling 'history_save_fp' from 'history_save'
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {
#  865|-> 		str = ct_encode_string(ev.str, &conv);
#  866|   		len = strlen(str) * 4 + 1;
#  867|   		if (len > max_size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
libedit-20251016-3.1/src/history.c:865:23: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:851:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:852:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
libedit-20251016-3.1/src/history.c:854:12: branch_false: ...to here
libedit-20251016-3.1/src/history.c:864:21: branch_true: following 'true' branch (when 'retval != -1')...
libedit-20251016-3.1/src/history.c:865:23: branch_true: ...to here
libedit-20251016-3.1/src/history.c:865:23: danger: 'ptr' leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {
#  865|-> 		str = ct_encode_string(ev.str, &conv);
#  866|   		len = strlen(str) * 4 + 1;
#  867|   		if (len > max_size) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def99]
libedit-20251016-3.1/src/history.c:865:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1091:26: call_function: calling 'history_save_fp' from 'history_w'
#  863|   
#  864|   	for (i = 0; retval != -1; retval = HPREV(h, &ev), i++) {
#  865|-> 		str = ct_encode_string(ev.str, &conv);
#  866|   		len = strlen(str) * 4 + 1;
#  867|   		if (len > max_size) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
libedit-20251016-3.1/src/history.c:877:24: warning[-Wanalyzer-malloc-leak]: leak of 'fp'
libedit-20251016-3.1/src/history.c:891:1: enter_function: entry to 'history_save'
libedit-20251016-3.1/src/history.c:896:8: branch_false: following 'false' branch...
libedit-20251016-3.1/src/history.c:900:15: branch_false: ...to here
libedit-20251016-3.1/src/history.c:900:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:900:8: branch_false: following 'false' branch (when 'fp' is non-NULL)...
libedit-20251016-3.1/src/history.c:903:9: branch_false: ...to here
libedit-20251016-3.1/src/history.c:903:9: call_function: calling 'history_save_fp' from 'history_save'
#  875|   			ptr = nptr;
#  876|   		}
#  877|-> 		(void) strvis(ptr, str, VIS_WHITE);
#  878|   		(void) fprintf(fp, "%s\n", ptr);
#  879|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
libedit-20251016-3.1/src/history.c:877:24: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libedit-20251016-3.1/src/history.c:851:15: acquire_memory: allocated here
libedit-20251016-3.1/src/history.c:852:12: branch_false: following 'false' branch (when 'ptr' is non-NULL)...
libedit-20251016-3.1/src/history.c:854:12: branch_false: ...to here
libedit-20251016-3.1/src/history.c:864:21: branch_true: following 'true' branch (when 'retval != -1')...
libedit-20251016-3.1/src/history.c:865:23: branch_true: ...to here
libedit-20251016-3.1/src/history.c:867:20: branch_false: following 'false' branch (when 'max_size >= len')...
libedit-20251016-3.1/src/history.c:877:24: branch_false: ...to here
libedit-20251016-3.1/src/history.c:877:24: danger: 'ptr' leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
#  875|   			ptr = nptr;
#  876|   		}
#  877|-> 		(void) strvis(ptr, str, VIS_WHITE);
#  878|   		(void) fprintf(fp, "%s\n", ptr);
#  879|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def102]
libedit-20251016-3.1/src/history.c:877:24: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1091:26: call_function: calling 'history_save_fp' from 'history_w'
#  875|   			ptr = nptr;
#  876|   		}
#  877|-> 		(void) strvis(ptr, str, VIS_WHITE);
#  878|   		(void) fprintf(fp, "%s\n", ptr);
#  879|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def103]
libedit-20251016-3.1/src/history.c:896:14: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1085:26: call_function: calling 'history_save' from 'history_w'
#  894|       int i;
#  895|   
#  896|->     if ((i = open(fname, O_WRONLY|O_CREAT|O_TRUNC,
#  897|   		S_IRUSR|S_IWUSR)) == -1)
#  898|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def104]
libedit-20251016-3.1/src/history.c:918:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1106:26: call_function: calling 'history_prev_event' from 'history_w'
#  916|   	int retval;
#  917|   
#  918|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  919|   		if (ev->num == num)
#  920|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def105]
libedit-20251016-3.1/src/history.c:918:60: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1106:26: call_function: calling 'history_prev_event' from 'history_w'
#  916|   	int retval;
#  917|   
#  918|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  919|   		if (ev->num == num)
#  920|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def106]
libedit-20251016-3.1/src/history.c:932:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1152:26: call_function: calling 'history_next_evdata' from 'history_w'
#  930|   	int retval;
#  931|   
#  932|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  933|   		if (ev->num == num) {
#  934|   			if (d)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def107]
libedit-20251016-3.1/src/history.c:932:60: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1152:26: call_function: calling 'history_next_evdata' from 'history_w'
#  930|   	int retval;
#  931|   
#  932|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  933|   		if (ev->num == num) {
#  934|   			if (d)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def108]
libedit-20251016-3.1/src/history.c:952:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1110:26: call_function: calling 'history_next_event' from 'history_w'
#  950|   	int retval;
#  951|   
#  952|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
#  953|   		if (ev->num == num)
#  954|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def109]
libedit-20251016-3.1/src/history.c:952:60: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1110:26: call_function: calling 'history_next_event' from 'history_w'
#  950|   	int retval;
#  951|   
#  952|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
#  953|   		if (ev->num == num)
#  954|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def110]
libedit-20251016-3.1/src/history.c:970:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1114:26: call_function: calling 'history_prev_string' from 'history_w'
#  968|   	int retval;
#  969|   
#  970|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
#  971|   		if (Strncmp(str, ev->str, len) == 0)
#  972|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def111]
libedit-20251016-3.1/src/history.c:970:60: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1114:26: call_function: calling 'history_prev_string' from 'history_w'
#  968|   	int retval;
#  969|   
#  970|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HNEXT(h, ev))
#  971|   		if (Strncmp(str, ev->str, len) == 0)
#  972|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def112]
libedit-20251016-3.1/src/history.c:988:23: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1118:26: call_function: calling 'history_next_string' from 'history_w'
#  986|   	int retval;
#  987|   
#  988|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  989|   		if (Strncmp(str, ev->str, len) == 0)
#  990|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def113]
libedit-20251016-3.1/src/history.c:988:60: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1001:1: enter_function: entry to 'history_w'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1118:26: call_function: calling 'history_next_string' from 'history_w'
#  986|   	int retval;
#  987|   
#  988|-> 	for (retval = HCURR(h, ev); retval != -1; retval = HPREV(h, ev))
#  989|   		if (Strncmp(str, ev->str, len) == 0)
#  990|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def114]
libedit-20251016-3.1/src/history.c:1030:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1030:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/32/codeFlows/0/threadFlows/0/locations/0)
# 1028|   	case H_ADD:
# 1029|   		str = va_arg(va, const Char *);
# 1030|-> 		retval = HADD(h, ev, str);
# 1031|   		break;
# 1032|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def115]
libedit-20251016-3.1/src/history.c:1034:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1034:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/33/codeFlows/0/threadFlows/0/locations/0)
# 1032|   
# 1033|   	case H_DEL:
# 1034|-> 		retval = HDEL(h, ev, va_arg(va, const int));
# 1035|   		break;
# 1036|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def116]
libedit-20251016-3.1/src/history.c:1039:31: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1039:31: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
# 1037|   	case H_ENTER:
# 1038|   		str = va_arg(va, const Char *);
# 1039|-> 		if ((retval = HENTER(h, ev, str)) != -1)
# 1040|   			h->h_ent = ev->num;
# 1041|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def117]
libedit-20251016-3.1/src/history.c:1045:31: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1045:31: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
# 1043|   	case H_APPEND:
# 1044|   		str = va_arg(va, const Char *);
# 1045|-> 		if ((retval = HSET(h, ev, h->h_ent)) != -1)
# 1046|   			retval = HADD(h, ev, str);
# 1047|   		break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def118]
libedit-20251016-3.1/src/history.c:1046:34: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1045:20: branch_true: following 'true' branch...
libedit-20251016-3.1/src/history.c:1046:34: branch_true: ...to here
libedit-20251016-3.1/src/history.c:1046:34: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
# 1044|   		str = va_arg(va, const Char *);
# 1045|   		if ((retval = HSET(h, ev, h->h_ent)) != -1)
# 1046|-> 			retval = HADD(h, ev, str);
# 1047|   		break;
# 1048|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def119]
libedit-20251016-3.1/src/history.c:1050:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1050:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/37/codeFlows/0/threadFlows/0/locations/0)
# 1048|   
# 1049|   	case H_FIRST:
# 1050|-> 		retval = HFIRST(h, ev);
# 1051|   		break;
# 1052|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def120]
libedit-20251016-3.1/src/history.c:1054:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1054:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
# 1052|   
# 1053|   	case H_NEXT:
# 1054|-> 		retval = HNEXT(h, ev);
# 1055|   		break;
# 1056|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def121]
libedit-20251016-3.1/src/history.c:1058:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1058:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/39/codeFlows/0/threadFlows/0/locations/0)
# 1056|   
# 1057|   	case H_LAST:
# 1058|-> 		retval = HLAST(h, ev);
# 1059|   		break;
# 1060|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def122]
libedit-20251016-3.1/src/history.c:1062:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1062:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/0)
# 1060|   
# 1061|   	case H_PREV:
# 1062|-> 		retval = HPREV(h, ev);
# 1063|   		break;
# 1064|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def123]
libedit-20251016-3.1/src/history.c:1066:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1066:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/0)
# 1064|   
# 1065|   	case H_CURR:
# 1066|-> 		retval = HCURR(h, ev);
# 1067|   		break;
# 1068|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def124]
libedit-20251016-3.1/src/history.c:1070:26: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1070:26: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/0)
# 1068|   
# 1069|   	case H_SET:
# 1070|-> 		retval = HSET(h, ev, va_arg(va, const int));
# 1071|   		break;
# 1072|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def125]
libedit-20251016-3.1/src/history.c:1074:17: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libedit-20251016-3.1/src/history.c:1007:9: acquire_resource: 'va_start' called here
libedit-20251016-3.1/src/history.c:1074:17: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/43/codeFlows/0/threadFlows/0/locations/0)
# 1072|   
# 1073|   	case H_CLEAR:
# 1074|-> 		HCLEAR(h, ev);
# 1075|   		retval = 0;
# 1076|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
libedit-20251016-3.1/src/literal.c:103:22: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libedit-20251016-3.1/src/literal.c:90:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/literal.c:93:28: branch_false: ...to here
libedit-20251016-3.1/src/literal.c:94:28: branch_true: following 'true' branch (when 'i < len')...
libedit-20251016-3.1/src/literal.c:95:38: branch_true: ...to here
libedit-20251016-3.1/src/literal.c:94:28: branch_false: following 'false' branch (when 'i >= len')...
libedit-20251016-3.1/src/literal.c:96:14: branch_false: ...to here
libedit-20251016-3.1/src/literal.c:98:13: acquire_memory: allocated here
libedit-20251016-3.1/src/literal.c:99:12: branch_false: following 'false' branch (when 'b' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/literal.c:102:28: branch_true: following 'true' branch (when 'i < len')...
libedit-20251016-3.1/src/literal.c:103:64: branch_true: ...to here
libedit-20251016-3.1/src/literal.c:103:22: danger: 'b' leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  101|   
#  102|   	for (n = 0, i = 0; i < len; i++)
#  103|-> 		n += ct_encode_char(b + n, (size_t)(w - n), buf[i]);
#  104|   	n += ct_encode_char(b + n, (size_t)(w - n), end[1]);
#  105|   	b[n] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def127]
libedit-20251016-3.1/src/literal.c:104:14: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libedit-20251016-3.1/src/literal.c:90:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/literal.c:93:28: branch_false: ...to here
libedit-20251016-3.1/src/literal.c:98:13: acquire_memory: allocated here
libedit-20251016-3.1/src/literal.c:99:12: branch_false: following 'false' branch (when 'b' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/literal.c:102:28: branch_false: following 'false' branch (when 'i >= len')...
libedit-20251016-3.1/src/literal.c:104:14: branch_false: ...to here
libedit-20251016-3.1/src/literal.c:104:14: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  102|   	for (n = 0, i = 0; i < len; i++)
#  103|   		n += ct_encode_char(b + n, (size_t)(w - n), buf[i]);
#  104|-> 	n += ct_encode_char(b + n, (size_t)(w - n), end[1]);
#  105|   	b[n] = '\0';
#  106|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def128]
libedit-20251016-3.1/src/read.c:215:20: warning[-Wanalyzer-malloc-leak]: leak of 'wcsdup(str)'
libedit-20251016-3.1/src/read.c:213:12: branch_true: following 'true' branch...
libedit-20251016-3.1/src/read.c:215:45: acquire_memory: allocated here
libedit-20251016-3.1/src/read.c:215:20: danger: 'wcsdup(str)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  213|   	if (str != NULL && ma->level + 1 < EL_MAXMACRO) {
#  214|   		ma->level++;
#  215|-> 		if ((ma->macro[ma->level] = wcsdup(str)) != NULL)
#  216|   			return;
#  217|   		ma->level--;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def129]
libedit-20251016-3.1/src/read.c:371:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*ma.level'
libedit-20251016-3.1/src/read.c:84:1: enter_function: entry to 'read_init'
libedit-20251016-3.1/src/read.c:88:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/read.c:92:26: branch_false: ...to here
libedit-20251016-3.1/src/read.c:92:12: branch_true: following 'true' branch...
libedit-20251016-3.1/src/read.c:93:17: branch_true: ...to here
libedit-20251016-3.1/src/read.c:101:9: call_function: calling 'read_end' from 'read_init'
#  369|   read_clearmacros(struct macros *ma)
#  370|   {
#  371|-> 	while (ma->level >= 0)
#  372|   		el_free(ma->macro[ma->level--]);
#  373|   	ma->offset = 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def130]
libedit-20251016-3.1/src/readline.c:800:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-20251016-3.1/src/readline.c:992:1: enter_function: entry to 'history_expand'
libedit-20251016-3.1/src/readline.c:998:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1001:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1006:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1010:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1012:32: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1042:21: branch_true: following 'true' branch...
 branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1070:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1079:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: following 'false' branch (when 'nresult' is non-NULL)...
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1082:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1091:23: call_function: calling '_history_expand_command' from 'history_expand'
#  798|   {
#  799|   	char *aptr;
#  800|-> 	if ((aptr = strrchr(*tmp, c)) == NULL)
#  801|   		return;
#  802|   	aptr = strdup(aptr + 1); // XXX: check

Error: GCC_ANALYZER_WARNING (CWE-688): [#def131]
libedit-20251016-3.1/src/readline.c:937:37: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-20251016-3.1/src/readline.c:992:1: enter_function: entry to 'history_expand'
libedit-20251016-3.1/src/readline.c:998:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1001:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1006:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1010:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1012:32: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1042:21: branch_true: following 'true' branch...
 branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1070:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1079:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: following 'false' branch (when 'nresult' is non-NULL)...
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1082:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1091:23: call_function: calling '_history_expand_command' from 'history_expand'
#  935|   			continue;
#  936|   		case 'h':	/* remove trailing path */
#  937|-> 			if ((aptr = strrchr(tmp, '/')) != NULL)
#  938|   				*aptr = '\0';
#  939|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def132]
libedit-20251016-3.1/src/readline.c:944:37: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'tmp' where non-null expected
libedit-20251016-3.1/src/readline.c:992:1: enter_function: entry to 'history_expand'
libedit-20251016-3.1/src/readline.c:998:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1001:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1006:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1010:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1012:32: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1042:21: branch_true: following 'true' branch...
 branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1070:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1079:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1080:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: following 'false' branch (when 'nresult' is non-NULL)...
libedit-20251016-3.1/src/readline.c:1080:17: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1082:20: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1091:23: call_function: calling '_history_expand_command' from 'history_expand'
#  942|   			continue;
#  943|   		case 'r':	/* remove trailing suffix */
#  944|-> 			if ((aptr = strrchr(tmp, '.')) != NULL)
#  945|   				*aptr = '\0';
#  946|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def133]
libedit-20251016-3.1/src/readline.c:1252:25: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libedit-20251016-3.1/src/readline.c:1238:1: enter_function: entry to 'stifle_history'
libedit-20251016-3.1/src/readline.c:1243:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1246:12: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1247:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1250:24: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1251:30: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1251:30: call_function: calling 'remove_history' from 'stifle_history'
libedit-20251016-3.1/src/readline.c:1251:30: return_function: returning to 'stifle_history' from 'remove_history'
libedit-20251016-3.1/src/readline.c:1252:25: danger: dereference of NULL 'remove_history(0)'
# 1250|   		while (history_length > max) {
# 1251|   			he = remove_history(0);
# 1252|-> 			el_free(he->data);
# 1253|   			el_free((void *)(unsigned long)he->line);
# 1254|   			el_free(he);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
libedit-20251016-3.1/src/readline.c:1304:19: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_resource: opened here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:19: danger: 'fopen(filename, "r+")' leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1302|   		return errno;
# 1303|   	strcpy(template, _history_tmp_template);
# 1304|-> 	if ((fd = mkstemp(template)) == -1) {
# 1305|   		ret = errno;
# 1306|   		goto out1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
libedit-20251016-3.1/src/readline.c:1304:19: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:19: danger: 'fopen(filename, "r+")' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1302|   		return errno;
# 1303|   	strcpy(template, _history_tmp_template);
# 1304|-> 	if ((fd = mkstemp(template)) == -1) {
# 1305|   		ret = errno;
# 1306|   		goto out1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def136]
libedit-20251016-3.1/src/readline.c:1310:17: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_resource: opened here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_true: following 'true' branch (when 'tp' is NULL)...
libedit-20251016-3.1/src/readline.c:1310:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1310:17: danger: 'fopen(filename, "r+")' leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1308|   
# 1309|   	if ((tp = fdopen(fd, "r+")) == NULL) {
# 1310|-> 		close(fd);
# 1311|   		ret = errno;
# 1312|   		goto out2;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
libedit-20251016-3.1/src/readline.c:1310:17: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_true: following 'true' branch (when 'tp' is NULL)...
libedit-20251016-3.1/src/readline.c:1310:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1310:17: danger: 'fopen(filename, "r+")' leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1308|   
# 1309|   	if ((tp = fdopen(fd, "r+")) == NULL) {
# 1310|-> 		close(fd);
# 1311|   		ret = errno;
# 1312|   		goto out2;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def138]
libedit-20251016-3.1/src/readline.c:1321:29: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_resource: opened here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1321:29: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1321:29: danger: 'fopen(filename, "r+")' leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1319|   				break;
# 1320|   			}
# 1321|-> 			if (fseeko(fp, (off_t)sizeof(buf) * count, SEEK_SET) ==
# 1322|   			    (off_t)-1) {
# 1323|   				ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
libedit-20251016-3.1/src/readline.c:1321:29: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "r+")'
libedit-20251016-3.1/src/readline.c:1301:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1321:29: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1321:29: danger: 'fopen(filename, "r+")' leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1319|   				break;
# 1320|   			}
# 1321|-> 			if (fseeko(fp, (off_t)sizeof(buf) * count, SEEK_SET) ==
# 1322|   			    (off_t)-1) {
# 1323|   				ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
libedit-20251016-3.1/src/readline.c:1321:29: warning[-Wanalyzer-malloc-leak]: leak of 'tp'
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1321:29: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1321:29: danger: 'tp' leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
# 1319|   				break;
# 1320|   			}
# 1321|-> 			if (fseeko(fp, (off_t)sizeof(buf) * count, SEEK_SET) ==
# 1322|   			    (off_t)-1) {
# 1323|   				ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
libedit-20251016-3.1/src/readline.c:1339:25: warning[-Wanalyzer-malloc-leak]: leak of 'tp'
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1321:29: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1321:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1326:41: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1327:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1331:28: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1331:28: branch_true: following 'true' branch (when 'left == 0')...
libedit-20251016-3.1/src/readline.c:1332:33: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1339:25: danger: 'tp' leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1337|   				break;
# 1338|   			}
# 1339|-> 			fflush(tp);
# 1340|   			break;
# 1341|   		}

Error: GCC_ANALYZER_WARNING (CWE-127): [#def142]
libedit-20251016-3.1/src/readline.c:1351:12: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1318:39: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1348:12: branch_false: following 'false' branch (when 'ret == 0')...
libedit-20251016-3.1/src/readline.c:1350:25: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1351:12: danger: out-of-bounds read at byte -1 but 'buf' starts at byte 0
# 1349|   		goto out3;
# 1350|   	cp = buf + left - 1;
# 1351|-> 	if(*cp != '\n')
# 1352|   		cp++;
# 1353|   	for(;;) {

Error: GCC_ANALYZER_WARNING (CWE-127): [#def143]
libedit-20251016-3.1/src/readline.c:1355:29: warning[-Wanalyzer-out-of-bounds]: stack-based buffer under-read
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1318:39: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1348:12: branch_false: following 'false' branch (when 'ret == 0')...
libedit-20251016-3.1/src/readline.c:1350:25: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1351:11: branch_false: following 'false' branch...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1354:24: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1355:29: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1355:29: danger: out-of-bounds read at byte -2 but 'buf' starts at byte 0
# 1353|   	for(;;) {
# 1354|   		while (--cp >= buf) {
# 1355|-> 			if (*cp == '\n') {
# 1356|   				if (--nlines == 0) {
# 1357|   					if (++cp >= buf + sizeof(buf)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
libedit-20251016-3.1/src/readline.c:1386:13: warning[-Wanalyzer-malloc-leak]: leak of 'tp'
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1317:28: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1321:29: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1321:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1323:39: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1348:12: branch_false: following 'false' branch (when 'ret == 0')...
libedit-20251016-3.1/src/readline.c:1350:25: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1351:11: branch_false: following 'false' branch...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1354:24: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1355:29: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1355:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1356:36: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1356:36: branch_true: following 'true' branch (when 'nlines == 0')...
libedit-20251016-3.1/src/readline.c:1357:44: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1357:44: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1365:21: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1365:20: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1383:13: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1383:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1386:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1386:13: danger: 'tp' leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
# 1384|   		goto out3;
# 1385|   
# 1386|-> 	if (fseeko(fp, (off_t)0, SEEK_SET) == (off_t)-1) {
# 1387|   		ret = errno;
# 1388|   		goto out3;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
libedit-20251016-3.1/src/readline.c:1391:13: warning[-Wanalyzer-malloc-leak]: leak of 'tp'
libedit-20251016-3.1/src/readline.c:1301:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1303:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1304:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1309:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1309:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1309:12: branch_false: following 'false' branch (when 'tp' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1348:12: branch_false: following 'false' branch (when 'ret == 0')...
libedit-20251016-3.1/src/readline.c:1350:25: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1351:11: branch_false: following 'false' branch...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1354:24: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1355:29: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1355:28: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1356:36: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1356:36: branch_true: following 'true' branch (when 'nlines == 0')...
libedit-20251016-3.1/src/readline.c:1357:44: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1357:44: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1365:21: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1365:20: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:1383:13: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:1383:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1386:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1386:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1391:24: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1391:13: danger: 'tp' leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 1389|   	}
# 1390|   
# 1391|-> 	if (fseeko(tp, (off_t)sizeof(buf) * count + (cp - buf), SEEK_SET) ==
# 1392|   	    (off_t)-1) {
# 1393|   		ret = errno;

Error: COMPILER_WARNING (CWE-252): [#def146]
libedit-20251016-3.1/src/readline.c: scope_hint: In function 'history_truncate_file'
libedit-20251016-3.1/src/readline.c:1410:23: warning[-Wunused-result]: ignoring return value of 'ftruncate' declared with attribute 'warn_unused_result'
# 1410 |                 (void)ftruncate(fileno(fp), off);
#      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
# 1408|   	fflush(fp);
# 1409|   	if((off = ftello(fp)) > 0)
# 1410|-> 		(void)ftruncate(fileno(fp), off);
# 1411|   out3:
# 1412|   	fclose(tp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def147]
libedit-20251016-3.1/src/readline.c:1475:13: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(filename, "a")'
libedit-20251016-3.1/src/readline.c:1467:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1472:19: acquire_resource: opened here
libedit-20251016-3.1/src/readline.c:1472:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1475:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1475:13: danger: 'fopen(filename, "a")' leaks here; was opened at [(3)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/2)
# 1473|   		return errno;
# 1474|   
# 1475|-> 	if (history(h, &ev, H_NSAVE_FP, (size_t)n,  fp) == -1) {
# 1476|   		int serrno = errno ? errno : EINVAL;
# 1477|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
libedit-20251016-3.1/src/readline.c:1475:13: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(filename, "a")'
libedit-20251016-3.1/src/readline.c:1467:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1472:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1472:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1475:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1475:13: danger: 'fopen(filename, "a")' leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 1473|   		return errno;
# 1474|   
# 1475|-> 	if (history(h, &ev, H_NSAVE_FP, (size_t)n,  fp) == -1) {
# 1476|   		int serrno = errno ? errno : EINVAL;
# 1477|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
libedit-20251016-3.1/src/readline.c:1573:13: warning[-Wanalyzer-malloc-leak]: leak of 'he'
libedit-20251016-3.1/src/readline.c:1567:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1570:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1570:12: branch_false: following 'false' branch (when 'he' is non-NULL)...
libedit-20251016-3.1/src/readline.c:1573:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1573:13: danger: 'he' leaks here; was allocated at [(3)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/2)
# 1571|   		return NULL;
# 1572|   
# 1573|-> 	if (history(h, &ev, H_DELDATA, num, &he->data) != 0) {
# 1574|   		el_free(he);
# 1575|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def150]
libedit-20251016-3.1/src/readline.c:1612:13: warning[-Wanalyzer-malloc-leak]: leak of 'he'
libedit-20251016-3.1/src/readline.c:1596:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1600:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1602:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1605:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:1608:19: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1608:19: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:1608:12: branch_false: following 'false' branch (when 'he' is non-NULL)...
libedit-20251016-3.1/src/readline.c:1612:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:1612:13: danger: 'he' leaks here; was allocated at [(7)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/6)
# 1610|   
# 1611|   	/* look forwards for event matching specified offset */
# 1612|-> 	if (history(h, &ev, H_NEXT_EVDATA, num, &he->data))
# 1613|   		goto out;
# 1614|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
libedit-20251016-3.1/src/readline.c:2155:17: warning[-Wanalyzer-malloc-leak]: leak of 'wbuf'
libedit-20251016-3.1/src/readline.c:2140:12: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:2147:13: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:2148:17: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:2149:20: branch_true: following 'true' branch (when 'done == 2')...
libedit-20251016-3.1/src/readline.c:2150:37: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:2150:37: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:2150:28: branch_true: following 'true' branch (when 'wbuf' is non-NULL)...
libedit-20251016-3.1/src/readline.c:2151:37: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:2155:17: danger: 'wbuf' leaks here; was allocated at [(7)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/6)
# 2153|   		} else
# 2154|   			wbuf = NULL;
# 2155|-> 		(*(void (*)(const char *))rl_linefunc)(wbuf);
# 2156|   	}
# 2157|   	_rl_update_pos();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
libedit-20251016-3.1/src/readline.c:2406:25: warning[-Wanalyzer-malloc-leak]: leak of 'list'
libedit-20251016-3.1/src/readline.c:2403:21: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:2403:12: branch_false: following 'false' branch (when 'list' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2406:25: danger: 'list' leaks here; was allocated at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
# 2404|   		return NULL;
# 2405|   
# 2406|-> 	while ((match = (*fun)(str, (int)(len - 1))) != NULL) {
# 2407|   		list[len++] = match;
# 2408|   		if (len == max) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
libedit-20251016-3.1/src/readline.c:2424:9: warning[-Wanalyzer-malloc-leak]: leak of 'list'
libedit-20251016-3.1/src/readline.c:2403:21: acquire_memory: allocated here
libedit-20251016-3.1/src/readline.c:2403:12: branch_false: following 'false' branch (when 'list' is non-NULL)...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2406:16: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:2407:22: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:2408:20: branch_false: following 'false' branch (when 'max != len')...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2406:16: branch_true: following 'true' branch...
libedit-20251016-3.1/src/readline.c:2407:22: branch_true: ...to here
libedit-20251016-3.1/src/readline.c:2408:20: branch_false: following 'false' branch (when 'max != len')...
 branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2406:16: branch_false: following 'false' branch...
libedit-20251016-3.1/src/readline.c:2416:12: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2416:12: branch_false: following 'false' branch (when 'len != 1')...
libedit-20251016-3.1/src/readline.c:2418:13: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2419:12: branch_false: following 'false' branch (when 'len != 2')...
libedit-20251016-3.1/src/readline.c:2424:9: branch_false: ...to here
libedit-20251016-3.1/src/readline.c:2424:9: danger: 'list' leaks here; was allocated at [(1)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/0)
# 2422|   		return list;
# 2423|   	}
# 2424|-> 	qsort(&list[1], len - 1, sizeof(*list),
# 2425|   	    (int (*)(const void *, const void *)) strcmp);
# 2426|   	min = SIZE_MAX;

Error: COMPILER_WARNING (CWE-252): [#def154]
libedit-20251016-3.1/src/vi.c: scope_hint: In function 'vi_histedit'
libedit-20251016-3.1/src/vi.c:1036:9: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
# 1036 |         write(fd, cp, len);
#      |         ^~~~~~~~~~~~~~~~~~
# 1034|   	cp[TMP_BUFSIZ - 1] = '\0';
# 1035|   	len = strlen(cp);
# 1036|-> 	write(fd, cp, len);
# 1037|   	write(fd, "\n", (size_t)1);
# 1038|   	pid = fork();

Error: COMPILER_WARNING (CWE-252): [#def155]
libedit-20251016-3.1/src/vi.c:1037:9: warning[-Wunused-result]: ignoring return value of 'write' declared with attribute 'warn_unused_result'
# 1037 |         write(fd, "\n", (size_t)1);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
# 1035|   	len = strlen(cp);
# 1036|   	write(fd, cp, len);
# 1037|-> 	write(fd, "\n", (size_t)1);
# 1038|   	pid = fork();
# 1039|   	switch (pid) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def156]
libedit-20251016-3.1/src/vis.c:557:23: warning[-Wanalyzer-malloc-leak]: leak of 'dst'
libedit-20251016-3.1/src/vis.c:843:1: enter_function: entry to 'strnvisx'
libedit-20251016-3.1/src/vis.c:845:16: call_function: calling 'istrsenvisx' from 'strnvisx'
#  555|   	for (start = dst; len > 0; len--) {
#  556|   		c = *src++;
#  557|-> 		dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra);
#  558|   		if (dst == NULL) {
#  559|   			errno = ENOSPC;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def157]
libedit-20251016-3.1/src/vis.c:557:23: warning[-Wanalyzer-malloc-leak]: leak of 'src'
libedit-20251016-3.1/src/vis.c:843:1: enter_function: entry to 'strnvisx'
libedit-20251016-3.1/src/vis.c:845:16: call_function: calling 'istrsenvisx' from 'strnvisx'
#  555|   	for (start = dst; len > 0; len--) {
#  556|   		c = *src++;
#  557|-> 		dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra);
#  558|   		if (dst == NULL) {
#  559|   			errno = ENOSPC;

Scan Properties

analyzer-version-clippy1.90.0
analyzer-version-cppcheck2.18.3
analyzer-version-gcc15.2.1
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-190.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-gcc-latest-x86_64
project-namelibedit-3.1-57.20251016cvs.fc44
store-results-to/tmp/tmpsuvhqkt4/libedit-3.1-57.20251016cvs.fc44.tar.xz
time-created2025-10-28 18:57:14
time-finished2025-10-28 18:58:44
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-gcc-latest-x86_64' '-t' 'gcc,cppcheck,shellcheck,clippy,unicontrol' '-o' '/tmp/tmpsuvhqkt4/libedit-3.1-57.20251016cvs.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--install=gcc-latest' '--gcc-analyzer-bin=/opt/gcc-latest/bin/gcc' '/tmp/tmpsuvhqkt4/libedit-3.1-57.20251016cvs.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251027.143044.ge6b947b-1.el9