libarchive-3.8.4-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
libarchive-3.8.4/cpio/cmdline.c:339:30: warning[-Wanalyzer-malloc-leak]: leak of ‘user’
libarchive-3.8.4/cpio/cmdline.c:304:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cmdline.c:315:13: branch_false: ...to here
libarchive-3.8.4/cpio/cmdline.c:315:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cmdline.c:315:12: branch_false: ...to here
libarchive-3.8.4/cpio/cmdline.c:334:24: acquire_memory: allocated here
libarchive-3.8.4/cpio/cmdline.c:335:20: branch_false: following ‘false’ branch (when ‘user’ is non-NULL)...
libarchive-3.8.4/cpio/cmdline.c:337:17: branch_false: ...to here
libarchive-3.8.4/cpio/cmdline.c:339:30: throw: if ‘getpwnam’ throws an exception...
libarchive-3.8.4/cpio/cmdline.c:339:30: danger: ‘user’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  337|   		memcpy(user, u, ue - u);
#  338|   		user[ue - u] = '\0';
#  339|-> 		if ((pwent = getpwnam(user)) != NULL) {
#  340|   			owner->uid = pwent->pw_uid;
#  341|   			owner->uname = strdup(pwent->pw_name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
libarchive-3.8.4/cpio/cpio.c:860:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:860:13: throw: if ‘archive_write_header’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:860:13: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  858|   	}
#  859|   
#  860|-> 	r = archive_write_header(cpio->archive, entry);
#  861|   
#  862|   	if (r != ARCHIVE_OK)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
libarchive-3.8.4/cpio/cpio.c:863:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:862:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:863:17: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:863:17: throw: if ‘archive_error_string’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:863:17: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  861|   
#  862|   	if (r != ARCHIVE_OK)
#  863|-> 		lafe_warnc(archive_errno(cpio->archive),
#  864|   		    "%s: %s",
#  865|   		    srcpath,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libarchive-3.8.4/cpio/cpio.c:871:34: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:871:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:871:34: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:871:34: throw: if ‘archive_entry_size’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:871:34: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  869|   		exit(1);
#  870|   
#  871|-> 	if (r >= ARCHIVE_WARN && archive_entry_size(entry) > 0 && fd >= 0) {
#  872|   		bytes_read = read(fd, cpio->buff, (unsigned)cpio->buff_size);
#  873|   		while (bytes_read > 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
libarchive-3.8.4/cpio/cpio.c:875:39: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:871:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:873:24: branch_true: following ‘true’ branch (when ‘bytes_read > 0’)...
libarchive-3.8.4/cpio/cpio.c:875:39: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:875:39: throw: if ‘archive_write_data’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:875:39: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  873|   		while (bytes_read > 0) {
#  874|   			ssize_t bytes_write;
#  875|-> 			bytes_write = archive_write_data(cpio->archive,
#  876|   			    cpio->buff, bytes_read);
#  877|   			if (bytes_write < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
libarchive-3.8.4/cpio/cpio.c:878:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:871:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:873:24: branch_true: following ‘true’ branch (when ‘bytes_read > 0’)...
libarchive-3.8.4/cpio/cpio.c:875:39: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:878:33: throw: if ‘archive_error_string’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:878:33: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  876|   			    cpio->buff, bytes_read);
#  877|   			if (bytes_write < 0)
#  878|-> 				lafe_errc(1, archive_errno(cpio->archive),
#  879|   				    "%s", archive_error_string(cpio->archive));
#  880|   			if (bytes_write < bytes_read) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
libarchive-3.8.4/cpio/cpio.c:881:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:871:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:873:24: branch_true: following ‘true’ branch (when ‘bytes_read > 0’)...
libarchive-3.8.4/cpio/cpio.c:875:39: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:877:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:880:28: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:881:33: throw: if ‘lafe_warnc’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:881:33: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  879|   				    "%s", archive_error_string(cpio->archive));
#  880|   			if (bytes_write < bytes_read) {
#  881|-> 				lafe_warnc(0,
#  882|   				    "Truncated write; file may have "
#  883|   				    "grown while being archived.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libarchive-3.8.4/cpio/cpio.c:925:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:789:1: enter_function: entry to ‘entry_to_archive’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:890:14: call_function: calling ‘restore_time’ from ‘entry_to_archive’
#  923|   		return (fd);
#  924|   
#  925|->         times[1].tv_sec = archive_entry_mtime(entry);
#  926|           times[1].tv_usec = archive_entry_mtime_nsec(entry) / 1000;
#  927|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def9]
libarchive-3.8.4/cpio/cpio.c:926:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
libarchive-3.8.4/cpio/cpio.c:789:1: enter_function: entry to ‘entry_to_archive’
libarchive-3.8.4/cpio/cpio.c:847:12: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:848:21: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:848:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/cpio/cpio.c:849:30: branch_true: ...to here
libarchive-3.8.4/cpio/cpio.c:849:30: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:850:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:860:13: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:890:14: call_function: calling ‘restore_time’ from ‘entry_to_archive’
#  924|   
#  925|           times[1].tv_sec = archive_entry_mtime(entry);
#  926|->         times[1].tv_usec = archive_entry_mtime_nsec(entry) / 1000;
#  927|   
#  928|           times[0].tv_sec = archive_entry_atime(entry);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def10]
libarchive-3.8.4/cpio/cpio.c:1241:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*cpio.destdir’ where non-null expected
libarchive-3.8.4/cpio/cpio.c:1240:25: acquire_memory: this call could return NULL
libarchive-3.8.4/cpio/cpio.c:1241:9: danger: argument 1 (‘malloc(strlen(destdir) + 8)’) from [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
# 1239|   	cpio->destdir_len = strlen(destdir);
# 1240|   	cpio->destdir = malloc(cpio->destdir_len + 8);
# 1241|-> 	memcpy(cpio->destdir, destdir, cpio->destdir_len);
# 1242|   	if (cpio->destdir_len == 0 || destdir[cpio->destdir_len - 1] != '/')
# 1243|   		cpio->destdir[cpio->destdir_len++] = '/';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def11]
libarchive-3.8.4/cpio/cpio.c:1319:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen("/dev/tty", "r+")’
libarchive-3.8.4/cpio/cpio.c:1315:13: acquire_resource: opened here
libarchive-3.8.4/cpio/cpio.c:1316:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:1318:9: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:1319:9: throw: if ‘fflush’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:1319:9: danger: ‘fopen("/dev/tty", "r+")’ leaks here; was opened at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 1317|   		return (name);
# 1318|   	fprintf(t, "%s (Enter/./(new name))? ", name);
# 1319|-> 	fflush(t);
# 1320|   #endif
# 1321|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
libarchive-3.8.4/cpio/cpio.c:1319:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen("/dev/tty", "r+")’
libarchive-3.8.4/cpio/cpio.c:1315:13: acquire_memory: allocated here
libarchive-3.8.4/cpio/cpio.c:1316:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/cpio/cpio.c:1318:9: branch_false: ...to here
libarchive-3.8.4/cpio/cpio.c:1319:9: throw: if ‘fflush’ throws an exception...
libarchive-3.8.4/cpio/cpio.c:1319:9: danger: ‘fopen("/dev/tty", "r+")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 1317|   		return (name);
# 1318|   	fprintf(t, "%s (Enter/./(new name))? ", name);
# 1319|-> 	fflush(t);
# 1320|   #endif
# 1321|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libarchive-3.8.4/libarchive/archive_entry.c:190:33: warning[-Wanalyzer-malloc-leak]: leak of 'archive_entry_new2(*entry.archive)'
libarchive-3.8.4/libarchive/archive_entry.c:175:1: enter_function: entry to 'archive_entry_clone'
libarchive-3.8.4/libarchive/archive_entry.c:186:18: call_function: calling 'archive_entry_new2' from 'archive_entry_clone'
libarchive-3.8.4/libarchive/archive_entry.c:186:18: return_function: returning to 'archive_entry_clone' from 'archive_entry_new2'
libarchive-3.8.4/libarchive/archive_entry.c:187:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_entry.c:189:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_entry.c:195:9: throw: if 'archive_mstring_copy' throws an exception...
libarchive-3.8.4/libarchive/archive_entry.c:190:33: danger: 'archive_entry_new2(*entry.archive)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  188|   		return (NULL);
#  189|   	entry2->ae_stat = entry->ae_stat;
#  190|-> 	entry2->ae_fflags_set = entry->ae_fflags_set;
#  191|   	entry2->ae_fflags_clear = entry->ae_fflags_clear;
#  192|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: warning[-Wanalyzer-malloc-leak]: leak of 'le'
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:381:14: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:382:12: branch_false: following 'false' branch (when 'le' is non-NULL)...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: throw: if 'archive_entry_clone' throws an exception...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: danger: 'le' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  382|   	if (le == NULL)
#  383|   		return (NULL);
#  384|-> 	le->canonical = archive_entry_clone(entry);
#  385|   
#  386|   	/* If the links cache is getting too full, enlarge the hash table. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:25: warning[-Wanalyzer-malloc-leak]: leak of 'le'
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:381:14: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:382:12: branch_false: following 'false' branch (when 'le' is non-NULL)...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:25: throw: if 'archive_entry_dev' throws an exception...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:25: danger: 'le' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  388|   		grow_hash(res);
#  389|   
#  390|-> 	hash = (size_t)(archive_entry_dev(entry) ^ archive_entry_ino64(entry));
#  391|   	bucket = hash & (res->number_buckets - 1);
#  392|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:52: warning[-Wanalyzer-malloc-leak]: leak of 'le'
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:381:14: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:382:12: branch_false: following 'false' branch (when 'le' is non-NULL)...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:384:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:52: throw: if 'archive_entry_ino64' throws an exception...
libarchive-3.8.4/libarchive/archive_entry_link_resolver.c:390:52: danger: 'le' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  388|   		grow_hash(res);
#  389|   
#  390|-> 	hash = (size_t)(archive_entry_dev(entry) ^ archive_entry_ino64(entry));
#  391|   	bucket = hash & (res->number_buckets - 1);
#  392|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libarchive-3.8.4/libarchive/archive_entry_xattr.c:97:17: warning[-Wanalyzer-malloc-leak]: leak of 'xp'
libarchive-3.8.4/libarchive/archive_entry_xattr.c:93:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_entry_xattr.c:93:12: branch_false: following 'false' branch (when 'xp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_entry_xattr.c:96:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_entry_xattr.c:96:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_entry_xattr.c:97:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_entry_xattr.c:97:17: throw: if '__archive_errx' throws an exception...
libarchive-3.8.4/libarchive/archive_entry_xattr.c:97:17: danger: 'xp' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   95|   
#   96|   	if ((xp->name = strdup(name)) == NULL)
#   97|-> 		__archive_errx(1, "Out of memory");
#   98|   
#   99|   	if ((xp->value = malloc(size)) != NULL) {

Error: CPPCHECK_WARNING (CWE-401): [#def18]
libarchive-3.8.4/libarchive/archive_match.c:240: error[memleak]: Memory leak: a
#  238|   	match_list_init(&(a->inclusion_gnames));
#  239|   	time(&a->now);
#  240|-> 	return (&(a->archive));
#  241|   }
#  242|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libarchive-3.8.4/libarchive/archive_match.c:570:9: warning[-Wanalyzer-malloc-leak]: leak of 'match'
libarchive-3.8.4/libarchive/archive_match.c:563:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:564:12: branch_false: following 'false' branch (when 'match' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:567:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:570:9: throw: if 'archive_mstring_copy_mbs_len' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:570:9: danger: 'match' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  568|   	if (len && pattern[len - 1] == '/')
#  569|   		--len;
#  570|-> 	archive_mstring_copy_mbs_len(&(match->pattern), pattern, len);
#  571|   	match_list_add(list, match);
#  572|   	a->setflag |= PATTERN_IS_SET;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libarchive-3.8.4/libarchive/archive_match.c:590:9: warning[-Wanalyzer-malloc-leak]: leak of 'match'
libarchive-3.8.4/libarchive/archive_match.c:583:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:584:12: branch_false: following 'false' branch (when 'match' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:587:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:590:9: throw: if 'archive_mstring_copy_wcs_len' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:590:9: danger: 'match' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  588|   	if (len && pattern[len - 1] == L'/')
#  589|   		--len;
#  590|-> 	archive_mstring_copy_wcs_len(&(match->pattern), pattern, len);
#  591|   	match_list_add(list, match);
#  592|   	a->setflag |= PATTERN_IS_SET;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libarchive-3.8.4/libarchive/archive_match.c:1390:20: warning[-Wanalyzer-malloc-leak]: leak of 'f'
libarchive-3.8.4/libarchive/archive_match.c:1377:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:1378:12: branch_false: following 'false' branch (when 'f' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:1390:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1390:20: throw: if 'archive_entry_pathname' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:1390:20: danger: 'f' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1388|   	archive_mstring_copy_wcs(&(f->pathname), pathname);
# 1389|   #else
# 1390|-> 	pathname = archive_entry_pathname(entry);
# 1391|   	if (pathname == NULL) {
# 1392|   		free(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libarchive-3.8.4/libarchive/archive_match.c:1396:9: warning[-Wanalyzer-malloc-leak]: leak of 'f'
libarchive-3.8.4/libarchive/archive_match.c:1377:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:1378:12: branch_false: following 'false' branch (when 'f' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:1390:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1391:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_match.c:1396:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1396:9: throw: if 'archive_mstring_copy_mbs' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:1396:9: danger: 'f' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1394|   		return (ARCHIVE_FAILED);
# 1395|   	}
# 1396|-> 	archive_mstring_copy_mbs(&(f->pathname), pathname);
# 1397|   #endif
# 1398|   	f->flag = flag;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libarchive-3.8.4/libarchive/archive_match.c:1746:17: warning[-Wanalyzer-malloc-leak]: leak of 'match'
libarchive-3.8.4/libarchive/archive_match.c:1742:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:1743:12: branch_false: following 'false' branch (when 'match' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:1745:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1745:12: branch_true: following 'true' branch (when 'mbs != 0')...
libarchive-3.8.4/libarchive/archive_match.c:1746:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1746:17: throw: if 'archive_mstring_copy_mbs' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:1746:17: danger: 'match' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1744|   		return (error_nomem(a));
# 1745|   	if (mbs)
# 1746|-> 		archive_mstring_copy_mbs(&(match->pattern), name);
# 1747|   	else
# 1748|   		archive_mstring_copy_wcs(&(match->pattern), name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libarchive-3.8.4/libarchive/archive_match.c:1748:17: warning[-Wanalyzer-malloc-leak]: leak of 'match'
libarchive-3.8.4/libarchive/archive_match.c:1742:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_match.c:1743:12: branch_false: following 'false' branch (when 'match' is non-NULL)...
libarchive-3.8.4/libarchive/archive_match.c:1745:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1745:12: branch_false: following 'false' branch (when 'mbs == 0')...
libarchive-3.8.4/libarchive/archive_match.c:1748:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_match.c:1748:17: throw: if 'archive_mstring_copy_wcs' throws an exception...
libarchive-3.8.4/libarchive/archive_match.c:1748:17: danger: 'match' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1746|   		archive_mstring_copy_mbs(&(match->pattern), name);
# 1747|   	else
# 1748|-> 		archive_mstring_copy_wcs(&(match->pattern), name);
# 1749|   	match_list_add(list, match);
# 1750|   	a->setflag |= ID_IS_SET;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libarchive-3.8.4/libarchive/archive_options.c:132:21: warning[-Wanalyzer-malloc-leak]: leak of 'data'
libarchive-3.8.4/libarchive/archive_options.c:99:1: enter_function: entry to '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:106:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:111:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_options.c:111:12: branch_false: following 'false' branch (when 'data' is non-NULL)...
libarchive-3.8.4/libarchive/archive_options.c:116:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:121:17: call_function: calling 'parse_option' from '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:121:17: return_function: returning to '_archive_set_options' from 'parse_option'
libarchive-3.8.4/libarchive/archive_options.c:122:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_options.c:122:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_options.c:122:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:132:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:132:21: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_options.c:132:21: danger: 'data' leaks here; was allocated at [(6)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/5)
#  130|   		}
#  131|   
#  132|-> 		r = use_option(a, mod, opt, val);
#  133|   		if (r == ARCHIVE_FATAL) {
#  134|   			free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libarchive-3.8.4/libarchive/archive_options.c:145:25: warning[-Wanalyzer-malloc-leak]: leak of 'data'
libarchive-3.8.4/libarchive/archive_options.c:99:1: enter_function: entry to '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:106:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:111:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_options.c:111:12: branch_false: following 'false' branch (when 'data' is non-NULL)...
libarchive-3.8.4/libarchive/archive_options.c:116:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:121:17: call_function: calling 'parse_option' from '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:121:17: return_function: returning to '_archive_set_options' from 'parse_option'
libarchive-3.8.4/libarchive/archive_options.c:122:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_options.c:122:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_options.c:122:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:132:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:133:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:137:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:141:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_options.c:142:28: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_options.c:142:28: branch_false: following 'false' branch (when 'ignore_mod_err == 0')...
libarchive-3.8.4/libarchive/archive_options.c:145:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:145:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_options.c:145:25: danger: 'data' leaks here; was allocated at [(6)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/5)
#  143|   				continue;
#  144|   			/* The module name is wrong. */
#  145|-> 			archive_set_error(a, ARCHIVE_ERRNO_MISC,
#  146|   			    "Unknown module name: `%s'", mod);
#  147|   			free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
libarchive-3.8.4/libarchive/archive_options.c:152:25: warning[-Wanalyzer-malloc-leak]: leak of 'data'
libarchive-3.8.4/libarchive/archive_options.c:99:1: enter_function: entry to '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:106:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:108:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:111:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_options.c:111:12: branch_false: following 'false' branch (when 'data' is non-NULL)...
libarchive-3.8.4/libarchive/archive_options.c:116:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:121:17: call_function: calling 'parse_option' from '_archive_set_options'
libarchive-3.8.4/libarchive/archive_options.c:121:17: return_function: returning to '_archive_set_options' from 'parse_option'
libarchive-3.8.4/libarchive/archive_options.c:122:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_options.c:122:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_options.c:122:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:132:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:133:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:137:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:141:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:150:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_options.c:150:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_options.c:152:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_options.c:152:25: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_options.c:152:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_options.c:152:25: danger: 'data' leaks here; was allocated at [(6)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/5)
#  150|   		if (r == ARCHIVE_WARN) {
#  151|   			/* The option name is wrong. No-one used this. */
#  152|-> 			archive_set_error(a, ARCHIVE_ERRNO_MISC,
#  153|   			    "Undefined option: `%s%s%s'",
#  154|   			    mod?mod:"", mod?":":"", opt);

Error: COMPILER_WARNING (CWE-704): [#def28]
libarchive-3.8.4/libarchive/archive_options.c: scope_hint: In function 'parse_option'
libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  179 |         p = strchr(opt, ',');
#      |           ^
#  177|   	val = "1";
#  178|   
#  179|-> 	p = strchr(opt, ',');
#  180|   
#  181|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def29]
libarchive-3.8.4/libarchive/archive_options.c:179:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  177|   	val = "1";
#  178|   
#  179|-> 	p = strchr(opt, ',');
#  180|   
#  181|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def30]
libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  194 |         p = strchr(opt, ':');
#      |           ^
#  192|   	}
#  193|   
#  194|-> 	p = strchr(opt, ':');
#  195|   	if (p != NULL) {
#  196|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def31]
libarchive-3.8.4/libarchive/archive_options.c:194:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  192|   	}
#  193|   
#  194|-> 	p = strchr(opt, ':');
#  195|   	if (p != NULL) {
#  196|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def32]
libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  201 |         p = strchr(opt, '=');
#      |           ^
#  199|   	}
#  200|   
#  201|-> 	p = strchr(opt, '=');
#  202|   	if (p != NULL) {
#  203|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def33]
libarchive-3.8.4/libarchive/archive_options.c:201:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  199|   	}
#  200|   
#  201|-> 	p = strchr(opt, '=');
#  202|   	if (p != NULL) {
#  203|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def34]
libarchive-3.8.4/libarchive/archive_pack_dev.c: scope_hint: In function 'pack_find'
libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  324 |         format = bsearch(name, formats,
#      |                ^
#  322|   	struct format	*format;
#  323|   
#  324|-> 	format = bsearch(name, formats,
#  325|   	    sizeof(formats)/sizeof(formats[0]),
#  326|   	    sizeof(formats[0]), compare_format);

Error: COMPILER_WARNING (CWE-704): [#def35]
libarchive-3.8.4/libarchive/archive_pack_dev.c:324:16: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
#  322|   	struct format	*format;
#  323|   
#  324|-> 	format = bsearch(name, formats,
#  325|   	    sizeof(formats)/sizeof(formats[0]),
#  326|   	    sizeof(formats[0]), compare_format);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def36]
libarchive-3.8.4/libarchive/archive_rb.c:374:44: warning[-Wanalyzer-null-dereference]: dereference of NULL 'standin'
libarchive-3.8.4/libarchive/archive_rb.c:492:1: enter_function: entry to '__archive_rb_tree_remove_node'
libarchive-3.8.4/libarchive/archive_rb.c:515:12: branch_false: following 'false' branch (when 'self' is non-NULL)...
libarchive-3.8.4/libarchive/archive_rb.c:515:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_rb.c:520:14: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_rb.c:544:19: call_function: calling '__archive_rb_tree_iterate' from '__archive_rb_tree_remove_node'
libarchive-3.8.4/libarchive/archive_rb.c:544:19: return_function: returning to '__archive_rb_tree_remove_node' from '__archive_rb_tree_iterate'
libarchive-3.8.4/libarchive/archive_rb.c:545:9: call_function: calling '__archive_rb_tree_swap_prune_and_rebalance' from '__archive_rb_tree_remove_node'
#  372|       struct archive_rb_node *self, struct archive_rb_node *standin)
#  373|   {
#  374|-> 	const unsigned int standin_which = RB_POSITION(standin);
#  375|   	unsigned int standin_other = standin_which ^ RB_DIR_OTHER;
#  376|   	struct archive_rb_node *standin_son;

Error: CPPCHECK_WARNING (CWE-401): [#def37]
libarchive-3.8.4/libarchive/archive_read_add_passphrase.c:83: error[memleak]: Memory leak: p.passphrase
#   81|   		return (NULL);
#   82|   	}
#   83|-> 	return (p);
#   84|   }
#   85|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:68:33: warning[-Wanalyzer-malloc-leak]: leak of 'nulls'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:80:1: enter_function: entry to 'archive_read_data_into_fd'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:93:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:96:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:98:25: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:107:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:108:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:109:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:109:29: call_function: calling 'pad_to' from 'archive_read_data_into_fd'
#   66|   		if (target_offset < actual_offset + (int64_t)nulls_size)
#   67|   			to_write = (size_t)(target_offset - actual_offset);
#   68|-> 		bytes_written = write(fd, nulls, to_write);
#   69|   		if (bytes_written < 0) {
#   70|   			archive_set_error(a, errno, "Write error");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:70:25: warning[-Wanalyzer-malloc-leak]: leak of 'nulls'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:80:1: enter_function: entry to 'archive_read_data_into_fd'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:93:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:96:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:98:25: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:107:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:108:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:109:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:109:29: call_function: calling 'pad_to' from 'archive_read_data_into_fd'
#   68|   		bytes_written = write(fd, nulls, to_write);
#   69|   		if (bytes_written < 0) {
#   70|-> 			archive_set_error(a, errno, "Write error");
#   71|   			return (ARCHIVE_FATAL);
#   72|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:21: warning[-Wanalyzer-malloc-leak]: leak of 'nulls'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:93:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:96:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:98:25: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:21: throw: if 'archive_read_data_block' throws an exception...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:21: danger: 'nulls' leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  103|   	}
#  104|   
#  105|-> 	while ((r = archive_read_data_block(a, &buff, &size, &target_offset)) ==
#  106|   	    ARCHIVE_OK) {
#  107|   		const char *p = buff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:119:41: warning[-Wanalyzer-malloc-leak]: leak of 'nulls'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:93:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:96:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:98:25: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:107:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:119:41: throw: if 'write' throws an exception...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:119:41: danger: 'nulls' leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  117|   			if (bytes_to_write > MAX_WRITE)
#  118|   				bytes_to_write = MAX_WRITE;
#  119|-> 			bytes_written = write(fd, p, bytes_to_write);
#  120|   			if (bytes_written < 0) {
#  121|   				archive_set_error(a, errno, "Write error");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:121:33: warning[-Wanalyzer-malloc-leak]: leak of 'nulls'
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:93:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:96:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:98:25: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:99:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:105:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:107:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:121:33: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_data_into_fd.c:121:33: danger: 'nulls' leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  119|   			bytes_written = write(fd, p, bytes_to_write);
#  120|   			if (bytes_written < 0) {
#  121|-> 				archive_set_error(a, errno, "Write error");
#  122|   				r = ARCHIVE_FATAL;
#  123|   				goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:236:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'fd'
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:169:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:172:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:227:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:228:14: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:227:13: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:229:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:229:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:230:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:230:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:234:38: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:234:38: acquire_resource: opened here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:236:25: throw: if '__archive_ensure_cloexec_flag' throws an exception...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:236:25: danger: 'fd' leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  234|   				fd = open(path, O_RDONLY | O_NONBLOCK |
#  235|   						O_CLOEXEC);
#  236|-> 			__archive_ensure_cloexec_flag(fd);
#  237|   		}
#  238|   		if (fd >= 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:267:34: warning[-Wanalyzer-malloc-leak]: leak of 'linkbuffer'
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:169:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:172:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:254:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:255:41: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:259:30: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:260:20: branch_false: following 'false' branch (when 'linkbuffer' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:265:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:265:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:267:45: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:267:34: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_read_disk_entry_from_file.c:267:34: danger: 'linkbuffer' leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  265|   		if (a->tree != NULL) {
#  266|   #ifdef HAVE_READLINKAT
#  267|-> 			lnklen = readlinkat(a->tree_current_dir_fd(a->tree),
#  268|   			    path, linkbuffer, linkbuffer_len);
#  269|   #else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1203:20: warning[-Wanalyzer-malloc-leak]: leak of '*t.sparse_list'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1198:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1199:22: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1201:34: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1203:20: danger: '*t.sparse_list' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1201|   		t->sparse_list = malloc(sizeof(t->sparse_list[0]) *
# 1202|   		    t->sparse_list_size);
# 1203|-> 		if (t->sparse_list == NULL) {
# 1204|   			t->sparse_list_size = 0;
# 1205|   			archive_set_error(&a->archive, ENOMEM,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2021:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'new_fd'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2020:18: acquire_resource: opened here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2021:9: throw: if '__archive_ensure_cloexec_flag' throws an exception...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2021:9: danger: 'new_fd' leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 2019|   #endif /* F_DUPFD_CLOEXEC */
# 2020|   	new_fd = dup(fd);
# 2021|-> 	__archive_ensure_cloexec_flag(new_fd);
# 2022|   	return (new_fd);
# 2023|   }

Error: CPPCHECK_WARNING (CWE-476): [#def47]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2037: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: te
# 2035|   	if (te == NULL)
# 2036|   		__archive_errx(1, "Out of memory");
# 2037|-> 	te->next = t->stack;
# 2038|   	te->parent = t->current;
# 2039|   	if (te->parent)

Error: CPPCHECK_WARNING (CWE-476): [#def48]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2038: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: te
# 2036|   		__archive_errx(1, "Out of memory");
# 2037|   	te->next = t->stack;
# 2038|-> 	te->parent = t->current;
# 2039|   	if (te->parent)
# 2040|   		te->depth = te->parent->depth + 1;

Error: CPPCHECK_WARNING (CWE-476): [#def49]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2039: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: te
# 2037|   	te->next = t->stack;
# 2038|   	te->parent = t->current;
# 2039|-> 	if (te->parent)
# 2040|   		te->depth = te->parent->depth + 1;
# 2041|   	t->stack = te;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2097:9: warning[-Wanalyzer-malloc-leak]: leak of 't'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2094:18: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2094:12: branch_false: following 'false' branch (when 't' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2096:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2097:9: throw: if 'archive_string_ensure' throws an exception...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2097:9: danger: 't' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 2095|   		return (NULL);
# 2096|   	archive_string_init(&t->path);
# 2097|-> 	archive_string_ensure(&t->path, 31);
# 2098|   	t->initial_symlink_mode = symlink_mode;
# 2099|   	return (tree_reopen(t, path, restore_time));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2144:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*t.initial_dir_fd'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1314:1: enter_function: entry to 'archive_read_disk_open'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1318:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1321:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1323:16: call_function: calling '_archive_read_disk_open' from 'archive_read_disk_open'
# 2142|   	 * unhelpful and unnecessary errors later.
# 2143|   	 */
# 2144|-> 	if (t->initial_dir_fd < 0)
# 2145|   		t->initial_dir_fd = open(".", o_flag | O_CLOEXEC);
# 2146|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2145:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor '*t.initial_dir_fd'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1314:1: enter_function: entry to 'archive_read_disk_open'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1318:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1321:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1323:16: call_function: calling '_archive_read_disk_open' from 'archive_read_disk_open'
# 2143|   	 */
# 2144|   	if (t->initial_dir_fd < 0)
# 2145|-> 		t->initial_dir_fd = open(".", o_flag | O_CLOEXEC);
# 2146|   #endif
# 2147|   	__archive_ensure_cloexec_flag(t->initial_dir_fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:2366:33: warning[-Wanalyzer-malloc-leak]: leak of '*t.d'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1117:1: enter_function: entry to '_archive_read_next_header2'
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1123:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1127:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_disk_posix.c:1136:21: call_function: calling 'next_entry' from '_archive_read_next_header2'
# 2364|   			fd = tree_dup(t->working_dir_fd);
# 2365|   			if (fd != -1)
# 2366|-> 				t->d = fdopendir(fd);
# 2367|   		}
# 2368|   #else /* HAVE_FDOPENDIR */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   80|   	b = malloc(block_size);
#   81|   	if (mine == NULL || b == NULL) {
#   82|-> 		archive_set_error(a, ENOMEM, "No memory");
#   83|   		free(mine);
#   84|   		free(b);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:82:17: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   80|   	b = malloc(block_size);
#   81|   	if (mine == NULL || b == NULL) {
#   82|-> 		archive_set_error(a, ENOMEM, "No memory");
#   83|   		free(mine);
#   84|   		free(b);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:66: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: throw: if 'archive_read_extract_set_skip_file' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   96|   	 */
#   97|   	if (S_ISREG(st.st_mode)) {
#   98|-> 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
#   99|   		mine->use_lseek = 1;
#  100|   		mine->size = st.st_size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:66: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: throw: if 'archive_read_extract_set_skip_file' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:98:17: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   96|   	 */
#   97|   	if (S_ISREG(st.st_mode)) {
#   98|-> 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
#   99|   		mine->use_lseek = 1;
#  100|   		mine->size = st.st_size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: throw: if 'archive_read_set_read_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  104|   #endif
#  105|   
#  106|-> 	archive_read_set_read_callback(a, file_read);
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: throw: if 'archive_read_set_read_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  104|   #endif
#  105|   
#  106|-> 	archive_read_set_read_callback(a, file_read);
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: throw: if 'archive_read_set_skip_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  105|   
#  106|   	archive_read_set_read_callback(a, file_read);
#  107|-> 	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: throw: if 'archive_read_set_skip_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:107:9: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  105|   
#  106|   	archive_read_set_read_callback(a, file_read);
#  107|-> 	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: throw: if 'archive_read_set_seek_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  106|   	archive_read_set_read_callback(a, file_read);
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|-> 	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);
#  110|   	archive_read_set_callback_data(a, mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: throw: if 'archive_read_set_seek_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:108:9: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  106|   	archive_read_set_read_callback(a, file_read);
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|-> 	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);
#  110|   	archive_read_set_callback_data(a, mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: throw: if 'archive_read_set_close_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|-> 	archive_read_set_close_callback(a, file_close);
#  110|   	archive_read_set_callback_data(a, mine);
#  111|   	return (archive_read_open1(a));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: throw: if 'archive_read_set_close_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:109:9: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  107|   	archive_read_set_skip_callback(a, file_skip);
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|-> 	archive_read_set_close_callback(a, file_close);
#  110|   	archive_read_set_callback_data(a, mine);
#  111|   	return (archive_read_open1(a));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:80:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: throw: if 'archive_read_set_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: danger: 'b' leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);
#  110|-> 	archive_read_set_callback_data(a, mine);
#  111|   	return (archive_read_open1(a));
#  112|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_fd.c:74:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:79:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:81:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:87:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:97:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:106:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: throw: if 'archive_read_set_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_fd.c:110:9: danger: 'mine' leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  108|   	archive_read_set_seek_callback(a, file_seek);
#  109|   	archive_read_set_close_callback(a, file_close);
#  110|-> 	archive_read_set_callback_data(a, mine);
#  111|   	return (archive_read_open1(a));
#  112|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   76|   	b = malloc(block_size);
#   77|   	if (mine == NULL || b == NULL) {
#   78|-> 		archive_set_error(a, ENOMEM, "No memory");
#   79|   		free(mine);
#   80|   		free(b);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:78:17: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   76|   	b = malloc(block_size);
#   77|   	if (mine == NULL || b == NULL) {
#   78|-> 		archive_set_error(a, ENOMEM, "No memory");
#   79|   		free(mine);
#   80|   		free(b);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:92:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: throw: if 'archive_read_extract_set_skip_file' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   91|   	 */
#   92|   	if (la_seek_fstat(fileno(mine->f), &st) == 0 && S_ISREG(st.st_mode)) {
#   93|-> 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
#   94|   		/* Enable the seek optimization only for regular files. */
#   95|   		mine->can_skip = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:92:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: throw: if 'archive_read_extract_set_skip_file' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:93:17: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   91|   	 */
#   92|   	if (la_seek_fstat(fileno(mine->f), &st) == 0 && S_ISREG(st.st_mode)) {
#   93|-> 		archive_read_extract_set_skip_file(a, st.st_dev, st.st_ino);
#   94|   		/* Enable the seek optimization only for regular files. */
#   95|   		mine->can_skip = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: throw: if 'archive_read_set_read_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  101|   #endif
#  102|   
#  103|-> 	archive_read_set_read_callback(a, FILE_read);
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def73]
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: throw: if 'archive_read_set_read_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:103:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  101|   #endif
#  102|   
#  103|-> 	archive_read_set_read_callback(a, FILE_read);
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: throw: if 'archive_read_set_skip_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  102|   
#  103|   	archive_read_set_read_callback(a, FILE_read);
#  104|-> 	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def75]
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: throw: if 'archive_read_set_skip_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:104:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  102|   
#  103|   	archive_read_set_read_callback(a, FILE_read);
#  104|-> 	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: throw: if 'archive_read_set_seek_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  103|   	archive_read_set_read_callback(a, FILE_read);
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|-> 	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);
#  107|   	archive_read_set_callback_data(a, mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def77]
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: throw: if 'archive_read_set_seek_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:105:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  103|   	archive_read_set_read_callback(a, FILE_read);
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|-> 	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);
#  107|   	archive_read_set_callback_data(a, mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def78]
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: throw: if 'archive_read_set_close_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|-> 	archive_read_set_close_callback(a, FILE_close);
#  107|   	archive_read_set_callback_data(a, mine);
#  108|   	return (archive_read_open1(a));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def79]
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: throw: if 'archive_read_set_close_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:106:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  104|   	archive_read_set_skip_callback(a, FILE_skip);
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|-> 	archive_read_set_close_callback(a, FILE_close);
#  107|   	archive_read_set_callback_data(a, mine);
#  108|   	return (archive_read_open1(a));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of 'b'
libarchive-3.8.4/libarchive/archive_read_open_file.c:76:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: throw: if 'archive_read_set_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: danger: 'b' leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);
#  107|-> 	archive_read_set_callback_data(a, mine);
#  108|   	return (archive_read_open1(a));
#  109|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_file.c:75:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_file.c:77:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_file.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: throw: if 'archive_read_set_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_file.c:107:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  105|   	archive_read_set_seek_callback(a, FILE_seek);
#  106|   	archive_read_set_close_callback(a, FILE_close);
#  107|-> 	archive_read_set_callback_data(a, mine);
#  108|   	return (archive_read_open1(a));
#  109|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def82]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:140:21: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:119:12: branch_false: following 'false' branch (when 'filenames' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:122:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:125:20: branch_true: following 'true' branch (when 'filename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:125:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:127:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:129:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:131:24: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:136:21: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:136:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:140:21: throw: if 'archive_read_append_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:140:21: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  138|   		} else
#  139|   			mine->filename_type = FNT_MBS;
#  140|-> 		if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) {
#  141|   			free(mine);
#  142|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def83]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:29: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_true: following 'true' branch (when 'wfilenames' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:175:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:203:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:29: throw: if 'archive_string_append_from_wcs' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:29: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  202|   
#  203|   			archive_string_init(&fn);
#  204|-> 			if (archive_string_append_from_wcs(&fn, wfilename,
#  205|   			    wcslen(wfilename)) != 0) {
#  206|   				if (errno == ENOMEM)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:207:41: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_true: following 'true' branch (when 'wfilenames' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:175:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:203:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:206:37: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:206:36: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:207:41: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:207:41: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:207:41: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  205|   			    wcslen(wfilename)) != 0) {
#  206|   				if (errno == ENOMEM)
#  207|-> 					archive_set_error(a, errno,
#  208|   					    "Can't allocate memory");
#  209|   				else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:210:41: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_true: following 'true' branch (when 'wfilenames' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:175:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:203:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:206:37: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:206:36: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:210:41: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:210:41: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:210:41: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  208|   					    "Can't allocate memory");
#  209|   				else
#  210|-> 					archive_set_error(a, EINVAL,
#  211|   					    "Failed to convert a wide-character"
#  212|   					    " filename to a multi-byte filename");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def86]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:213:33: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_true: following 'true' branch (when 'wfilenames' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:175:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:203:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:206:37: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:213:33: throw: if 'archive_string_free' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:213:33: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  211|   					    "Failed to convert a wide-character"
#  212|   					    " filename to a multi-byte filename");
#  213|-> 				archive_string_free(&fn);
#  214|   				free(mine);
#  215|   				return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def87]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:219:25: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_true: following 'true' branch (when 'wfilenames' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:175:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:203:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:204:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:217:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:219:25: throw: if 'archive_string_free' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:219:25: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  217|   			mine->filename_type = FNT_MBS;
#  218|   			strcpy(mine->filename.m, fn.s);
#  219|-> 			archive_string_free(&fn);
#  220|   #endif
#  221|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:222:21: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:174:12: branch_false: following 'false' branch (when 'wfilenames' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:177:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: following 'true' branch (when 'wfilename' is NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:180:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:182:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:184:20: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:186:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:189:21: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:190:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:222:21: throw: if 'archive_read_append_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:222:21: danger: 'mine' leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
#  220|   #endif
#  221|   		}
#  222|-> 		if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) {
#  223|   			free(mine);
#  224|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def89]
libarchive-3.8.4/libarchive/archive_read_open_filename.c:292:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(filename, 524288)'
libarchive-3.8.4/libarchive/archive_read_open_filename.c:274:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:289:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:289:19: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:290:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:291:22: acquire_resource: opened here
libarchive-3.8.4/libarchive/archive_read_open_filename.c:292:17: throw: if '__archive_ensure_cloexec_flag' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_filename.c:292:17: danger: 'open(filename, 524288)' leaks here; was opened at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  290|   		filename = mine->filename.m;
#  291|   		fd = open(filename, O_RDONLY | O_BINARY | O_CLOEXEC);
#  292|-> 		__archive_ensure_cloexec_flag(fd);
#  293|   		if (fd < 0) {
#  294|   			archive_set_error(a, errno,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def90]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:80:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:80:9: throw: if 'archive_read_set_open_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:80:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   78|   	mine->end = mine->start + size;
#   79|   	mine->read_size = read_size;
#   80|-> 	archive_read_set_open_callback(a, memory_read_open);
#   81|   	archive_read_set_read_callback(a, memory_read);
#   82|   	archive_read_set_seek_callback(a, memory_read_seek);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:81:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:81:9: throw: if 'archive_read_set_read_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:81:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   79|   	mine->read_size = read_size;
#   80|   	archive_read_set_open_callback(a, memory_read_open);
#   81|-> 	archive_read_set_read_callback(a, memory_read);
#   82|   	archive_read_set_seek_callback(a, memory_read_seek);
#   83|   	archive_read_set_skip_callback(a, memory_read_skip);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:82:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:82:9: throw: if 'archive_read_set_seek_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:82:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   80|   	archive_read_set_open_callback(a, memory_read_open);
#   81|   	archive_read_set_read_callback(a, memory_read);
#   82|-> 	archive_read_set_seek_callback(a, memory_read_seek);
#   83|   	archive_read_set_skip_callback(a, memory_read_skip);
#   84|   	archive_read_set_close_callback(a, memory_read_close);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def93]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:83:9: throw: if 'archive_read_set_skip_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:83:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#   81|   	archive_read_set_read_callback(a, memory_read);
#   82|   	archive_read_set_seek_callback(a, memory_read_seek);
#   83|-> 	archive_read_set_skip_callback(a, memory_read_skip);
#   84|   	archive_read_set_close_callback(a, memory_read_close);
#   85|   	archive_read_set_callback_data(a, mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def94]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:84:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:84:9: throw: if 'archive_read_set_close_callback' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:84:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#   82|   	archive_read_set_seek_callback(a, memory_read_seek);
#   83|   	archive_read_set_skip_callback(a, memory_read_skip);
#   84|-> 	archive_read_set_close_callback(a, memory_read_close);
#   85|   	archive_read_set_callback_data(a, mine);
#   86|   	return (archive_read_open1(a));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
libarchive-3.8.4/libarchive/archive_read_open_memory.c:85:9: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_read_open_memory.c:72:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:73:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:77:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_open_memory.c:85:9: throw: if 'archive_read_set_callback_data' throws an exception...
libarchive-3.8.4/libarchive/archive_read_open_memory.c:85:9: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   83|   	archive_read_set_skip_callback(a, memory_read_skip);
#   84|   	archive_read_set_close_callback(a, memory_read_close);
#   85|-> 	archive_read_set_callback_data(a, mine);
#   86|   	return (archive_read_open1(a));
#   87|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: warning[-Wanalyzer-malloc-leak]: leak of 'out_block'
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:194:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:195:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: danger: 'out_block' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  194|   	out_block = malloc(out_block_size);
#  195|   	if (state == NULL || out_block == NULL) {
#  196|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  197|   		    "Can't allocate data for bzip2 decompression");
#  198|   		free(out_block);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:193:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:195:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_bzip2.c:196:17: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  194|   	out_block = malloc(out_block_size);
#  195|   	if (state == NULL || out_block == NULL) {
#  196|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  197|   		    "Can't allocate data for bzip2 decompression");
#  198|   		free(out_block);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
libarchive-3.8.4/libarchive/archive_read_support_filter_gzip.c:200:25: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(p + (sizetype)len)'
libarchive-3.8.4/libarchive/archive_read_support_filter_gzip.c:341:1: enter_function: entry to 'consume_header'
libarchive-3.8.4/libarchive/archive_read_support_filter_gzip.c:351:15: call_function: calling 'peek_at_header' from 'consume_header'
#  198|   			/* Reset the name in case of repeat header reads. */
#  199|   			free(state->name);
#  200|-> 			state->name = strdup((const char *)&p[file_start]);
#  201|   		}
#  202|   #endif

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:319:1: warning[-Wanalyzer-malloc-leak]: leak of 'out_block'
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:427:1: enter_function: entry to 'lz4_filter_read_descriptor'
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:439:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:449:31: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:451:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:451:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:454:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:454:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:465:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:468:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:506:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:510:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_lz4.c:513:13: call_function: calling 'lz4_allocate_out_block' from 'lz4_filter_read_descriptor'
#  317|   		memset(state->out_block, 0, 64 * 1024);
#  318|   	return (ARCHIVE_OK);
#  319|-> }
#  320|   
#  321|   static int

Error: GCC_ANALYZER_WARNING (CWE-688): [#def100]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:152:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc(signature_len)' where non-null expected
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:143:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:146:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:150:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:151:36: acquire_memory: this call could return NULL
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:152:17: danger: argument 1 ('malloc(signature_len)') from [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#  150|   		state->signature_len = signature_len;
#  151|   		state->signature = malloc(signature_len);
#  152|-> 		memcpy(state->signature, signature, signature_len);
#  153|   	}
#  154|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def101]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:143:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:146:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: throw: if '__archive_read_register_bidder' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: danger: '<unknown>' leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  153|   	}
#  154|   
#  155|-> 	if (__archive_read_register_bidder(a, state, NULL,
#  156|   				&program_bidder_vtable) != ARCHIVE_OK) {
#  157|   		free_state(state);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:142:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:143:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:145:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:146:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:149:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: throw: if '__archive_read_register_bidder' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:155:13: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  153|   	}
#  154|   
#  155|-> 	if (__archive_read_register_bidder(a, state, NULL,
#  156|   				&program_bidder_vtable) != ARCHIVE_OK) {
#  157|   		free_state(state);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def103]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: warning[-Wanalyzer-malloc-leak]: leak of 'out_buf'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:399:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: throw: if 'archive_string_ensure' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: danger: 'out_buf' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  399|   	out_buf = malloc(out_buf_len);
#  400|   	if (state == NULL || out_buf == NULL ||
#  401|-> 	    archive_string_ensure(&state->description, l) == NULL) {
#  402|   		archive_set_error(&self->archive->archive, ENOMEM,
#  403|   		    "Can't allocate input data");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def104]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:398:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: throw: if 'archive_string_ensure' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  399|   	out_buf = malloc(out_buf_len);
#  400|   	if (state == NULL || out_buf == NULL ||
#  401|-> 	    archive_string_ensure(&state->description, l) == NULL) {
#  402|   		archive_set_error(&self->archive->archive, ENOMEM,
#  403|   		    "Can't allocate input data");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def105]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: warning[-Wanalyzer-malloc-leak]: leak of 'out_buf'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:399:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: danger: 'out_buf' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  400|   	if (state == NULL || out_buf == NULL ||
#  401|   	    archive_string_ensure(&state->description, l) == NULL) {
#  402|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  403|   		    "Can't allocate input data");
#  404|   		if (state != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def106]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:398:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:17: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  400|   	if (state == NULL || out_buf == NULL ||
#  401|   	    archive_string_ensure(&state->description, l) == NULL) {
#  402|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  403|   		    "Can't allocate input data");
#  404|   		if (state != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def107]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: warning[-Wanalyzer-malloc-leak]: leak of 'out_buf'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:399:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:404:20: branch_true: following 'true' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: throw: if 'archive_string_free' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: danger: 'out_buf' leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  403|   		    "Can't allocate input data");
#  404|   		if (state != NULL) {
#  405|-> 			archive_string_free(&state->description);
#  406|   			free(state);
#  407|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def108]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:398:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:402:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:404:20: branch_true: following 'true' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: throw: if 'archive_string_free' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:405:25: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  403|   		    "Can't allocate input data");
#  404|   		if (state != NULL) {
#  405|-> 			archive_string_free(&state->description);
#  406|   			free(state);
#  407|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def109]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:411:9: warning[-Wanalyzer-malloc-leak]: leak of 'out_buf'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:399:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:13: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:411:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:411:9: throw: if 'archive_strncat' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:411:9: danger: 'out_buf' leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  409|   		return (ARCHIVE_FATAL);
#  410|   	}
#  411|-> 	archive_strcpy(&state->description, prefix);
#  412|   	archive_strcat(&state->description, cmd);
#  413|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def110]
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:412:9: warning[-Wanalyzer-malloc-leak]: leak of 'out_buf'
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:399:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:401:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:400:13: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:411:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:412:9: throw: if 'archive_strcat' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_program.c:412:9: danger: 'out_buf' leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  410|   	}
#  411|   	archive_strcpy(&state->description, prefix);
#  412|-> 	archive_strcat(&state->description, cmd);
#  413|   
#  414|   	self->code = ARCHIVE_FILTER_PROGRAM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def111]
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: warning[-Wanalyzer-malloc-leak]: leak of 'in_buff'
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:380:19: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:381:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: danger: 'in_buff' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  380|   	in_buff = malloc(IN_BUFF_SIZE);
#  381|   	if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
#  382|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  383|   		    "Can't allocate data for uudecode");
#  384|   		free(uudecode);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def112]
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: warning[-Wanalyzer-malloc-leak]: leak of 'out_buff'
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:379:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:381:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: danger: 'out_buff' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  380|   	in_buff = malloc(IN_BUFF_SIZE);
#  381|   	if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
#  382|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  383|   		    "Can't allocate data for uudecode");
#  384|   		free(uudecode);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def113]
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: warning[-Wanalyzer-malloc-leak]: leak of 'uudecode'
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:378:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:381:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:382:17: danger: 'uudecode' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  380|   	in_buff = malloc(IN_BUFF_SIZE);
#  381|   	if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
#  382|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  383|   		    "Can't allocate data for uudecode");
#  384|   		free(uudecode);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def114]
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:441:1: warning[-Wanalyzer-malloc-leak]: leak of 'ptr'
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:460:1: enter_function: entry to 'uudecode_filter_read'
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:474:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:482:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:484:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:488:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:488:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:489:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:489:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:500:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_uu.c:499:21: call_function: calling 'ensure_in_buff_size' from 'uudecode_filter_read'
#  439|   	}
#  440|   	return (ARCHIVE_OK);
#  441|-> }
#  442|   
#  443|   static int

Error: GCC_ANALYZER_WARNING (CWE-401): [#def115]
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: warning[-Wanalyzer-malloc-leak]: leak of 'out_block'
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:480:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:481:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: danger: 'out_block' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  480|   	out_block = malloc(out_block_size);
#  481|   	if (state == NULL || out_block == NULL) {
#  482|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  483|   		    "Can't allocate data for xz decompression");
#  484|   		free(out_block);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def116]
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:479:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:481:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:36: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_xz.c:482:17: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  480|   	out_block = malloc(out_block_size);
#  481|   	if (state == NULL || out_block == NULL) {
#  482|-> 		archive_set_error(&self->archive->archive, ENOMEM,
#  483|   		    "Can't allocate data for xz decompression");
#  484|   		free(out_block);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def117]
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: warning[-Wanalyzer-malloc-leak]: leak of 'out_block'
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:222:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: throw: if 'ZSTD_createDStream' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: danger: 'out_block' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  221|   	state = calloc(1, sizeof(*state));
#  222|   	out_block = malloc(out_block_size);
#  223|-> 	dstream = ZSTD_createDStream();
#  224|   
#  225|   	if (state == NULL || out_block == NULL || dstream == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def118]
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:221:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: throw: if 'ZSTD_createDStream' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_filter_zstd.c:223:19: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  221|   	state = calloc(1, sizeof(*state));
#  222|   	out_block = malloc(out_block_size);
#  223|-> 	dstream = ZSTD_createDStream();
#  224|   
#  225|   	if (state == NULL || out_block == NULL || dstream == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def119]
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3011:13: warning[-Wanalyzer-null-dereference]: dereference of NULL 'file'
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2837:1: enter_function: entry to 'next_cache_entry'
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2848:16: call_function: inlined call to 'cache_get_entry' from 'next_cache_entry'
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2973:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2978:9: release_memory: '*iso9660.cache_files.first' is NULL
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2980:9: release_memory: 'empty_files.first' is NULL
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2985:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:2986:14: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3004:24: call_function: calling 'heap_get_entry' from 'next_cache_entry'
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3004:24: return_function: returning to 'next_cache_entry' from 'heap_get_entry'
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3007:12: branch_false: following 'false' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3011:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_iso9660.c:3011:13: danger: dereference of NULL 'file'
# 3009|   		return ((file == NULL)?ARCHIVE_EOF:ARCHIVE_OK);
# 3010|   	}
# 3011|-> 	if (file->number == -1) {
# 3012|   		file->next = NULL;
# 3013|   		*empty_files.last = file;

Error: COMPILER_WARNING (CWE-704): [#def120]
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c: scope_hint: In function 'readline'
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2110 |                 nl = memchr(t, '\n', bytes_read);
#      |                    ^
# 2108|   		if (bytes_read < 0)
# 2109|   			return (ARCHIVE_FATAL);
# 2110|-> 		nl = memchr(t, '\n', bytes_read);
# 2111|   		/* If we found '\n', trim the read to end exactly there. */
# 2112|   		if (nl != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def121]
libarchive-3.8.4/libarchive/archive_read_support_format_mtree.c:2110:20: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2108|   		if (bytes_read < 0)
# 2109|   			return (ARCHIVE_FATAL);
# 2110|-> 		nl = memchr(t, '\n', bytes_read);
# 2111|   		/* If we found '\n', trim the read to end exactly there. */
# 2112|   		if (nl != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def122]
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3548:23: warning[-Wanalyzer-malloc-leak]: leak of 'prog'
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3538:6: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3545:10: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3546:6: branch_false: following 'false' branch (when 'prog' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3548:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3548:23: throw: if 'crc32' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_rar.c:3548:23: danger: 'prog' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 3546|     if (!prog)
# 3547|       return NULL;
# 3548|->   prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32);
# 3549|   
# 3550|     if (membr_bits(&br, 1))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def123]
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4387:17: warning[-Wanalyzer-malloc-leak]: leak of 'rar'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4371:5: enter_function: entry to 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4376:11: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4379:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4379:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4380:11: branch_false: following 'false' branch (when 'rar' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: call_function: calling 'rar5_init' from 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: return_function: returning to 'archive_read_support_format_rar5' from 'rar5_init'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:11: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4387:38: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4387:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4387:17: danger: 'rar' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 4385|   
# 4386|   	if(ARCHIVE_OK != rar5_init(rar)) {
# 4387|-> 		archive_set_error(&ar->archive, ENOMEM,
# 4388|   		    "Can't allocate rar5 filter buffer");
# 4389|   		free(rar);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def124]
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4371:5: enter_function: entry to 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4376:11: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4379:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4380:11: branch_false: following 'false' branch (when 'rar' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: call_function: calling 'rar5_init' from 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: return_function: returning to 'archive_read_support_format_rar5' from 'rar5_init'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:11: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: throw: if '__archive_read_register_format' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: danger: '<unknown>' leaks here; was allocated at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
# 4391|   	}
# 4392|   
# 4393|-> 	ret = __archive_read_register_format(ar,
# 4394|   	    rar,
# 4395|   	    "rar5",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def125]
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: warning[-Wanalyzer-malloc-leak]: leak of 'rar'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4371:5: enter_function: entry to 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4376:11: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4379:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4379:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4380:11: branch_false: following 'false' branch (when 'rar' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: call_function: calling 'rar5_init' from 'archive_read_support_format_rar5'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:26: return_function: returning to 'archive_read_support_format_rar5' from 'rar5_init'
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4386:11: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: throw: if '__archive_read_register_format' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_rar5.c:4393:15: danger: 'rar' leaks here; was allocated at [(4)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/3)
# 4391|   	}
# 4392|   
# 4393|-> 	ret = __archive_read_register_format(ar,
# 4394|   	    rar,
# 4395|   	    "rar5",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def126]
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:71:13: warning[-Wanalyzer-malloc-leak]: leak of 'info'
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:61:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:64:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:64:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:65:12: branch_false: following 'false' branch (when 'info' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:71:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:71:13: throw: if '__archive_read_register_format' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_raw.c:71:13: danger: 'info' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   69|   	}
#   70|   
#   71|-> 	r = __archive_read_register_format(a,
#   72|   	    info,
#   73|   	    "raw",

Error: COMPILER_WARNING (CWE-704): [#def127]
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c: scope_hint: In function 'readline'
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3549 |         p = memchr(t, '\n', bytes_read);
#      |           ^
# 3547|   		return (ARCHIVE_FATAL);
# 3548|   	s = t;  /* Start of line? */
# 3549|-> 	p = memchr(t, '\n', bytes_read);
# 3550|   	/* If we found '\n' in the read buffer, return pointer to that. */
# 3551|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def128]
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3549:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3547|   		return (ARCHIVE_FATAL);
# 3548|   	s = t;  /* Start of line? */
# 3549|-> 	p = memchr(t, '\n', bytes_read);
# 3550|   	/* If we found '\n' in the read buffer, return pointer to that. */
# 3551|   	if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def129]
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3590 |                 p = memchr(t, '\n', bytes_read);
#      |                   ^
# 3588|   			return (ARCHIVE_FATAL);
# 3589|   		s = t;  /* Start of line? */
# 3590|-> 		p = memchr(t, '\n', bytes_read);
# 3591|   		/* If we found '\n', trim the read. */
# 3592|   		if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def130]
libarchive-3.8.4/libarchive/archive_read_support_format_tar.c:3590:19: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 3588|   			return (ARCHIVE_FATAL);
# 3589|   		s = t;  /* Start of line? */
# 3590|-> 		p = memchr(t, '\n', bytes_read);
# 3591|   		/* If we found '\n', trim the read. */
# 3592|   		if (p != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def131]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1930:9: warning[-Wanalyzer-malloc-leak]: leak of 'tag'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1923:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1924:12: branch_false: following 'false' branch (when 'tag' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1928:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1930:9: throw: if 'archive_strncat' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:1930:9: danger: 'tag' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1928|   	tag->next = xar->unknowntags;
# 1929|   	archive_string_init(&(tag->name));
# 1930|-> 	archive_strcpy(&(tag->name), name);
# 1931|   	if (xar->unknowntags == NULL) {
# 1932|   #if DEBUG

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3168:1: enter_function: entry to 'xml2_read_toc'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3175:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3180:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3182:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3186:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3191:29: call_function: calling 'xml2_xmlattr_setup' from 'xml2_read_toc'
# 3084|   		}
# 3085|   		attr->name = strdup(
# 3086|-> 		    (const char *)xmlTextReaderConstLocalName(reader));
# 3087|   		if (attr->name == NULL) {
# 3088|   			free(attr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def133]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: warning[-Wanalyzer-malloc-leak]: leak of 'attr'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3079:16: branch_true: following 'true' branch (when 'r == 1')...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3080:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3080:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3081:20: branch_false: following 'false' branch (when 'attr' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: throw: if 'xmlTextReaderConstLocalName' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: danger: 'attr' leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 3084|   		}
# 3085|   		attr->name = strdup(
# 3086|-> 		    (const char *)xmlTextReaderConstLocalName(reader));
# 3087|   		if (attr->name == NULL) {
# 3088|   			free(attr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def134]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: warning[-Wanalyzer-malloc-leak]: leak of 'list.first'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3168:1: enter_function: entry to 'xml2_read_toc'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3175:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3180:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3182:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3186:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3191:29: call_function: calling 'xml2_xmlattr_setup' from 'xml2_read_toc'
# 3084|   		}
# 3085|   		attr->name = strdup(
# 3086|-> 		    (const char *)xmlTextReaderConstLocalName(reader));
# 3087|   		if (attr->name == NULL) {
# 3088|   			free(attr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def135]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3079:16: branch_true: following 'true' branch (when 'r == 1')...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3080:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3081:20: branch_false: following 'false' branch (when 'attr' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3085:30: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3087:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: throw: if 'xmlTextReaderConstValue' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: danger: '<unknown>' leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 3091|   		}
# 3092|   		attr->value = strdup(
# 3093|-> 		    (const char *)xmlTextReaderConstValue(reader));
# 3094|   		if (attr->value == NULL) {
# 3095|   			free(attr->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: warning[-Wanalyzer-malloc-leak]: leak of 'attr'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3079:16: branch_true: following 'true' branch (when 'r == 1')...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3080:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3080:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3081:20: branch_false: following 'false' branch (when 'attr' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3086:35: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3087:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: throw: if 'xmlTextReaderConstValue' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: danger: 'attr' leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
# 3091|   		}
# 3092|   		attr->value = strdup(
# 3093|-> 		    (const char *)xmlTextReaderConstValue(reader));
# 3094|   		if (attr->value == NULL) {
# 3095|   			free(attr->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def137]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3093:35: warning[-Wanalyzer-malloc-leak]: leak of 'list.first'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3168:1: enter_function: entry to 'xml2_read_toc'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3175:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3180:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3182:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3186:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3191:29: call_function: calling 'xml2_xmlattr_setup' from 'xml2_read_toc'
# 3091|   		}
# 3092|   		attr->value = strdup(
# 3093|-> 		    (const char *)xmlTextReaderConstValue(reader));
# 3094|   		if (attr->value == NULL) {
# 3095|   			free(attr->name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def138]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3103:21: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3168:1: enter_function: entry to 'xml2_read_toc'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3175:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3180:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3182:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3186:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3191:29: call_function: calling 'xml2_xmlattr_setup' from 'xml2_read_toc'
# 3101|   		*list->last = attr;
# 3102|   		list->last = &(attr->next);
# 3103|-> 		r = xmlTextReaderMoveToNextAttribute(reader);
# 3104|   	}
# 3105|   	return (r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def139]
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3103:21: warning[-Wanalyzer-malloc-leak]: leak of 'list.first'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3168:1: enter_function: entry to 'xml2_read_toc'
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3175:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3180:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3182:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3186:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_xar.c:3191:29: call_function: calling 'xml2_xmlattr_setup' from 'xml2_read_toc'
# 3101|   		*list->last = attr;
# 3102|   		list->last = &(attr->next);
# 3103|-> 		r = xmlTextReaderMoveToNextAttribute(reader);
# 3104|   	}
# 3105|   	return (r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def140]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3600:13: warning[-Wanalyzer-malloc-leak]: leak of 'zip'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3580:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3583:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3583:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3584:12: branch_false: following 'false' branch (when 'zip' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3597:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3600:13: throw: if '__archive_read_register_format' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:3600:13: danger: 'zip' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 3598|   	zip->crc32func = real_crc32;
# 3599|   
# 3600|-> 	r = __archive_read_register_format(a,
# 3601|   	    zip,
# 3602|   	    "zip",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def141]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4106:18: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4124:1: enter_function: entry to 'zip_read_mac_metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4183:17: call_function: calling 'zip_get_local_file_header_size' from 'zip_read_mac_metadata'
# 4104|   	ssize_t filename_length, extra_length;
# 4105|   
# 4106|-> 	if ((p = __archive_read_ahead(a, extra + ZIP_LOCHDR_LEN, NULL)) == NULL) {
# 4107|   		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
# 4108|   		    "Truncated ZIP file header");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def142]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4107:17: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4124:1: enter_function: entry to 'zip_read_mac_metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4183:17: call_function: calling 'zip_get_local_file_header_size' from 'zip_read_mac_metadata'
# 4105|   
# 4106|   	if ((p = __archive_read_ahead(a, extra + ZIP_LOCHDR_LEN, NULL)) == NULL) {
# 4107|-> 		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
# 4108|   		    "Truncated ZIP file header");
# 4109|   		return (ARCHIVE_WARN);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def143]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4114:17: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4124:1: enter_function: entry to 'zip_read_mac_metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4183:17: call_function: calling 'zip_get_local_file_header_size' from 'zip_read_mac_metadata'
# 4112|   
# 4113|   	if (memcmp(p, "PK\003\004", 4) != 0) {
# 4114|-> 		archive_set_error(&a->archive, -1, "Damaged Zip archive");
# 4115|   		return ARCHIVE_WARN;
# 4116|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def144]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4178:17: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4178:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4178:17: throw: if '__archive_read_consume' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4178:17: danger: 'metadata' leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
# 4176|   
# 4177|   	if (offset < rsrc->local_header_offset)
# 4178|-> 		__archive_read_consume(a, rsrc->local_header_offset - offset);
# 4179|   	else if (offset != rsrc->local_header_offset) {
# 4180|   		__archive_read_seek(a, rsrc->local_header_offset, SEEK_SET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def145]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4180:17: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4179:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4179:17: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4180:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4180:17: throw: if '__archive_read_seek' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4180:17: danger: 'metadata' leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 4178|   		__archive_read_consume(a, rsrc->local_header_offset - offset);
# 4179|   	else if (offset != rsrc->local_header_offset) {
# 4180|-> 		__archive_read_seek(a, rsrc->local_header_offset, SEEK_SET);
# 4181|   	}
# 4182|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4184:9: warning[-Wanalyzer-malloc-leak]: leak of 'metadata'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4184:9: throw: if '__archive_read_consume' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4184:9: danger: 'metadata' leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 4182|   
# 4183|   	hsize = zip_get_local_file_header_size(a, 0);
# 4184|-> 	__archive_read_consume(a, hsize);
# 4185|   
# 4186|   	remaining_bytes = (size_t)rsrc->compressed_size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def147]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4195:21: warning[-Wanalyzer-malloc-leak]: leak of 'mp'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4190:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4195:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4195:21: throw: if '__archive_read_ahead' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4195:21: danger: 'mp' leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
# 4193|   		size_t bytes_used;
# 4194|   
# 4195|-> 		p = __archive_read_ahead(a, 1, &bytes_avail);
# 4196|   		if (p == NULL) {
# 4197|   			archive_set_error(&a->archive,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def148]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4261:17: warning[-Wanalyzer-malloc-leak]: leak of 'mp'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4157:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4163:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4170:20: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4171:12: branch_false: following 'false' branch (when 'metadata' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4177:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4190:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4195:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4196:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4203:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4203:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4204:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4261:17: throw: if '__archive_read_consume' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4261:17: danger: 'mp' leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
# 4259|   			break;
# 4260|   		}
# 4261|-> 		__archive_read_consume(a, bytes_used);
# 4262|   		remaining_bytes -= bytes_used;
# 4263|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def149]
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4394:13: warning[-Wanalyzer-malloc-leak]: leak of 'zip'
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4372:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4375:15: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4375:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4376:12: branch_false: following 'false' branch (when 'zip' is non-NULL)...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4391:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4394:13: throw: if '__archive_read_register_format' throws an exception...
libarchive-3.8.4/libarchive/archive_read_support_format_zip.c:4394:13: danger: 'zip' leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
# 4392|   	zip->crc32func = real_crc32;
# 4393|   
# 4394|-> 	r = __archive_read_register_format(a,
# 4395|   	    zip,
# 4396|   	    "zip",

Error: GCC_ANALYZER_WARNING (CWE-465): [#def150]
libarchive-3.8.4/libarchive/archive_string.c:227:12: warning[-Wanalyzer-deref-before-check]: check of 'as' for NULL after already dereferencing it
libarchive-3.8.4/libarchive/archive_string.c:2289:1: enter_function: entry to 'best_effort_strncat_in_locale'
libarchive-3.8.4/libarchive/archive_string.c:2315:16: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_string.c:2316:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_string.c:2318:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:2318:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_string.c:2319:37: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:2319:37: call_function: calling 'archive_string_append' from 'best_effort_strncat_in_locale'
#  225|   archive_string_append(struct archive_string *as, const char *p, size_t s)
#  226|   {
#  227|-> 	if (archive_string_ensure(as, as->length + s + 1) == NULL)
#  228|   		return (NULL);
#  229|   	if (s)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def151]
libarchive-3.8.4/libarchive/archive_string.c:1187:13: warning[-Wanalyzer-malloc-leak]: leak of 'create_sconv_object(canonical_charset_name(fc), canonical_charset_name(tc), current_codepage,  flag)'
libarchive-3.8.4/libarchive/archive_string.c:1683:1: enter_function: entry to 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: call_function: calling 'create_sconv_object' from 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: return_function: returning to 'get_sconv_object' from 'create_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1700:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_string.c:1712:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1712:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_string.c:1713:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1713:20: branch_true: following 'true' branch (when 'a' is non-NULL)...
libarchive-3.8.4/libarchive/archive_string.c:1717:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1715:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_string.c:1187:13: danger: 'create_sconv_object(canonical_charset_name(fc), canonical_charset_name(tc), current_codepage,  flag)' leaks here; was allocated at [(4)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/3)
# 1185|   	archive_string_init(&sc->utftmp);
# 1186|   
# 1187|-> 	if (flag & SCONV_TO_CHARSET) {
# 1188|   		/*
# 1189|   		 * Convert characters from the current locale charset to

Error: GCC_ANALYZER_WARNING (CWE-401): [#def152]
libarchive-3.8.4/libarchive/archive_string.c:1305:26: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_string.c:1683:1: enter_function: entry to 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: call_function: calling 'create_sconv_object' from 'get_sconv_object'
# 1303|   		sc->cd = (iconv_t)-1;
# 1304|   	} else {
# 1305|-> 		sc->cd = iconv_open(tc, fc);
# 1306|   		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
# 1307|   			/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def153]
libarchive-3.8.4/libarchive/archive_string.c:1305:26: warning[-Wanalyzer-malloc-leak]: leak of 'sc'
libarchive-3.8.4/libarchive/archive_string.c:1683:1: enter_function: entry to 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: call_function: calling 'create_sconv_object' from 'get_sconv_object'
# 1303|   		sc->cd = (iconv_t)-1;
# 1304|   	} else {
# 1305|-> 		sc->cd = iconv_open(tc, fc);
# 1306|   		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
# 1307|   			/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def154]
libarchive-3.8.4/libarchive/archive_string.c:1715:25: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_string.c:1683:1: enter_function: entry to 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: call_function: calling 'create_sconv_object' from 'get_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1698:14: return_function: returning to 'get_sconv_object' from 'create_sconv_object'
libarchive-3.8.4/libarchive/archive_string.c:1700:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_string.c:1712:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1712:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_string.c:1713:20: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1713:20: branch_true: following 'true' branch (when 'a' is non-NULL)...
libarchive-3.8.4/libarchive/archive_string.c:1717:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_string.c:1715:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_string.c:1715:25: danger: '<unknown>' leaks here; was allocated at [(6)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/5)
# 1713|   		if (a != NULL) {
# 1714|   #if HAVE_ICONV
# 1715|-> 			archive_set_error(a, ARCHIVE_ERRNO_MISC,
# 1716|   			    "iconv_open failed : Cannot handle ``%s''",
# 1717|   			    (flag & SCONV_TO_CHARSET)?tc:fc);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def155]
libarchive-3.8.4/libarchive/archive_util.c:191:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libarchive-3.8.4/libarchive/archive_util.c:184:12: branch_false: following 'false' branch (when 'fmt' is non-NULL)...
libarchive-3.8.4/libarchive/archive_util.c:189:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_util.c:190:9: acquire_resource: 'va_start' called here
libarchive-3.8.4/libarchive/archive_util.c:191:9: throw: if 'archive_string_vsprintf' throws an exception...
libarchive-3.8.4/libarchive/archive_util.c:191:9: danger: missing call to 'va_end' to match 'va_start' at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  189|   	archive_string_empty(&(a->error_string));
#  190|   	va_start(ap, fmt);
#  191|-> 	archive_string_vsprintf(&(a->error_string), fmt, ap);
#  192|   	va_end(ap);
#  193|   	a->error = a->error_string.s;

Error: CPPCHECK_WARNING (CWE-457): [#def156]
libarchive-3.8.4/libarchive/archive_util.c:461: error[uninitvar]: Uninitialized variable: rgid
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: GCC_ANALYZER_WARNING (CWE-457): [#def157]
libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'rgid'
libarchive-3.8.4/libarchive/archive_util.c:455:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:457:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_util.c:457:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:459:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_util.c:461:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_util.c:461:12: danger: use of uninitialized value 'rgid' here
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: COMPILER_WARNING (CWE-457): [#def158]
libarchive-3.8.4/libarchive/archive_util.c:461:12: warning[-Wmaybe-uninitialized]: 'rgid' may be used uninitialized
#  461 |         if (rgid != egid || rgid != sgid)
#      |            ^
libarchive-3.8.4/libarchive/archive_util.c: scope_hint: In function '__archive_get_tempdir'
libarchive-3.8.4/libarchive/archive_util.c:454:15: note: 'rgid' was declared here
#  454 |         gid_t rgid, egid, sgid;
#      |               ^~~~
#  459|   	if (getresgid(&ruid, &egid, &sgid) != 0)
#  460|   		return (-1);
#  461|-> 	if (rgid != egid || rgid != sgid)
#  462|   		return (1);
#  463|   #elif HAVE_GETEUID

Error: GCC_ANALYZER_WARNING (CWE-401): [#def159]
libarchive-3.8.4/libarchive/archive_write.c:123:16: warning[-Wanalyzer-malloc-leak]: leak of 'a'
libarchive-3.8.4/libarchive/archive_write.c:101:13: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write.c:102:12: branch_false: following 'false' branch (when 'a' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write.c:104:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write.c:118:12: branch_false: following 'false' branch (when 'nulls' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write.c:122:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write.c:123:16: danger: 'a' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  121|   	}
#  122|   	a->nulls = nulls;
#  123|-> 	return (&a->archive);
#  124|   }
#  125|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def160]
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:94:9: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:85:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:88:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:88:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:89:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:94:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:94:9: throw: if 'archive_strncat' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_b64encode.c:94:9: danger: 'state' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   92|   		return (ARCHIVE_FATAL);
#   93|   	}
#   94|-> 	archive_strcpy(&state->name, "-");
#   95|   	state->mode = 0644;
#   96|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def161]
libarchive-3.8.4/libarchive/archive_write_add_filter_bzip2.c:181:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)'
libarchive-3.8.4/libarchive/archive_write_add_filter_bzip2.c:168:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_bzip2.c:170:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_bzip2.c:180:36: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_bzip2.c:181:20: danger: 'malloc(bs)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  179|   		data->compressed_buffer_size = bs;
#  180|   		data->compressed = malloc(data->compressed_buffer_size);
#  181|-> 		if (data->compressed == NULL) {
#  182|   			archive_set_error(f->archive, ENOMEM,
#  183|   			    "Can't allocate data for compression buffer");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def162]
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:163:23: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:153:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:154:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:160:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:160:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:163:23: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:163:23: throw: if 'archive_write_get_bytes_per_block' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:163:23: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  161|   		/* Buffer size should be a multiple number of the bytes
#  162|   		 * per block for performance. */
#  163|-> 		bpb = archive_write_get_bytes_per_block(f->archive);
#  164|   		if (bpb > bs)
#  165|   			bs = bpb;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def163]
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:173:17: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:153:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:154:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:160:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:172:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:173:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:173:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_compress.c:173:17: danger: 'state' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  171|   
#  172|   	if (state->compressed == NULL) {
#  173|-> 		archive_set_error(f->archive, ENOMEM,
#  174|   		    "Can't allocate data for compression buffer");
#  175|   		free(state);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def164]
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:64:23: warning[-Wanalyzer-malloc-leak]: leak of 'data'
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:56:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:59:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:59:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:60:12: branch_false: following 'false' branch (when 'data' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:64:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:64:23: throw: if '__archive_write_program_allocate' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_grzip.c:64:23: danger: 'data' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   62|   		return (ARCHIVE_FATAL);
#   63|   	}
#   64|-> 	data->pdata = __archive_write_program_allocate("grzip");
#   65|   	if (data->pdata == NULL) {
#   66|   		free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def165]
libarchive-3.8.4/libarchive/archive_write_add_filter_gzip.c:210:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)'
libarchive-3.8.4/libarchive/archive_write_add_filter_gzip.c:197:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_gzip.c:199:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_gzip.c:209:36: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_gzip.c:210:20: danger: 'malloc(bs)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  208|   		data->compressed_buffer_size = bs;
#  209|   		data->compressed = malloc(data->compressed_buffer_size);
#  210|-> 		if (data->compressed == NULL) {
#  211|   			archive_set_error(f->archive, ENOMEM,
#  212|   			    "Can't allocate data for compression buffer");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def166]
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:70:23: warning[-Wanalyzer-malloc-leak]: leak of 'data'
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:62:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:65:16: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:65:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:66:12: branch_false: following 'false' branch (when 'data' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:70:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:70:23: throw: if '__archive_write_program_allocate' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_lrzip.c:70:23: danger: 'data' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   68|   		return (ARCHIVE_FATAL);
#   69|   	}
#   70|-> 	data->pdata = __archive_write_program_allocate("lrzip");
#   71|   	if (data->pdata == NULL) {
#   72|   		free(data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def167]
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:83:9: warning[-Wanalyzer-malloc-leak]: leak of 'state'
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:74:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:77:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:77:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:78:12: branch_false: following 'false' branch (when 'state' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:83:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:83:9: throw: if 'archive_strncat' throws an exception...
libarchive-3.8.4/libarchive/archive_write_add_filter_uuencode.c:83:9: danger: 'state' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   81|   		return (ARCHIVE_FATAL);
#   82|   	}
#   83|-> 	archive_strcpy(&state->name, "-");
#   84|   	state->mode = 0644;
#   85|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def168]
libarchive-3.8.4/libarchive/archive_write_add_filter_xz.c:323:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)'
libarchive-3.8.4/libarchive/archive_write_add_filter_xz.c:310:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_xz.c:312:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_xz.c:322:36: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_xz.c:323:20: danger: 'malloc(bs)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  321|   		data->compressed_buffer_size = bs;
#  322|   		data->compressed = malloc(data->compressed_buffer_size);
#  323|-> 		if (data->compressed == NULL) {
#  324|   			archive_set_error(f->archive, ENOMEM,
#  325|   			    "Can't allocate data for compression buffer");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def169]
libarchive-3.8.4/libarchive/archive_write_add_filter_zstd.c:376:20: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(bs)'
libarchive-3.8.4/libarchive/archive_write_add_filter_zstd.c:362:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_add_filter_zstd.c:363:29: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_add_filter_zstd.c:375:33: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_add_filter_zstd.c:376:20: danger: 'malloc(bs)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  374|   		data->out.pos = 0;
#  375|   		data->out.dst = malloc(data->out.size);
#  376|-> 		if (data->out.dst == NULL) {
#  377|   			archive_set_error(f->archive, ENOMEM,
#  378|   			    "Can't allocate data for compression buffer");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def170]
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4071:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open(name, 657408)'
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4068:12: branch_true: following 'true' branch (when 'fd < 0')...
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4069:24: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4069:24: acquire_resource: opened here
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4071:17: throw: if '__archive_ensure_cloexec_flag' throws an exception...
libarchive-3.8.4/libarchive/archive_write_disk_posix.c:4071:17: danger: 'open(name, 657408)' leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 4069|   		myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY |
# 4070|   		    O_CLOEXEC | O_NOFOLLOW);
# 4071|-> 		__archive_ensure_cloexec_flag(myfd);
# 4072|   	}
# 4073|   	if (myfd < 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def171]
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:132:29: warning[-Wanalyzer-malloc-leak]: leak of 'buffer'
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:133:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:135:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:135:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:137:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:139:37: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:140:28: branch_false: following 'false' branch (when 'allocated' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:140:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:132:29: throw: if 'getgrnam_r' throws an exception...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:132:29: danger: 'buffer' leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  130|   		for (;;) {
#  131|   			result = &grent; /* Old getgrnam_r ignores last arg. */
#  132|-> 			r = getgrnam_r(gname, &grent, buffer, bufsize, &result);
#  133|   			if (r == 0)
#  134|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def172]
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:201:29: warning[-Wanalyzer-malloc-leak]: leak of 'buffer'
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:202:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:204:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:204:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:206:25: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:208:37: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:209:28: branch_false: following 'false' branch (when 'allocated' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:209:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:201:29: throw: if 'getpwnam_r' throws an exception...
libarchive-3.8.4/libarchive/archive_write_disk_set_standard_lookup.c:201:29: danger: 'buffer' leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  199|   		for (;;) {
#  200|   			result = &pwent; /* Old getpwnam_r ignores last arg. */
#  201|-> 			r = getpwnam_r(uname, &pwent, buffer, bufsize, &result);
#  202|   			if (r == 0)
#  203|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def173]
libarchive-3.8.4/libarchive/archive_write_open_fd.c:74:16: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_write_open_fd.c:65:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_open_fd.c:66:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_open_fd.c:70:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_fd.c:74:16: throw: if 'archive_write_open2' throws an exception...
libarchive-3.8.4/libarchive/archive_write_open_fd.c:74:16: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   72|   	setmode(mine->fd, O_BINARY);
#   73|   #endif
#   74|-> 	return (archive_write_open2(a, mine,
#   75|   		    file_open, file_write, NULL, file_free));
#   76|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def174]
libarchive-3.8.4/libarchive/archive_write_open_file.c:68:16: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_write_open_file.c:62:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_open_file.c:63:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_open_file.c:67:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_file.c:68:16: throw: if 'archive_write_open2' throws an exception...
libarchive-3.8.4/libarchive/archive_write_open_file.c:68:16: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   66|   	}
#   67|   	mine->f = f;
#   68|-> 	return (archive_write_open2(a, mine, file_open, file_write,
#   69|   	    NULL, file_free));
#   70|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def175]
libarchive-3.8.4/libarchive/archive_write_open_filename.c:107:21: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_write_open_filename.c:101:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:102:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:106:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:106:12: branch_true: following 'true' branch (when 'mbs_fn != 0')...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:107:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:107:21: throw: if 'archive_mstring_copy_mbs' throws an exception...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:107:21: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  105|   	}
#  106|   	if (mbs_fn)
#  107|-> 		r = archive_mstring_copy_mbs(&mine->filename, filename);
#  108|   	else
#  109|   		r = archive_mstring_copy_wcs(&mine->filename, filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def176]
libarchive-3.8.4/libarchive/archive_write_open_filename.c:109:21: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_write_open_filename.c:101:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:102:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:106:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:106:12: branch_false: following 'false' branch (when 'mbs_fn == 0')...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:109:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_filename.c:109:21: throw: if 'archive_mstring_copy_wcs' throws an exception...
libarchive-3.8.4/libarchive/archive_write_open_filename.c:109:21: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  107|   		r = archive_mstring_copy_mbs(&mine->filename, filename);
#  108|   	else
#  109|-> 		r = archive_mstring_copy_wcs(&mine->filename, filename);
#  110|   	if (r < 0) {
#  111|   		free(mine);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def177]
libarchive-3.8.4/libarchive/archive_write_open_memory.c:63:16: warning[-Wanalyzer-malloc-leak]: leak of 'mine'
libarchive-3.8.4/libarchive/archive_write_open_memory.c:55:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_open_memory.c:56:12: branch_false: following 'false' branch (when 'mine' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_open_memory.c:60:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_open_memory.c:63:16: throw: if 'archive_write_open2' throws an exception...
libarchive-3.8.4/libarchive/archive_write_open_memory.c:63:16: danger: 'mine' leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   61|   	mine->size = buffSize;
#   62|   	mine->client_size = used;
#   63|-> 	return (archive_write_open2(a, mine,
#   64|   		    memory_write_open, memory_write, NULL, memory_write_free));
#   65|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def178]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:367:9: warning[-Wanalyzer-malloc-leak]: leak of 'zip'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:353:9: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:357:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:360:15: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:361:12: branch_false: following 'false' branch (when 'zip' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:366:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:367:9: throw: if '__archive_rb_tree_init' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:367:9: danger: 'zip' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  365|   	}
#  366|   	zip->temp_fd = -1;
#  367|-> 	__archive_rb_tree_init(&(zip->rbtree), &rb_ops);
#  368|   	file_init_register(zip);
#  369|   	file_init_register_empty(zip);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def179]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: throw: if '_archive_entry_pathname_l' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1647|   	}
# 1648|   
# 1649|-> 	if (0 > archive_entry_pathname_l(entry, &u16, &u16len, zip->sconv)) {
# 1650|   		if (errno == ENOMEM) {
# 1651|   			free(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def180]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1656:17: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1650:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1650:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1656:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1656:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1656:17: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1654|   			return (ARCHIVE_FATAL);
# 1655|   		}
# 1656|-> 		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
# 1657|   		    "A filename cannot be converted to UTF-16LE;"
# 1658|   		    "You should disable making Joliet extension");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def181]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1672:22: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1672:22: throw: if 'archive_entry_mode' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1672:22: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1670|   	file->utf16name[u16len+1] = 0;
# 1671|   	file->name_len = (unsigned)u16len;
# 1672|-> 	file->mode = archive_entry_mode(entry);
# 1673|   	if (archive_entry_filetype(entry) == AE_IFREG)
# 1674|   		file->size = archive_entry_size(entry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:13: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:13: throw: if 'archive_entry_filetype' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:13: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 1671|   	file->name_len = (unsigned)u16len;
# 1672|   	file->mode = archive_entry_mode(entry);
# 1673|-> 	if (archive_entry_filetype(entry) == AE_IFREG)
# 1674|   		file->size = archive_entry_size(entry);
# 1675|   	else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1674:30: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1674:30: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1674:30: throw: if 'archive_entry_size' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1674:30: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 1672|   	file->mode = archive_entry_mode(entry);
# 1673|   	if (archive_entry_filetype(entry) == AE_IFREG)
# 1674|-> 		file->size = archive_entry_size(entry);
# 1675|   	else
# 1676|   		archive_entry_set_size(entry, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def184]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1676:17: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1676:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1676:17: throw: if 'archive_entry_set_size' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1676:17: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1674|   		file->size = archive_entry_size(entry);
# 1675|   	else
# 1676|-> 		archive_entry_set_size(entry, 0);
# 1677|   	if (archive_entry_filetype(entry) == AE_IFDIR)
# 1678|   		file->dir = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def185]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:13: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1673:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1676:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:13: throw: if 'archive_entry_filetype' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:13: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
# 1675|   	else
# 1676|   		archive_entry_set_size(entry, 0);
# 1677|-> 	if (archive_entry_filetype(entry) == AE_IFDIR)
# 1678|   		file->dir = 1;
# 1679|   	else if (archive_entry_filetype(entry) == AE_IFLNK) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def186]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:18: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:18: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:18: throw: if 'archive_entry_filetype' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:18: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
# 1677|   	if (archive_entry_filetype(entry) == AE_IFDIR)
# 1678|   		file->dir = 1;
# 1679|-> 	else if (archive_entry_filetype(entry) == AE_IFLNK) {
# 1680|   		const char* linkpath;
# 1681|   		linkpath = archive_entry_symlink_utf8(entry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def187]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1681:28: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:18: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1679:17: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1681:28: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1681:28: throw: if 'archive_entry_symlink_utf8' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1681:28: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
# 1679|   	else if (archive_entry_filetype(entry) == AE_IFLNK) {
# 1680|   		const char* linkpath;
# 1681|-> 		linkpath = archive_entry_symlink_utf8(entry);
# 1682|   		if (linkpath == NULL) {
# 1683|   			free(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def188]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:13: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1677:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1678:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:13: throw: if 'archive_entry_mtime_is_set' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:13: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
# 1689|   			file->size = strlen(linkpath);
# 1690|   	}
# 1691|-> 	if (archive_entry_mtime_is_set(entry)) {
# 1692|   		file->flg |= MTIME_IS_SET;
# 1693|   		file->times[MTIME].time = archive_entry_mtime(entry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def189]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1693:43: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1692:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1693:43: throw: if 'archive_entry_mtime' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1693:43: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
# 1691|   	if (archive_entry_mtime_is_set(entry)) {
# 1692|   		file->flg |= MTIME_IS_SET;
# 1693|-> 		file->times[MTIME].time = archive_entry_mtime(entry);
# 1694|   		file->times[MTIME].time_ns = archive_entry_mtime_nsec(entry);
# 1695|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def190]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1694:46: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1692:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1694:46: throw: if 'archive_entry_mtime_nsec' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1694:46: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 1692|   		file->flg |= MTIME_IS_SET;
# 1693|   		file->times[MTIME].time = archive_entry_mtime(entry);
# 1694|-> 		file->times[MTIME].time_ns = archive_entry_mtime_nsec(entry);
# 1695|   	}
# 1696|   	if (archive_entry_atime_is_set(entry)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: throw: if 'archive_entry_atime_is_set' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
# 1694|   		file->times[MTIME].time_ns = archive_entry_mtime_nsec(entry);
# 1695|   	}
# 1696|-> 	if (archive_entry_atime_is_set(entry)) {
# 1697|   		file->flg |= ATIME_IS_SET;
# 1698|   		file->times[ATIME].time = archive_entry_atime(entry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1698:43: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1697:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1698:43: throw: if 'archive_entry_atime' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1698:43: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 1696|   	if (archive_entry_atime_is_set(entry)) {
# 1697|   		file->flg |= ATIME_IS_SET;
# 1698|-> 		file->times[ATIME].time = archive_entry_atime(entry);
# 1699|   		file->times[ATIME].time_ns = archive_entry_atime_nsec(entry);
# 1700|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def193]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1699:46: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1691:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1697:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1699:46: throw: if 'archive_entry_atime_nsec' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1699:46: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1697|   		file->flg |= ATIME_IS_SET;
# 1698|   		file->times[ATIME].time = archive_entry_atime(entry);
# 1699|-> 		file->times[ATIME].time_ns = archive_entry_atime_nsec(entry);
# 1700|   	}
# 1701|   	if (archive_entry_ctime_is_set(entry)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def194]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: throw: if 'archive_entry_ctime_is_set' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 1699|   		file->times[ATIME].time_ns = archive_entry_atime_nsec(entry);
# 1700|   	}
# 1701|-> 	if (archive_entry_ctime_is_set(entry)) {
# 1702|   		file->flg |= CTIME_IS_SET;
# 1703|   		file->times[CTIME].time = archive_entry_ctime(entry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def195]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1703:43: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1702:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1703:43: throw: if 'archive_entry_ctime' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1703:43: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 1701|   	if (archive_entry_ctime_is_set(entry)) {
# 1702|   		file->flg |= CTIME_IS_SET;
# 1703|-> 		file->times[CTIME].time = archive_entry_ctime(entry);
# 1704|   		file->times[CTIME].time_ns = archive_entry_ctime_nsec(entry);
# 1705|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def196]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1704:46: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1642:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1643:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1649:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1662:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1668:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1696:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1701:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1702:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1704:46: throw: if 'archive_entry_ctime_nsec' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1704:46: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/0)
# 1702|   		file->flg |= CTIME_IS_SET;
# 1703|   		file->times[CTIME].time = archive_entry_ctime(entry);
# 1704|-> 		file->times[CTIME].time_ns = archive_entry_ctime_nsec(entry);
# 1705|   	}
# 1706|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def197]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1967:13: warning[-Wanalyzer-malloc-leak]: leak of 'strm'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1950:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1951:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1959:58: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1967:13: throw: if 'BZ2_bzCompressInit' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:1967:13: danger: 'strm' leaks here; was allocated at [(1)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/0)
# 1965|   	strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
# 1966|   	strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
# 1967|-> 	if (BZ2_bzCompressInit(strm, level, 0, 30) != BZ_OK) {
# 1968|   		free(strm);
# 1969|   		lastrm->real_stream = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def198]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: danger: '<unknown>' leaks here; was allocated at [(3)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/2)
# 2308|   	props[0] = maxOrder;
# 2309|   	archive_le32enc(props+1, msize);
# 2310|-> 	__archive_ppmd7_functions.Ppmd7_Construct(&strm->ppmd7_context);
# 2311|   	r = __archive_ppmd7_functions.Ppmd7_Alloc(
# 2312|   		&strm->ppmd7_context, msize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def199]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: warning[-Wanalyzer-malloc-leak]: leak of 'props'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2300:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: danger: 'props' leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
# 2308|   	props[0] = maxOrder;
# 2309|   	archive_le32enc(props+1, msize);
# 2310|-> 	__archive_ppmd7_functions.Ppmd7_Construct(&strm->ppmd7_context);
# 2311|   	r = __archive_ppmd7_functions.Ppmd7_Alloc(
# 2312|   		&strm->ppmd7_context, msize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def200]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: warning[-Wanalyzer-malloc-leak]: leak of 'strm'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2284:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2310:9: danger: 'strm' leaks here; was allocated at [(1)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/0)
# 2308|   	props[0] = maxOrder;
# 2309|   	archive_le32enc(props+1, msize);
# 2310|-> 	__archive_ppmd7_functions.Ppmd7_Construct(&strm->ppmd7_context);
# 2311|   	r = __archive_ppmd7_functions.Ppmd7_Alloc(
# 2312|   		&strm->ppmd7_context, msize);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def201]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2311:13: warning[-Wanalyzer-malloc-leak]: leak of 'props'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2300:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2311:13: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2311:13: danger: 'props' leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
# 2309|   	archive_le32enc(props+1, msize);
# 2310|   	__archive_ppmd7_functions.Ppmd7_Construct(&strm->ppmd7_context);
# 2311|-> 	r = __archive_ppmd7_functions.Ppmd7_Alloc(
# 2312|   		&strm->ppmd7_context, msize);
# 2313|   	if (r == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def202]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2321:9: warning[-Wanalyzer-malloc-leak]: leak of 'props'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2300:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2313:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2321:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2321:9: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2321:9: danger: 'props' leaks here; was allocated at [(5)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/4)
# 2319|   		return (ARCHIVE_FATAL);
# 2320|   	}
# 2321|-> 	__archive_ppmd7_functions.Ppmd7_Init(&(strm->ppmd7_context), maxOrder);
# 2322|   	strm->byteout.a = (struct archive_write *)a;
# 2323|   	strm->byteout.Write = ppmd_write;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def203]
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2325:9: warning[-Wanalyzer-malloc-leak]: leak of 'props'
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2285:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2290:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2291:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2297:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2300:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2301:12: branch_false: following 'false' branch (when 'props' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2308:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2313:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2321:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2325:9: throw: if the called function throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_7zip.c:2325:9: danger: 'props' leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
# 2323|   	strm->byteout.Write = ppmd_write;
# 2324|   	strm->range_enc.Stream = &(strm->byteout);
# 2325|-> 	__archive_ppmd7_functions.Ppmd7z_RangeEnc_Init(&(strm->range_enc));
# 2326|   	strm->stat = 0;
# 2327|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def204]
libarchive-3.8.4/libarchive/archive_write_set_format_cpio_binary.c:306:9: warning[-Wanalyzer-malloc-leak]: leak of 'newlist'
libarchive-3.8.4/libarchive/archive_write_set_format_cpio_binary.c:379:1: enter_function: entry to 'write_header'
libarchive-3.8.4/libarchive/archive_write_set_format_cpio_binary.c:431:15: call_function: calling 'synthesize_ino_value' from 'write_header'
#  304|   
#  305|   	/* Assign a new index number. */
#  306|-> 	ino_new = (int)(++cpio->ino_next);
#  307|   
#  308|   	/* Ensure space for the new mapping. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def205]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:1653:27: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_false: following 'false' branch (when 'remaining == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_true: following 'true' branch (when 'ret == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8106:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8113:21: call_function: calling 'wb_write_padding_to_temp' from 'zisofs_rewind_boot_file'
# 1651|   	b = (const unsigned char *)buff;
# 1652|   	while (s) {
# 1653|-> 		written = write(iso9660->temp_fd, b, s);
# 1654|   		if (written < 0) {
# 1655|   			archive_set_error(&a->archive, errno,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def206]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:1655:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_false: following 'false' branch (when 'remaining == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_true: following 'true' branch (when 'ret == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8106:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8113:21: call_function: calling 'wb_write_padding_to_temp' from 'zisofs_rewind_boot_file'
# 1653|   		written = write(iso9660->temp_fd, b, s);
# 1654|   		if (written < 0) {
# 1655|-> 			archive_set_error(&a->archive, errno,
# 1656|   			    "Can't write to temporary file");
# 1657|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def207]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:3635:21: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_false: following 'false' branch (when 'remaining == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_true: following 'true' branch (when 'ret == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8106:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8113:21: call_function: calling 'wb_write_padding_to_temp' from 'zisofs_rewind_boot_file'
# 3633|   	nw = wsize % LOGICAL_BLOCK_SIZE;
# 3634|   	if (iso9660->wbuff_type == WB_TO_STREAM)
# 3635|-> 		r = __archive_write_output(a, iso9660->wbuff, wsize - nw);
# 3636|   	else
# 3637|   		r = write_to_temp(a, iso9660->wbuff, wsize - nw);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:3657:17: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_false: following 'false' branch (when 'remaining == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_true: following 'true' branch (when 'ret == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8106:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8113:21: call_function: calling 'wb_write_padding_to_temp' from 'zisofs_rewind_boot_file'
# 3655|   	if (size > iso9660->wbuff_remaining ||
# 3656|   	    iso9660->wbuff_remaining == 0) {
# 3657|-> 		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
# 3658|   		    "Internal Programming error: iso9660:wb_consume()"
# 3659|   		    " size=%jd, wbuff_remaining=%jd",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def209]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:4639:31: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7114:1: enter_function: entry to 'isoent_create_boot_catalog'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7125:16: call_function: calling 'isofile_new' from 'isoent_create_boot_catalog'
# 4637|   		file->entry = archive_entry_clone(entry);
# 4638|   	else
# 4639|-> 		file->entry = archive_entry_new2(&a->archive);
# 4640|   	if (file->entry == NULL) {
# 4641|   		free(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def210]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:4639:31: warning[-Wanalyzer-malloc-leak]: leak of 'isofile_new(a, 0)'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7114:1: enter_function: entry to 'isoent_create_boot_catalog'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7125:16: call_function: calling 'isofile_new' from 'isoent_create_boot_catalog'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7125:16: return_function: returning to 'isoent_create_boot_catalog' from 'isofile_new'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7126:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7132:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7131:9: throw: if 'archive_entry_set_pathname' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:4639:31: danger: 'isofile_new(a, 0)' leaks here; was allocated at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3)
# 4637|   		file->entry = archive_entry_clone(entry);
# 4638|   	else
# 4639|-> 		file->entry = archive_entry_new2(&a->archive);
# 4640|   	if (file->entry == NULL) {
# 4641|   		free(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def211]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5121:9: warning[-Wanalyzer-malloc-leak]: leak of 'isoent'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6665:1: enter_function: entry to 'isoent_rr_move_dir'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6671:12: branch_false: following 'false' branch (when 'rrmoved' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6695:17: call_function: inlined call to 'isoent_clone' from 'isoent_rr_move_dir'
# 5119|   	isoent->children.first = NULL;
# 5120|   	isoent->children.last = &(isoent->children.first);
# 5121|-> 	__archive_rb_tree_init(&(isoent->rbtree), &rb_ops);
# 5122|   	isoent->subdirs.first = NULL;
# 5123|   	isoent->subdirs.last = &(isoent->subdirs.first);

Error: COMPILER_WARNING (CWE-704): [#def212]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 5532 |         p = strchr(fn, '/');
#      |           ^
# 5530|   	size_t l;
# 5531|   
# 5532|-> 	p = strchr(fn, '/');
# 5533|   	if (p == NULL) {
# 5534|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704): [#def213]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5532:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 5530|   	size_t l;
# 5531|   
# 5532|-> 	p = strchr(fn, '/');
# 5533|   	if (p == NULL) {
# 5534|   		if ((l = strlen(fn)) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def214]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:5870:9: warning[-Wanalyzer-malloc-leak]: leak of 'idr.idrent_pool'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6555:1: enter_function: entry to 'isoent_traverse_tree'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6564:9: call_function: calling 'idr_init' from 'isoent_traverse_tree'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6564:9: return_function: returning to 'isoent_traverse_tree' from 'idr_init'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6567:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6567:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6589:37: call_function: calling 'isoent_gen_iso9660_identifier' from 'isoent_traverse_tree'
# 5868|   	if (r != ARCHIVE_OK)
# 5869|   		return (r);
# 5870|-> 	__archive_rb_tree_init(&(idr->rbtree), rbt_ops);
# 5871|   	idr->wait_list.first = NULL;
# 5872|   	idr->wait_list.last = &(idr->wait_list.first);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def215]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6802:17: warning[-Wanalyzer-null-dereference]: dereference of NULL '0'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:6995:1: enter_function: entry to 'isoent_make_path_table'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7006:21: call_function: calling 'isoent_alloc_path_table' from 'isoent_make_path_table'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7006:21: return_function: returning to 'isoent_make_path_table' from 'isoent_alloc_path_table'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7013:12: branch_false: following 'false' branch (when 'r == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7015:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7015:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7025:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7025:9: call_function: calling 'isoent_collect_dirs' from 'isoent_make_path_table'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7025:9: return_function: returning to 'isoent_make_path_table' from 'isoent_collect_dirs'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7031:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7032:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7032:21: call_function: calling 'isoent_rr_move' from 'isoent_make_path_table'
# 6800|   		 * its sub directory entries move to rr_move too.
# 6801|   		 */
# 6802|-> 		np = last->ptnext;
# 6803|   	}
# 6804|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def216]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7842:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7840|   		zisofs->block_pointers = malloc(alloc);
# 7841|   		if (zisofs->block_pointers == NULL) {
# 7842|-> 			archive_set_error(&a->archive, ENOMEM,
# 7843|   			    "No memory for zisofs decompression");
# 7844|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def217]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7858:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7856|   		int err = 0;
# 7857|   		if (avail < 16) {
# 7858|-> 			archive_set_error(&a->archive,
# 7859|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7860|   			    "Illegal zisofs file body");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def218]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7858:25: warning[-Wanalyzer-malloc-leak]: leak of 'zext.block_pointers'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7856|   		int err = 0;
# 7857|   		if (avail < 16) {
# 7858|-> 			archive_set_error(&a->archive,
# 7859|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7860|   			    "Illegal zisofs file body");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def219]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7871:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7869|   			err = 1;
# 7870|   		if (err) {
# 7871|-> 			archive_set_error(&a->archive,
# 7872|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7873|   			    "Illegal zisofs file body");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7871:25: warning[-Wanalyzer-malloc-leak]: leak of 'zext.block_pointers'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7869|   			err = 1;
# 7870|   		if (err) {
# 7871|-> 			archive_set_error(&a->archive,
# 7872|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7873|   			    "Illegal zisofs file body");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def221]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7936:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7934|   		if (zisofs->block_off + 4 >= zisofs->block_pointers_size) {
# 7935|   			/* There isn't a pair of offsets. */
# 7936|-> 			archive_set_error(&a->archive,
# 7937|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7938|   			    "Illegal zisofs block pointers");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def222]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7936:25: warning[-Wanalyzer-malloc-leak]: leak of 'zext.block_pointers'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7934|   		if (zisofs->block_off + 4 >= zisofs->block_pointers_size) {
# 7935|   			/* There isn't a pair of offsets. */
# 7936|-> 			archive_set_error(&a->archive,
# 7937|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7938|   			    "Illegal zisofs block pointers");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def223]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7944:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7942|   		    zisofs->block_pointers + zisofs->block_off);
# 7943|   		if (bst != zisofs->pz_offset + (bytes - avail)) {
# 7944|-> 			archive_set_error(&a->archive,
# 7945|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7946|   			    "Illegal zisofs block pointers(cannot seek)");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def224]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7944:25: warning[-Wanalyzer-malloc-leak]: leak of 'zext.block_pointers'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7942|   		    zisofs->block_pointers + zisofs->block_off);
# 7943|   		if (bst != zisofs->pz_offset + (bytes - avail)) {
# 7944|-> 			archive_set_error(&a->archive,
# 7945|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7946|   			    "Illegal zisofs block pointers(cannot seek)");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def225]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7952:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7950|   		    zisofs->block_pointers + zisofs->block_off + 4);
# 7951|   		if (bed < bst) {
# 7952|-> 			archive_set_error(&a->archive,
# 7953|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7954|   			    "Illegal zisofs block pointers");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def226]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7952:25: warning[-Wanalyzer-malloc-leak]: leak of 'zext.block_pointers'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7950|   		    zisofs->block_pointers + zisofs->block_off + 4);
# 7951|   		if (bed < bst) {
# 7952|-> 			archive_set_error(&a->archive,
# 7953|   			    ARCHIVE_ERRNO_FILE_FORMAT,
# 7954|   			    "Illegal zisofs block pointers");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def227]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:7966:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8028:1: enter_function: entry to 'zisofs_rewind_boot_file'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8088:27: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8094:21: call_function: calling 'zisofs_extract' from 'zisofs_rewind_boot_file'
# 7964|   			r = inflateInit(&zisofs->stream);
# 7965|   		if (r != Z_OK) {
# 7966|-> 			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
# 7967|   			    "Can't initialize zisofs decompression.");
# 7968|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8083:25: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_true: following 'true' branch (when 'remaining != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8073:32: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8082:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8083:56: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8083:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8083:25: danger: 'rbuff' leaks here; was allocated at [(3)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/2)
# 8081|   		rs = read(iso9660->temp_fd, rbuff, rsize);
# 8082|   		if (rs <= 0) {
# 8083|-> 			archive_set_error(&a->archive, errno,
# 8084|   			    "Can't read temporary file(%jd)", (intmax_t)rs);
# 8085|   			ret = ARCHIVE_FATAL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8108:17: warning[-Wanalyzer-malloc-leak]: leak of 'rbuff'
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8044:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8050:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8063:17: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: following 'false' branch (when 'rbuff' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8064:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8068:16: branch_false: following 'false' branch (when 'remaining == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8101:12: branch_true: following 'true' branch (when 'ret == 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8106:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8108:17: throw: if 'archive_entry_set_size' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_iso9660.c:8108:17: danger: 'rbuff' leaks here; was allocated at [(3)](sarif:/runs/0/results/49/codeFlows/0/threadFlows/0/locations/2)
# 8106|   		file->content.offset_of_temp = new_offset;
# 8107|   		file->content.size = file->zisofs.uncompressed_size;
# 8108|-> 		archive_entry_set_size(file->entry, file->content.size);
# 8109|   		/* Set to be no zisofs. */
# 8110|   		file->zisofs.header_size = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:1796:9: warning[-Wanalyzer-malloc-leak]: leak of 'me'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:1955:1: enter_function: entry to 'mtree_entry_create_virtual_dir'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:1963:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:1969:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:1973:13: call_function: calling 'mtree_entry_new' from 'mtree_entry_create_virtual_dir'
# 1794|   	int ret = ARCHIVE_OK;
# 1795|   
# 1796|-> 	archive_strcpy(&file->pathname, archive_entry_pathname(entry));
# 1797|   #if defined(_WIN32) || defined(__CYGWIN__)
# 1798|   	/*

Error: COMPILER_WARNING (CWE-704): [#def231]
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2047 |         p = strchr(fn, '/');
#      |           ^
# 2045|   	size_t l;
# 2046|   
# 2047|-> 	p = strchr(fn, '/');
# 2048|   	if (p == NULL) {
# 2049|   		if ((l = strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704): [#def232]
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2047:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2045|   	size_t l;
# 2046|   
# 2047|-> 	p = strchr(fn, '/');
# 2048|   	if (p == NULL) {
# 2049|   		if ((l = strlen(fn)) == 0)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def233]
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2234:23: warning[-Wanalyzer-null-dereference]: dereference of NULL 'dent'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2065:1: enter_function: entry to 'mtree_entry_tree_add'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2092:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2100:14: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2126:21: call_function: calling 'get_path_component' from 'mtree_entry_tree_add'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2126:21: return_function: returning to 'mtree_entry_tree_add' from 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2127:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2131:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2131:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2137:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2163:12: branch_true: following 'true' branch (when 'np' is NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2163:12: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2167:24: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2210:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2210:17: release_memory: 'dent' is NULL
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2212:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2219:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_mtree.c:2234:23: danger: dereference of NULL 'dent'
# 2232|   
# 2233|   		if (!__archive_rb_tree_insert_node(
# 2234|-> 		    &(dent->dir_info->rbtree),
# 2235|   		    (struct archive_rb_node *)file)) {
# 2236|   			np = (struct mtree_entry *)__archive_rb_tree_find_node(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def234]
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:770:25: warning[-Wanalyzer-malloc-leak]: leak of 'name'
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:618:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:628:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:646:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:648:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:759:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:763:47: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:767:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:768:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:770:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:770:25: throw: if 'archive_entry_free' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:770:25: danger: 'name' leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  768|   		if (name == NULL || extra == NULL) {
#  769|   			/* XXX error message */
#  770|-> 			archive_entry_free(extra);
#  771|   			free(name);
#  772|   			return (ARCHIVE_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def235]
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:789:17: warning[-Wanalyzer-malloc-leak]: leak of 'name'
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:618:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:628:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:646:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:648:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:759:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:763:47: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:767:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:768:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:774:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:777:24: branch_false: following 'false' branch (when 'bname' is NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:781:20: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:781:20: branch_true: following 'true' branch (when 'bname' is NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:782:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:789:17: throw: if 'archive_entry_copy_pathname' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_pax.c:789:17: danger: 'name' leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  787|   			memmove(bname, "._", 2);
#  788|   		}
#  789|-> 		archive_entry_copy_pathname(extra, name);
#  790|   		free(name);
#  791|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def236]
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:84:25: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:157:1: enter_function: entry to 'archive_write_shar_header'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:209:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:212:20: branch_false: following 'false' branch (when 'p' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:216:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:218:20: branch_true: following 'true' branch (when 'pp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:219:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:222:28: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:35: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:227:33: call_function: calling 'shar_quote' from 'archive_write_shar_header'
#   82|   	while (*str != '\0') {
#   83|   		if ((len = strcspn(str, meta)) != 0) {
#   84|-> 			archive_strncat(buf, str, len);
#   85|   			str += len;
#   86|   		} else if (*str == '\n') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def237]
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:88:33: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:157:1: enter_function: entry to 'archive_write_shar_header'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:209:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:212:20: branch_false: following 'false' branch (when 'p' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:216:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:218:20: branch_true: following 'true' branch (when 'pp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:219:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:222:28: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:35: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:227:33: call_function: calling 'shar_quote' from 'archive_write_shar_header'
#   86|   		} else if (*str == '\n') {
#   87|   			if (in_shell)
#   88|-> 				archive_strcat(buf, "\"\n\"");
#   89|   			else
#   90|   				archive_strcat(buf, "\\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def238]
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:93:25: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:157:1: enter_function: entry to 'archive_write_shar_header'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:209:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:212:20: branch_false: following 'false' branch (when 'p' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:216:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:218:20: branch_true: following 'true' branch (when 'pp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:219:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:222:28: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:35: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:227:33: call_function: calling 'shar_quote' from 'archive_write_shar_header'
#   91|   			++str;
#   92|   		} else {
#   93|-> 			archive_strappend_char(buf, '\\');
#   94|   			archive_strappend_char(buf, *str);
#   95|   			++str;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def239]
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:209:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:212:20: branch_false: following 'false' branch (when 'p' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:216:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:218:20: branch_true: following 'true' branch (when 'pp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:219:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:222:28: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:35: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: throw: if 'archive_strcat' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:226:33: danger: 'p' leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  224|   				free(p);
#  225|   			} else if (shar->last_dir == NULL) {
#  226|-> 				archive_strcat(&shar->work, "mkdir -p ");
#  227|   				shar_quote(&shar->work, p, 1);
#  228|   				archive_strcat(&shar->work,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def240]
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:239:33: warning[-Wanalyzer-malloc-leak]: leak of 'p'
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:209:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:211:21: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:212:20: branch_false: following 'false' branch (when 'p' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:216:22: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:218:20: branch_true: following 'true' branch (when 'pp' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:219:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:222:28: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:225:35: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:231:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:231:35: branch_false: following 'false' branch (when the strings are non-equal)...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:234:36: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:239:33: throw: if 'archive_strcat' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_shar.c:239:33: danger: 'p' leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  237|   				free(p);
#  238|   			} else {
#  239|-> 				archive_strcat(&shar->work, "mkdir -p ");
#  240|   				shar_quote(&shar->work, p, 1);
#  241|   				archive_strcat(&shar->work,

Error: COMPILER_WARNING (CWE-704): [#def241]
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c: scope_hint: In function '_popul_ehdr'
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  374 |                 char *chk = strchr(hdr.tgturi, ':');
#      |                             ^~~~~~
#  372|   		static const char _fil[] = "file://";
#  373|   		const char *u;
#  374|-> 		char *chk = strchr(hdr.tgturi, ':');
#  375|   
#  376|   		if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') {

Error: COMPILER_WARNING (CWE-704): [#def242]
libarchive-3.8.4/libarchive/archive_write_set_format_warc.c:374:29: warning[-Wdiscarded-qualifiers]: initialization discards 'const' qualifier from pointer target type
#  372|   		static const char _fil[] = "file://";
#  373|   		const char *u;
#  374|-> 		char *chk = strchr(hdr.tgturi, ':');
#  375|   
#  376|   		if (chk != NULL && chk[1U] == '/' && chk[2U] == '/') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def243]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:689:22: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3207:25: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3207:25: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3208:29: call_function: calling 'write_to_temp' from 'save_xattrs'
#  687|   	p = (const unsigned char *)buff;
#  688|   	while (s) {
#  689|-> 		ws = write(xar->temp_fd, p, s);
#  690|   		if (ws < 0) {
#  691|   			archive_set_error(&(a->archive), errno,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def244]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:691:25: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3206:25: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3207:25: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3207:25: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3208:29: call_function: calling 'write_to_temp' from 'save_xattrs'
#  689|   		ws = write(xar->temp_fd, p, s);
#  690|   		if (ws < 0) {
#  691|-> 			archive_set_error(&(a->archive), errno,
#  692|   			    "write function failed");
#  693|   			return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def245]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:886:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
#  884|   	r = xml_writer_start_element(writer, key);
#  885|   	if (r < 0) {
#  886|-> 		archive_set_error(&a->archive,
#  887|   		    ARCHIVE_ERRNO_MISC,
#  888|   		    "xml_writer_start_element() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def246]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:894:25: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
#  892|   		r = xml_writer_write_string(writer, value);
#  893|   		if (r < 0) {
#  894|-> 			archive_set_error(&a->archive,
#  895|   			    ARCHIVE_ERRNO_MISC,
#  896|   			    "xml_writer_write_string() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def247]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:902:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
#  900|   	r = xml_writer_end_element(writer);
#  901|   	if (r < 0) {
#  902|-> 		archive_set_error(&a->archive,
#  903|   		    ARCHIVE_ERRNO_MISC,
#  904|   		    "xml_writer_end_element() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def248]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:920:9: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:918:9: acquire_resource: 'va_start' called here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:920:9: throw: if 'archive_string_vsprintf' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:920:9: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  918|   	va_start(ap, fmt);
#  919|   	archive_string_empty(&xar->vstr);
#  920|-> 	archive_string_vsprintf(&xar->vstr, fmt, ap);
#  921|   	va_end(ap);
#  922|   	return (xmlwrite_string(a, writer, key, xar->vstr.s));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def249]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1607:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1607:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1607:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1607:17: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3)
# 1605|   	r = xml_writer_start_document(writer);
# 1606|   	if (r < 0) {
# 1607|-> 		archive_set_error(&a->archive,
# 1608|   		    ARCHIVE_ERRNO_MISC,
# 1609|   		    "xml_writer_start_document() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def250]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1618:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1618:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1618:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1618:17: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
# 1616|   	r = xml_writer_start_element(writer, "xar");
# 1617|   	if (r < 0) {
# 1618|-> 		archive_set_error(&a->archive,
# 1619|   		    ARCHIVE_ERRNO_MISC,
# 1620|   		    "xml_writer_start_element() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def251]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1625:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1625:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1625:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1625:17: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
# 1623|   	r = xml_writer_start_element(writer, "toc");
# 1624|   	if (r < 0) {
# 1625|-> 		archive_set_error(&a->archive,
# 1626|   		    ARCHIVE_ERRNO_MISC,
# 1627|   		    "xml_writer_start_element() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def252]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1648:25: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1647:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1648:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1648:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1648:25: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/3)
# 1646|   		r = xml_writer_start_element(writer, "checksum");
# 1647|   		if (r < 0) {
# 1648|-> 			archive_set_error(&a->archive,
# 1649|   			    ARCHIVE_ERRNO_MISC,
# 1650|   			    "xml_writer_start_element() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def253]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1656:25: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1647:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1653:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1655:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1656:25: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1656:25: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1656:25: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/3)
# 1654|   		    getalgname(xar->opt_toc_sumalg));
# 1655|   		if (r < 0) {
# 1656|-> 			archive_set_error(&a->archive,
# 1657|   			    ARCHIVE_ERRNO_MISC,
# 1658|   			    "xml_writer_write_attribute() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def254]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1699:33: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1698:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1699:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1699:33: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1699:33: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/3)
# 1697|   			    "file");
# 1698|   			if (r < 0) {
# 1699|-> 				archive_set_error(&a->archive,
# 1700|   				    ARCHIVE_ERRNO_MISC,
# 1701|   				    "xml_writer_start_element() "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def255]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1708:33: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1698:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1705:29: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1707:28: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1708:33: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1708:33: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1708:33: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/3)
# 1706|   			    writer, "id", "%d", np->id);
# 1707|   			if (r < 0) {
# 1708|-> 				archive_set_error(&a->archive,
# 1709|   				    ARCHIVE_ERRNO_MISC,
# 1710|   				    "xml_writer_write_attributef() "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def256]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1755:17: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1754:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1755:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1755:17: throw: if 'archive_set_error' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1755:17: danger: 'writer' leaks here; was allocated at [(4)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/3)
# 1753|   	r = xml_writer_end_document(writer);
# 1754|   	if (r < 0) {
# 1755|-> 		archive_set_error(&a->archive,
# 1756|   		    ARCHIVE_ERRNO_MISC,
# 1757|   		    "xml_writer_end_document() failed: %d", r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def257]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2001:31: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1996:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1997:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2000:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2000:12: branch_true: following 'true' branch (when 'entry' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2001:31: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2001:31: throw: if 'archive_entry_clone' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2001:31: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
# 1999|   
# 2000|   	if (entry != NULL)
# 2001|-> 		file->entry = archive_entry_clone(entry);
# 2002|   	else
# 2003|   		file->entry = archive_entry_new2(&a->archive);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def258]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2003:31: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1996:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1997:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2000:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2000:12: branch_false: following 'false' branch (when 'entry' is NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2003:31: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2003:31: throw: if 'archive_entry_new2' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2003:31: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0)
# 2001|   		file->entry = archive_entry_clone(entry);
# 2002|   	else
# 2003|-> 		file->entry = archive_entry_new2(&a->archive);
# 2004|   	if (file->entry == NULL) {
# 2005|   		free(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def259]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2008:9: warning[-Wanalyzer-malloc-leak]: leak of 'file'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1996:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1997:12: branch_false: following 'false' branch (when 'file' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2000:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2004:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2008:9: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2008:9: throw: if '__archive_rb_tree_init' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2008:9: danger: 'file' leaks here; was allocated at [(1)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/0)
# 2006|   		return (NULL);
# 2007|   	}
# 2008|-> 	__archive_rb_tree_init(&(file->rbtree), &rb_ops);
# 2009|   	file->children.first = NULL;
# 2010|   	file->children.last = &(file->children.first);

Error: COMPILER_WARNING (CWE-704): [#def260]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c: scope_hint: In function 'get_path_component'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2276 |         p = strchr(fn, '/');
#      |           ^
# 2274|   	int l;
# 2275|   
# 2276|-> 	p = strchr(fn, '/');
# 2277|   	if (p == NULL) {
# 2278|   		if ((l = (int)strlen(fn)) == 0)

Error: COMPILER_WARNING (CWE-704): [#def261]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2276:11: warning[-Wdiscarded-qualifiers]: assignment discards 'const' qualifier from pointer target type
# 2274|   	int l;
# 2275|   
# 2276|-> 	p = strchr(fn, '/');
# 2277|   	if (p == NULL) {
# 2278|   		if ((l = (int)strlen(fn)) == 0)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def262]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2524:17: warning[-Wanalyzer-malloc-leak]: leak of 'hl'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2511:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2513:22: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2513:22: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2514:20: branch_false: following 'false' branch (when 'hl' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2519:17: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2524:17: throw: if '__archive_rb_tree_insert_node' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2524:17: danger: 'hl' leaks here; was allocated at [(3)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/2)
# 2522|   		hl->file_list.first = file;
# 2523|   		hl->file_list.last = &(file->hlnext);
# 2524|-> 		__archive_rb_tree_insert_node(&(xar->hardlink_rbtree),
# 2525|   		    (struct archive_rb_node *)hl);
# 2526|   	} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def263]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2638:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
# 2636|   		break;
# 2637|   	case CKSUM_SHA1:
# 2638|-> 		archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
# 2639|   		break;
# 2640|   	case CKSUM_MD5:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def264]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2641:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
# 2639|   		break;
# 2640|   	case CKSUM_MD5:
# 2641|-> 		archive_md5_update(&(sumwrk->md5ctx), buff, size);
# 2642|   		break;
# 2643|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def265]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2655:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
# 2653|   		break;
# 2654|   	case CKSUM_SHA1:
# 2655|-> 		archive_sha1_final(&(sumwrk->sha1ctx), sumval->val);
# 2656|   		sumval->len = SHA1_SIZE;
# 2657|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def266]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2659:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
# 2657|   		break;
# 2658|   	case CKSUM_MD5:
# 2659|-> 		archive_md5_final(&(sumwrk->md5ctx), sumval->val);
# 2660|   		sumval->len = MD5_SIZE;
# 2661|   		break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2690:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: call_function: calling 'xar_compression_init_encoder' from 'save_xattrs'
# 2688|   	strm = calloc(1, sizeof(*strm));
# 2689|   	if (strm == NULL) {
# 2690|-> 		archive_set_error(a, ENOMEM,
# 2691|   		    "Can't allocate memory for gzip stream");
# 2692|   		return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def268]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2708:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: call_function: calling 'xar_compression_init_encoder' from 'save_xattrs'
# 2706|   		free(strm);
# 2707|   		lastrm->real_stream = NULL;
# 2708|-> 		archive_set_error(a, ARCHIVE_ERRNO_MISC,
# 2709|   		    "Internal error initializing compression library");
# 2710|   		return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def269]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2787:17: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: call_function: calling 'xar_compression_init_encoder' from 'save_xattrs'
# 2785|   	strm = calloc(1, sizeof(*strm));
# 2786|   	if (strm == NULL) {
# 2787|-> 		archive_set_error(a, ENOMEM,
# 2788|   		    "Can't allocate memory for bzip2 stream");
# 2789|   		return (ARCHIVE_FATAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def270]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2802:13: warning[-Wanalyzer-malloc-leak]: leak of 'strm'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2785:16: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2786:12: branch_false: following 'false' branch (when 'strm' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2794:58: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2802:13: throw: if 'BZ2_bzCompressInit' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:2802:13: danger: 'strm' leaks here; was allocated at [(1)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/0)
# 2800|   	strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
# 2801|   	strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
# 2802|-> 	if (BZ2_bzCompressInit(strm, level, 0, 30) != BZ_OK) {
# 2803|   		free(strm);
# 2804|   		lastrm->real_stream = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def271]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3163:24: warning[-Wanalyzer-malloc-leak]: leak of 'heap'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3169:1: enter_function: entry to 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3180:12: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3182:16: branch_true: following 'true' branch (when 'count != 0')...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3183:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3188:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3189:20: branch_false: following 'false' branch (when 'heap' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3194:28: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: call_function: calling 'checksum_update' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3199:17: return_function: returning to 'save_xattrs' from 'checksum_update'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: call_function: calling 'checksum_final' from 'save_xattrs'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3200:17: return_function: returning to 'save_xattrs' from 'checksum_final'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3205:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3225:21: call_function: calling 'xar_compression_init_encoder' from 'save_xattrs'
# 3161|   {
# 3162|   	if (lastrm->valid)
# 3163|-> 		return (lastrm->end(a, lastrm));
# 3164|   	return (ARCHIVE_OK);
# 3165|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def272]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: warning[-Wanalyzer-malloc-leak]: leak of 'ctx'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3311:34: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3312:12: branch_false: following 'false' branch (when 'ctx' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: throw: if 'xmlBufferCreate' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: danger: 'ctx' leaks here; was allocated at [(1)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/0)
# 3314|   	}
# 3315|   
# 3316|-> 	ctx->bp = xmlBufferCreate();
# 3317|   	if (ctx->bp == NULL) {
# 3318|   		free(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def273]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3322:23: warning[-Wanalyzer-malloc-leak]: leak of 'ctx'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3311:34: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3312:12: branch_false: following 'false' branch (when 'ctx' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3317:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3322:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3322:23: throw: if 'xmlNewTextWriterMemory' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3322:23: danger: 'ctx' leaks here; was allocated at [(1)](sarif:/runs/0/results/29/codeFlows/0/threadFlows/0/locations/0)
# 3320|   	}
# 3321|   
# 3322|-> 	ctx->writer = xmlNewTextWriterMemory(ctx->bp, 0);
# 3323|   	if (ctx->writer == NULL) {
# 3324|   		xmlBufferFree(ctx->bp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def274]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3324:17: warning[-Wanalyzer-malloc-leak]: leak of 'ctx'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3311:34: acquire_memory: allocated here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3312:12: branch_false: following 'false' branch (when 'ctx' is non-NULL)...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3316:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3317:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3322:23: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3323:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3324:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3324:17: throw: if 'xmlBufferFree' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3324:17: danger: 'ctx' leaks here; was allocated at [(1)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/0)
# 3322|   	ctx->writer = xmlNewTextWriterMemory(ctx->bp, 0);
# 3323|   	if (ctx->writer == NULL) {
# 3324|-> 		xmlBufferFree(ctx->bp);
# 3325|   		free(ctx);
# 3326|   		return (-1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def275]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3336:9: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1816:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1817:17: branch_true: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1817:17: call_function: calling 'xml_writer_destroy' from 'make_toc'
# 3334|   xml_writer_destroy(struct xml_writer *ctx)
# 3335|   {
# 3336|-> 	xmlFreeTextWriter(ctx->writer);
# 3337|   	xmlBufferFree(ctx->bp);
# 3338|   	free(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def276]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3346:13: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1605:13: call_function: calling 'xml_writer_start_document' from 'make_toc'
# 3344|   {
# 3345|   	int r;
# 3346|-> 	r = xmlTextWriterStartDocument(ctx->writer, "1.0", "UTF-8", NULL);
# 3347|   	if (r < 0) {
# 3348|   		return (r);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def277]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3351:13: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1605:13: call_function: calling 'xml_writer_start_document' from 'make_toc'
# 3349|   	}
# 3350|   
# 3351|-> 	r = xmlTextWriterSetIndent(ctx->writer, (int)ctx->indent);
# 3352|   	return (r);
# 3353|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def278]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3358:16: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1753:13: call_function: inlined call to 'xml_writer_end_document' from 'make_toc'
# 3356|   xml_writer_end_document(struct xml_writer *ctx)
# 3357|   {
# 3358|-> 	return (xmlTextWriterEndDocument(ctx->writer));
# 3359|   }
# 3360|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def279]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3372:16: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
# 3370|   xml_writer_start_element(struct xml_writer *ctx, const char *localName)
# 3371|   {
# 3372|-> 	return (xmlTextWriterStartElement(ctx->writer,
# 3373|   	    BAD_CAST_CONST(localName)));
# 3374|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def280]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3380:16: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1647:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1653:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1653:21: call_function: inlined call to 'xml_writer_write_attribute' from 'make_toc'
# 3378|       const char *key, const char *value)
# 3379|   {
# 3380|-> 	return (xmlTextWriterWriteAttribute(ctx->writer,
# 3381|   	    BAD_CAST_CONST(key), BAD_CAST_CONST(value)));
# 3382|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def281]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3391:15: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1698:28: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1705:29: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1705:29: call_function: calling 'xml_writer_write_attributef' from 'make_toc'
# 3389|   	int ret;
# 3390|   	va_start(ap, format);
# 3391|-> 	ret = xmlTextWriterWriteVFormatAttribute(ctx->writer,
# 3392|   	    BAD_CAST_CONST(key), format, ap);
# 3393|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def282]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3391:15: warning[-Wanalyzer-va-list-leak]: missing call to 'va_end'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3390:9: acquire_resource: 'va_start' called here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3391:15: throw: if 'xmlTextWriterWriteVFormatAttribute' throws an exception...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3391:15: danger: missing call to 'va_end' to match 'va_start' at [(1)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/0)
# 3389|   	int ret;
# 3390|   	va_start(ap, format);
# 3391|-> 	ret = xmlTextWriterWriteVFormatAttribute(ctx->writer,
# 3392|   	    BAD_CAST_CONST(key), format, ap);
# 3393|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3400:16: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
# 3398|   xml_writer_write_string(struct xml_writer *ctx, const char *string)
# 3399|   {
# 3400|-> 	return (xmlTextWriterWriteString(ctx->writer, BAD_CAST_CONST(string)));
# 3401|   }
# 3402|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def284]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3414:16: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
# 3412|   xml_writer_end_element(struct xml_writer *ctx)
# 3413|   {
# 3414|-> 	return (xmlTextWriterEndElement(ctx->writer));
# 3415|   }
# 3416|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3421:29: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1754:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1761:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1761:13: call_function: calling 'xml_writer_get_final_content_and_length' from 'make_toc'
# 3419|       const char **out, size_t *size)
# 3420|   {
# 3421|-> 	*out = (const char*)xmlBufferContent(ctx->bp);
# 3422|   	*size = (size_t)xmlBufferLength(ctx->bp);
# 3423|   	return (0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def286]
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:3422:25: warning[-Wanalyzer-malloc-leak]: leak of 'writer'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1573:1: enter_function: entry to 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: call_function: calling 'xml_writer_create' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1591:13: return_function: returning to 'make_toc' from 'xml_writer_create'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1592:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1598:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1606:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1616:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1617:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1623:13: call_function: inlined call to 'xml_writer_start_element' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1624:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: call_function: calling 'xmlwrite_time' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1634:13: return_function: returning to 'make_toc' from 'xmlwrite_time'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1635:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1641:19: call_function: inlined call to 'getalgsize' from 'make_toc'
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1687:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1693:21: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1754:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1761:13: branch_false: ...to here
libarchive-3.8.4/libarchive/archive_write_set_format_xar.c:1761:13: call_function: calling 'xml_writer_get_final_content_and_length' from 'make_toc'
# 3420|   {
# 3421|   	*out = (const char*)xmlBufferContent(ctx->bp);
# 3422|-> 	*size = (size_t)xmlBufferLength(ctx->bp);
# 3423|   	return (0);
# 3424|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def287]
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: danger: 'stdin_pipe[0]' leaks here
#  102|   		if ((tmp = dup(stdin_pipe[0])) == -1)
#  103|   			goto stdin_opened;
#  104|-> 		close(stdin_pipe[0]);
#  105|   		stdin_pipe[0] = tmp;
#  106|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def288]
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: danger: 'stdin_pipe[1]' leaks here
#  102|   		if ((tmp = dup(stdin_pipe[0])) == -1)
#  103|   			goto stdin_opened;
#  104|-> 		close(stdin_pipe[0]);
#  105|   		stdin_pipe[0] = tmp;
#  106|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def289]
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: danger: 'tmp' leaks here; was opened at [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#  102|   		if ((tmp = dup(stdin_pipe[0])) == -1)
#  103|   			goto stdin_opened;
#  104|-> 		close(stdin_pipe[0]);
#  105|   		stdin_pipe[0] = tmp;
#  106|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def290]
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: danger: 'stdin_pipe[0]' leaks here
#  110|   		if ((tmp = dup(stdout_pipe[1])) == -1)
#  111|   			goto stdout_opened;
#  112|-> 		close(stdout_pipe[1]);
#  113|   		stdout_pipe[1] = tmp;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def291]
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: danger: 'stdin_pipe[1]' leaks here
#  110|   		if ((tmp = dup(stdout_pipe[1])) == -1)
#  111|   			goto stdout_opened;
#  112|-> 		close(stdout_pipe[1]);
#  113|   		stdout_pipe[1] = tmp;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def292]
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: danger: 'stdout_pipe[0]' leaks here
#  110|   		if ((tmp = dup(stdout_pipe[1])) == -1)
#  111|   			goto stdout_opened;
#  112|-> 		close(stdout_pipe[1]);
#  113|   		stdout_pipe[1] = tmp;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def293]
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: danger: 'stdout_pipe[1]' leaks here
#  110|   		if ((tmp = dup(stdout_pipe[1])) == -1)
#  111|   			goto stdout_opened;
#  112|-> 		close(stdout_pipe[1]);
#  113|   		stdout_pipe[1] = tmp;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def294]
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/14)
#  110|   		if ((tmp = dup(stdout_pipe[1])) == -1)
#  111|   			goto stdout_opened;
#  112|-> 		close(stdout_pipe[1]);
#  113|   		stdout_pipe[1] = tmp;
#  114|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def295]
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: danger: 'stdin_pipe[0]' leaks here
#  172|   		goto stdout_opened;
#  173|   	if (child == 0) {
#  174|-> 		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def296]
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: danger: 'stdin_pipe[1]' leaks here
#  172|   		goto stdout_opened;
#  173|   	if (child == 0) {
#  174|-> 		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def297]
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: danger: 'stdout_pipe[0]' leaks here
#  172|   		goto stdout_opened;
#  173|   	if (child == 0) {
#  174|-> 		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def298]
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: danger: 'stdout_pipe[1]' leaks here
#  172|   		goto stdout_opened;
#  173|   	if (child == 0) {
#  174|-> 		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def299]
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/14)
#  172|   		goto stdout_opened;
#  173|   	if (child == 0) {
#  174|-> 		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def300]
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: danger: 'stdin_pipe[0]' leaks here
#  173|   	if (child == 0) {
#  174|   		close(stdin_pipe[1]);
#  175|-> 		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def301]
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: danger: 'stdout_pipe[0]' leaks here
#  173|   	if (child == 0) {
#  174|   		close(stdin_pipe[1]);
#  175|-> 		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def302]
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: danger: 'stdout_pipe[1]' leaks here
#  173|   	if (child == 0) {
#  174|   		close(stdin_pipe[1]);
#  175|-> 		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def303]
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:175:17: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/14)
#  173|   	if (child == 0) {
#  174|   		close(stdin_pipe[1]);
#  175|-> 		close(stdout_pipe[0]);
#  176|   		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def304]
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(stdin_pipe[0], 0)'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:21: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: danger: 'dup2(stdin_pipe[0], 0)' leaks here; was opened at [(19)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/18)
#  174|   		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|-> 		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)

Error: GCC_ANALYZER_WARNING: [#def305]
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:21: warning[-Wanalyzer-fd-use-without-check]: 'dup2' on possibly invalid file descriptor '0'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: release_resource: closed here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:21: danger: '0' could be invalid
#  174|   		close(stdin_pipe[1]);
#  175|   		close(stdout_pipe[0]);
#  176|-> 		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
#  177|   			_exit(254);
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def306]
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: danger: 'stdin_pipe[0]' leaks here
#  177|   			_exit(254);
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)
#  179|-> 			close(stdin_pipe[0]);
#  180|   		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
#  181|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def307]
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: danger: 'stdout_pipe[1]' leaks here
#  177|   			_exit(254);
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)
#  179|-> 			close(stdin_pipe[0]);
#  180|   		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
#  181|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def308]
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:179:25: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/14)
#  177|   			_exit(254);
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)
#  179|-> 			close(stdin_pipe[0]);
#  180|   		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
#  181|   			_exit(254);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def309]
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(stdout_pipe[1], 1)'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:20: danger: 'dup2(stdout_pipe[1], 1)' leaks here; was opened at [(23)](sarif:/runs/0/results/26/codeFlows/0/threadFlows/0/locations/22)
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)
#  179|   			close(stdin_pipe[0]);
#  180|-> 		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
#  181|   			_exit(254);
#  182|   		if (stdout_pipe[1] != 1 /* stdout */)

Error: GCC_ANALYZER_WARNING: [#def310]
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: warning[-Wanalyzer-fd-use-without-check]: 'dup2' on possibly invalid file descriptor '1'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: release_resource: closed here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: danger: '1' could be invalid
#  178|   		if (stdin_pipe[0] != 0 /* stdin */)
#  179|   			close(stdin_pipe[0]);
#  180|-> 		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
#  181|   			_exit(254);
#  182|   		if (stdout_pipe[1] != 1 /* stdout */)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def311]
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: danger: 'stdin_pipe[0]' leaks here
#  181|   			_exit(254);
#  182|   		if (stdout_pipe[1] != 1 /* stdout */)
#  183|-> 			close(stdout_pipe[1]);
#  184|   
#  185|   #if HAVE_CLOSEFROM

Error: GCC_ANALYZER_WARNING (CWE-775): [#def312]
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: danger: 'stdout_pipe[1]' leaks here
#  181|   			_exit(254);
#  182|   		if (stdout_pipe[1] != 1 /* stdout */)
#  183|-> 			close(stdout_pipe[1]);
#  184|   
#  185|   #if HAVE_CLOSEFROM

Error: GCC_ANALYZER_WARNING (CWE-775): [#def313]
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_true: following 'true' branch (when 'child == 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:174:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:176:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:178:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:180:20: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:21: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:182:20: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:183:25: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/30/codeFlows/0/threadFlows/0/locations/14)
#  181|   			_exit(254);
#  182|   		if (stdout_pipe[1] != 1 /* stdout */)
#  183|-> 			close(stdout_pipe[1]);
#  184|   
#  185|   #if HAVE_CLOSEFROM

Error: GCC_ANALYZER_WARNING (CWE-775): [#def314]
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: danger: 'stdin_pipe[0]' leaks here
#  197|   #endif /* HAVE_POSIX_SPAWNP */
#  198|   
#  199|-> 	close(stdin_pipe[0]);
#  200|   	close(stdout_pipe[1]);
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def315]
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: danger: 'stdin_pipe[1]' leaks here
#  197|   #endif /* HAVE_POSIX_SPAWNP */
#  198|   
#  199|-> 	close(stdin_pipe[0]);
#  200|   	close(stdout_pipe[1]);
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def316]
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: danger: 'stdout_pipe[0]' leaks here
#  197|   #endif /* HAVE_POSIX_SPAWNP */
#  198|   
#  199|-> 	close(stdin_pipe[0]);
#  200|   	close(stdout_pipe[1]);
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def317]
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: danger: 'stdout_pipe[1]' leaks here
#  197|   #endif /* HAVE_POSIX_SPAWNP */
#  198|   
#  199|-> 	close(stdin_pipe[0]);
#  200|   	close(stdout_pipe[1]);
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def318]
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/14)
#  197|   #endif /* HAVE_POSIX_SPAWNP */
#  198|   
#  199|-> 	close(stdin_pipe[0]);
#  200|   	close(stdout_pipe[1]);
#  201|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def319]
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: danger: 'stdin_pipe[1]' leaks here
#  198|   
#  199|   	close(stdin_pipe[0]);
#  200|-> 	close(stdout_pipe[1]);
#  201|   
#  202|   	*child_stdin = stdin_pipe[1];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def320]
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: danger: 'stdout_pipe[0]' leaks here
#  198|   
#  199|   	close(stdin_pipe[0]);
#  200|-> 	close(stdout_pipe[1]);
#  201|   
#  202|   	*child_stdin = stdin_pipe[1];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def321]
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: danger: 'stdout_pipe[1]' leaks here
#  198|   
#  199|   	close(stdin_pipe[0]);
#  200|-> 	close(stdout_pipe[1]);
#  201|   
#  202|   	*child_stdin = stdin_pipe[1];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def322]
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:112:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:200:9: danger: 'tmp' leaks here; was opened at [(15)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/14)
#  198|   
#  199|   	close(stdin_pipe[0]);
#  200|-> 	close(stdout_pipe[1]);
#  201|   
#  202|   	*child_stdin = stdin_pipe[1];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def323]
libarchive-3.8.4/libarchive/filter_fork_posix.c:203:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:167:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:171:12: branch_false: following 'false' branch (when 'child != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:173:12: branch_false: following 'false' branch (when 'child != 0')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:199:9: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:203:9: throw: if 'fcntl' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:203:9: danger: 'stdout_pipe[0]' leaks here
#  201|   
#  202|   	*child_stdin = stdin_pipe[1];
#  203|-> 	fcntl(*child_stdin, F_SETFL, O_NONBLOCK);
#  204|   	*child_stdout = stdout_pipe[0];
#  205|   	fcntl(*child_stdout, F_SETFL, O_NONBLOCK);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def324]
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: danger: 'stdin_pipe[0]' leaks here
#  217|   #endif
#  218|   stdout_opened:
#  219|-> 	close(stdout_pipe[0]);
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def325]
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: danger: 'stdin_pipe[1]' leaks here
#  217|   #endif
#  218|   stdout_opened:
#  219|-> 	close(stdout_pipe[0]);
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def326]
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: danger: 'stdout_pipe[0]' leaks here
#  217|   #endif
#  218|   stdout_opened:
#  219|-> 	close(stdout_pipe[0]);
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def327]
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: danger: 'stdout_pipe[1]' leaks here
#  217|   #endif
#  218|   stdout_opened:
#  219|-> 	close(stdout_pipe[0]);
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def328]
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:219:9: danger: 'tmp' leaks here; was opened at [(10)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/9)
#  217|   #endif
#  218|   stdout_opened:
#  219|-> 	close(stdout_pipe[0]);
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def329]
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: danger: 'stdin_pipe[0]' leaks here
#  218|   stdout_opened:
#  219|   	close(stdout_pipe[0]);
#  220|-> 	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|   	close(stdin_pipe[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def330]
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: danger: 'stdin_pipe[1]' leaks here
#  218|   stdout_opened:
#  219|   	close(stdout_pipe[0]);
#  220|-> 	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|   	close(stdin_pipe[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def331]
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdout_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: danger: 'stdout_pipe[1]' leaks here
#  218|   stdout_opened:
#  219|   	close(stdout_pipe[0]);
#  220|-> 	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|   	close(stdin_pipe[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def332]
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:109:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:110:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:111:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:220:9: danger: 'tmp' leaks here; was opened at [(10)](sarif:/runs/0/results/51/codeFlows/0/threadFlows/0/locations/9)
#  218|   stdout_opened:
#  219|   	close(stdout_pipe[0]);
#  220|-> 	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|   	close(stdin_pipe[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def333]
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[0]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:103:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: danger: 'stdin_pipe[0]' leaks here
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|-> 	close(stdin_pipe[0]);
#  223|   	close(stdin_pipe[1]);
#  224|   state_allocated:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def334]
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:103:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: danger: 'stdin_pipe[1]' leaks here
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|-> 	close(stdin_pipe[0]);
#  223|   	close(stdin_pipe[1]);
#  224|   state_allocated:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def335]
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'tmp'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:28: acquire_resource: opened here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_false: following 'false' branch (when 'tmp != -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:104:17: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:107:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:108:17: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:222:9: danger: 'tmp' leaks here; was opened at [(10)](sarif:/runs/0/results/55/codeFlows/0/threadFlows/0/locations/9)
#  220|   	close(stdout_pipe[1]);
#  221|   stdin_opened:
#  222|-> 	close(stdin_pipe[0]);
#  223|   	close(stdin_pipe[1]);
#  224|   state_allocated:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def336]
libarchive-3.8.4/libarchive/filter_fork_posix.c:223:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'stdin_pipe[1]'
libarchive-3.8.4/libarchive/filter_fork_posix.c:94:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:96:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:99:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive/filter_fork_posix.c:101:13: branch_false: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:102:20: branch_true: following 'true' branch (when 'tmp == -1')...
libarchive-3.8.4/libarchive/filter_fork_posix.c:103:25: branch_true: ...to here
libarchive-3.8.4/libarchive/filter_fork_posix.c:223:9: throw: if 'close' throws an exception...
libarchive-3.8.4/libarchive/filter_fork_posix.c:223:9: danger: 'stdin_pipe[1]' leaks here
#  221|   stdin_opened:
#  222|   	close(stdin_pipe[0]);
#  223|-> 	close(stdin_pipe[1]);
#  224|   state_allocated:
#  225|   	__archive_cmdline_free(cmdline);

Error: CPPCHECK_WARNING (CWE-476): [#def337]
libarchive-3.8.4/libarchive/xxhash.c:350: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  348|   {
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|->     state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def338]
libarchive-3.8.4/libarchive/xxhash.c:350:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'state'
libarchive-3.8.4/libarchive/xxhash.c:363:19: acquire_memory: this call could return NULL
libarchive-3.8.4/libarchive/xxhash.c:364:5: call_function: inlined call to 'XXH32_resetState' from 'XXH32_init'
#  348|   {
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|->     state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;

Error: CPPCHECK_WARNING (CWE-476): [#def339]
libarchive-3.8.4/libarchive/xxhash.c:351: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  349|       struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
#  350|       state->seed = seed;
#  351|->     state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;

Error: CPPCHECK_WARNING (CWE-476): [#def340]
libarchive-3.8.4/libarchive/xxhash.c:352: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  350|       state->seed = seed;
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|->     state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;

Error: CPPCHECK_WARNING (CWE-476): [#def341]
libarchive-3.8.4/libarchive/xxhash.c:353: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  351|       state->v1 = seed + PRIME32_1 + PRIME32_2;
#  352|       state->v2 = seed + PRIME32_2;
#  353|->     state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def342]
libarchive-3.8.4/libarchive/xxhash.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  352|       state->v2 = seed + PRIME32_2;
#  353|       state->v3 = seed + 0;
#  354|->     state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;
#  356|       state->memsize = 0;

Error: CPPCHECK_WARNING (CWE-476): [#def343]
libarchive-3.8.4/libarchive/xxhash.c:355: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  353|       state->v3 = seed + 0;
#  354|       state->v4 = seed - PRIME32_1;
#  355|->     state->total_len = 0;
#  356|       state->memsize = 0;
#  357|       return XXH_OK;

Error: CPPCHECK_WARNING (CWE-476): [#def344]
libarchive-3.8.4/libarchive/xxhash.c:356: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: state
#  354|       state->v4 = seed - PRIME32_1;
#  355|       state->total_len = 0;
#  356|->     state->memsize = 0;
#  357|       return XXH_OK;
#  358|   }

Error: CPPCHECK_WARNING (CWE-476): [#def345]
libarchive-3.8.4/libarchive_fe/line_reader.c:65: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lr
#   63|   		lafe_errc(1, ENOMEM, "Can't open %s", pathname);
#   64|   
#   65|-> 	lr->nullSeparator = nullSeparator;
#   66|   	lr->pathname = strdup(pathname);
#   67|   

Error: CPPCHECK_WARNING (CWE-476): [#def346]
libarchive-3.8.4/libarchive_fe/line_reader.c:66: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lr
#   64|   
#   65|   	lr->nullSeparator = nullSeparator;
#   66|-> 	lr->pathname = strdup(pathname);
#   67|   
#   68|   	if (strcmp(pathname, "-") == 0)

Error: CPPCHECK_WARNING (CWE-476): [#def347]
libarchive-3.8.4/libarchive_fe/line_reader.c:72: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lr
#   70|   	else
#   71|   		lr->f = fopen(pathname, "r");
#   72|-> 	if (lr->f == NULL)
#   73|   		lafe_errc(1, errno, "Couldn't open %s", pathname);
#   74|   	lr->buff_length = 8192;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def348]
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: warning[-Wanalyzer-malloc-leak]: leak of '<unknown>'
libarchive-3.8.4/libarchive_fe/line_reader.c:62:12: branch_false: following 'false' branch (when 'lr' is non-NULL)...
libarchive-3.8.4/libarchive_fe/line_reader.c:65:9: branch_false: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:66:24: acquire_memory: allocated here
libarchive-3.8.4/libarchive_fe/line_reader.c:68:12: branch_true: following 'true' branch (when the strings are equal)...
libarchive-3.8.4/libarchive_fe/line_reader.c:69:17: branch_true: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:72:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive_fe/line_reader.c:73:30: branch_true: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: throw: if 'lafe_errc' throws an exception...
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: danger: '<unknown>' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   71|   		lr->f = fopen(pathname, "r");
#   72|   	if (lr->f == NULL)
#   73|-> 		lafe_errc(1, errno, "Couldn't open %s", pathname);
#   74|   	lr->buff_length = 8192;
#   75|   	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def349]
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: warning[-Wanalyzer-malloc-leak]: leak of 'lr'
libarchive-3.8.4/libarchive_fe/line_reader.c:61:14: acquire_memory: allocated here
libarchive-3.8.4/libarchive_fe/line_reader.c:62:12: branch_false: following 'false' branch (when 'lr' is non-NULL)...
libarchive-3.8.4/libarchive_fe/line_reader.c:65:9: branch_false: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:68:12: branch_true: following 'true' branch (when the strings are equal)...
libarchive-3.8.4/libarchive_fe/line_reader.c:69:17: branch_true: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:72:12: branch_true: following 'true' branch...
libarchive-3.8.4/libarchive_fe/line_reader.c:73:30: branch_true: ...to here
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: throw: if 'lafe_errc' throws an exception...
libarchive-3.8.4/libarchive_fe/line_reader.c:73:17: danger: 'lr' leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   71|   		lr->f = fopen(pathname, "r");
#   72|   	if (lr->f == NULL)
#   73|-> 		lafe_errc(1, errno, "Couldn't open %s", pathname);
#   74|   	lr->buff_length = 8192;
#   75|   	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;

Error: CPPCHECK_WARNING (CWE-476): [#def350]
libarchive-3.8.4/libarchive_fe/line_reader.c:74: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lr
#   72|   	if (lr->f == NULL)
#   73|   		lafe_errc(1, errno, "Couldn't open %s", pathname);
#   74|-> 	lr->buff_length = 8192;
#   75|   	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;
#   76|   

Error: CPPCHECK_WARNING (CWE-476): [#def351]
libarchive-3.8.4/libarchive_fe/line_reader.c:75: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: lr
#   73|   		lafe_errc(1, errno, "Couldn't open %s", pathname);
#   74|   	lr->buff_length = 8192;
#   75|-> 	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;
#   76|   
#   77|   	return (lr);

Error: CPPCHECK_WARNING (CWE-401): [#def352]
libarchive-3.8.4/libarchive_fe/line_reader.c:77: error[memleak]: Memory leak: lr.pathname
#   75|   	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;
#   76|   
#   77|-> 	return (lr);
#   78|   }
#   79|   

Error: CPPCHECK_WARNING (CWE-404): [#def353]
libarchive-3.8.4/libarchive_fe/line_reader.c:77: error[resourceLeak]: Resource leak: lr.f
#   75|   	lr->line_start = lr->line_end = lr->buff_end = lr->buff = NULL;
#   76|   
#   77|-> 	return (lr);
#   78|   }
#   79|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def354]
libarchive-3.8.4/libarchive_fe/passphrase.c:208:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/dev/tty", 2)'
libarchive-3.8.4/libarchive_fe/passphrase.c:178:12: branch_false: following 'false' branch (when 'bufsiz != 0')...
libarchive-3.8.4/libarchive_fe/passphrase.c:178:12: branch_false: ...to here
libarchive-3.8.4/libarchive_fe/passphrase.c:184:21: branch_true: following 'true' branch (when 'i != 23')...
libarchive-3.8.4/libarchive_fe/passphrase.c:185:17: branch_true: ...to here
libarchive-3.8.4/libarchive_fe/passphrase.c:193:12: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive_fe/passphrase.c:194:31: branch_false: ...to here
libarchive-3.8.4/libarchive_fe/passphrase.c:194:31: acquire_resource: opened here
libarchive-3.8.4/libarchive_fe/passphrase.c:193:13: branch_false: following 'false' branch...
libarchive-3.8.4/libarchive_fe/passphrase.c:208:12: branch_false: ...to here
libarchive-3.8.4/libarchive_fe/passphrase.c:208:12: danger: 'open("/dev/tty", 2)' leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  206|   	 * generate SIGTTOU, so do it *before* installing the signal handlers.
#  207|   	 */
#  208|-> 	if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) {
#  209|   		memcpy(&term, &oterm, sizeof(term));
#  210|   		if (!(flags & RPP_ECHO_ON))

Error: COMPILER_WARNING (CWE-704): [#def355]
libarchive-3.8.4/tar/bsdtar.c: scope_hint: In function ‘main’
libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  381 |                         uptr = strchr(bsdtar->argument, ':');
#      |                              ^
#  379|   			tptr = NULL;
#  380|   
#  381|-> 			uptr = strchr(bsdtar->argument, ':');
#  382|   			if (uptr != NULL) {
#  383|   				if (uptr[1] == '\0') {

Error: COMPILER_WARNING (CWE-704): [#def356]
libarchive-3.8.4/tar/bsdtar.c:381:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  379|   			tptr = NULL;
#  380|   
#  381|-> 			uptr = strchr(bsdtar->argument, ':');
#  382|   			if (uptr != NULL) {
#  383|   				if (uptr[1] == '\0') {

Error: COMPILER_WARNING (CWE-704): [#def357]
libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  660 |                         uptr = strchr(bsdtar->argument, ':');
#      |                              ^
#  658|   			tptr = NULL;
#  659|   
#  660|-> 			uptr = strchr(bsdtar->argument, ':');
#  661|   			if (uptr != NULL) {
#  662|   				if (uptr[1] == 0) {

Error: COMPILER_WARNING (CWE-704): [#def358]
libarchive-3.8.4/tar/bsdtar.c:660:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  658|   			tptr = NULL;
#  659|   
#  660|-> 			uptr = strchr(bsdtar->argument, ':');
#  661|   			if (uptr != NULL) {
#  662|   				if (uptr[1] == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def359]
libarchive-3.8.4/tar/creation_set.c:122:17: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
libarchive-3.8.4/tar/creation_set.c:230:1: enter_function: entry to ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:237:16: acquire_memory: allocated here
libarchive-3.8.4/tar/creation_set.c:238:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:241:9: branch_false: ...to here
libarchive-3.8.4/tar/creation_set.c:249:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:254:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/tar/creation_set.c:255:25: call_function: inlined call to ‘cset_add_filter’ from ‘cset_auto_compress’
#  120|   	    sizeof(*cset->filters) * (cset->filter_count + 1));
#  121|   	if (new_ptr == NULL)
#  122|-> 		lafe_errc(1, 0, "No memory");
#  123|   	new_filter = strdup(filter);
#  124|   	if (new_filter == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def360]
libarchive-3.8.4/tar/creation_set.c:125:17: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
libarchive-3.8.4/tar/creation_set.c:230:1: enter_function: entry to ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:237:16: acquire_memory: allocated here
libarchive-3.8.4/tar/creation_set.c:238:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:241:9: branch_false: ...to here
libarchive-3.8.4/tar/creation_set.c:249:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:254:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/tar/creation_set.c:255:25: call_function: inlined call to ‘cset_add_filter’ from ‘cset_auto_compress’
#  123|   	new_filter = strdup(filter);
#  124|   	if (new_filter == NULL)
#  125|-> 		lafe_errc(1, 0, "No memory");
#  126|   	cset->filters = new_ptr;
#  127|   	cset->filters[cset->filter_count].program = program;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def361]
libarchive-3.8.4/tar/creation_set.c:125:17: warning[-Wanalyzer-malloc-leak]: leak of ‘new_ptr’
libarchive-3.8.4/tar/creation_set.c:230:1: enter_function: entry to ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:238:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:241:9: branch_false: ...to here
libarchive-3.8.4/tar/creation_set.c:249:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:254:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/tar/creation_set.c:255:25: call_function: inlined call to ‘cset_add_filter’ from ‘cset_auto_compress’
#  123|   	new_filter = strdup(filter);
#  124|   	if (new_filter == NULL)
#  125|-> 		lafe_errc(1, 0, "No memory");
#  126|   	cset->filters = new_ptr;
#  127|   	cset->filters[cset->filter_count].program = program;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def362]
libarchive-3.8.4/tar/creation_set.c:188:17: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
libarchive-3.8.4/tar/creation_set.c:230:1: enter_function: entry to ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:237:16: acquire_memory: allocated here
libarchive-3.8.4/tar/creation_set.c:238:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:241:9: branch_false: ...to here
libarchive-3.8.4/tar/creation_set.c:249:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:253:24: call_function: inlined call to ‘get_filter_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:254:20: branch_false: following ‘false’ branch...
libarchive-3.8.4/tar/creation_set.c:260:24: call_function: inlined call to ‘get_format_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:260:24: call_function: inlined call to ‘get_format_code’ from ‘cset_auto_compress’
libarchive-3.8.4/tar/creation_set.c:261:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/tar/creation_set.c:262:25: branch_true: ...to here
libarchive-3.8.4/tar/creation_set.c:262:25: call_function: calling ‘cset_set_format’ from ‘cset_auto_compress’
#  186|   	f = strdup(format);
#  187|   	if (f == NULL)
#  188|-> 		lafe_errc(1, 0, "No memory");
#  189|   	free(cset->create_format);
#  190|   	cset->create_format = f;

Error: CPPCHECK_WARNING (CWE-476): [#def363]
libarchive-3.8.4/tar/creation_set.c:248: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: name
#  246|   	for (;;) {
#  247|   		/* Get the suffix. */
#  248|-> 		p = strrchr(name, '.');
#  249|   		if (p == NULL)
#  250|   			break;

Error: CPPCHECK_WARNING (CWE-476): [#def364]
libarchive-3.8.4/tar/creation_set.c:289: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: v
#  287|   		/* Reverse filter sequence. */
#  288|   		for (i = 0, r = cset->filter_count; r > 0; )
#  289|-> 			v[i++] = cset->filters[--r];
#  290|   		free(cset->filters);
#  291|   		cset->filters = v;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def365]
libarchive-3.8.4/tar/read.c:183:21: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
libarchive-3.8.4/tar/read.c:171:12: branch_true: following ‘true’ branch (when ‘reader_options’ is non-NULL)...
libarchive-3.8.4/tar/read.c:173:34: branch_true: ...to here
libarchive-3.8.4/tar/read.c:176:26: acquire_memory: allocated here
libarchive-3.8.4/tar/read.c:176:20: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
libarchive-3.8.4/tar/read.c:181:17: branch_false: ...to here
libarchive-3.8.4/tar/read.c:183:21: throw: if ‘archive_read_set_options’ throws an exception...
libarchive-3.8.4/tar/read.c:183:21: danger: ‘p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  181|   		memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
#  182|   		memcpy(p + module_len, reader_options, opt_len);
#  183|-> 		r = archive_read_set_options(a, p);
#  184|   		free(p);
#  185|   		if (r == ARCHIVE_FATAL)

Error: CPPCHECK_WARNING (CWE-476): [#def366]
libarchive-3.8.4/tar/subst.c:69: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rule
#   67|   	if (rule == NULL)
#   68|   		lafe_errc(1, errno, "Out of memory");
#   69|-> 	rule->next = NULL;
#   70|   	rule->result = NULL;
#   71|   

Error: CPPCHECK_WARNING (CWE-476): [#def367]
libarchive-3.8.4/tar/subst.c:70: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: rule
#   68|   		lafe_errc(1, errno, "Out of memory");
#   69|   	rule->next = NULL;
#   70|-> 	rule->result = NULL;
#   71|   
#   72|   	if (subst->last_rule == NULL)

Error: CPPCHECK_WARNING (CWE-476): [#def368]
libarchive-3.8.4/tar/subst.c:87: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pattern
#   85|   	if (pattern == NULL)
#   86|   		lafe_errc(1, errno, "Out of memory");
#   87|-> 	memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1);
#   88|   	pattern[end_pattern - rule_text - 1] = '\0';
#   89|   

Error: CPPCHECK_WARNING (CWE-476): [#def369]
libarchive-3.8.4/tar/subst.c:88: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: pattern
#   86|   		lafe_errc(1, errno, "Out of memory");
#   87|   	memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1);
#   88|-> 	pattern[end_pattern - rule_text - 1] = '\0';
#   89|   
#   90|   	if ((r = regcomp(&rule->re, pattern, REG_BASIC)) != 0) {

Error: CPPCHECK_WARNING (CWE-457): [#def370]
libarchive-3.8.4/tar/util.c:777: warning[uninitvar]: Uninitialized variable: sw
#  775|   	if (ltime)
#  776|   		sw = strftime(tmp, sizeof(tmp), fmt, ltime);
#  777|-> 	if (!ltime || !sw)
#  778|   		sprintf(tmp, "-- -- ----");
#  779|   	fprintf(out, " %s ", tmp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def371]
libarchive-3.8.4/tar/write.c:200:21: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
libarchive-3.8.4/tar/write.c:655:1: enter_function: entry to ‘append_archive_filename’
libarchive-3.8.4/tar/write.c:662:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
libarchive-3.8.4/tar/write.c:665:15: branch_false: ...to here
libarchive-3.8.4/tar/write.c:668:9: call_function: calling ‘set_reader_options’ from ‘append_archive_filename’
#  198|   		memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
#  199|   		memcpy(p, reader_options, opt_len);
#  200|-> 		r = archive_read_set_options(a, p);
#  201|   		free(p);
#  202|   		if (r < ARCHIVE_WARN)

Error: CPPCHECK_WARNING (CWE-562): [#def372]
libarchive-3.8.4/tar/write.c:367: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
#  365|   	struct archive_dir	 archive_dir;
#  366|   
#  367|-> 	bsdtar->archive_dir = &archive_dir;
#  368|   	memset(&archive_dir, 0, sizeof(archive_dir));
#  369|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def373]
libarchive-3.8.4/unzip/bsdunzip.c:124:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
libarchive-3.8.4/unzip/bsdunzip.c:978:1: enter_function: entry to ‘unzip’
libarchive-3.8.4/unzip/bsdunzip.c:985:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:988:9: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:988:9: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:990:13: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:999:9: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1001:13: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1018:20: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1020:17: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1020:17: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1021:21: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1021:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1022:29: branch_true: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1022:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1024:34: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1024:33: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1026:34: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1026:33: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1029:33: call_function: calling ‘extract’ from ‘unzip’
#  122|   	if (noeol)
#  123|   		fprintf(stdout, "\n");
#  124|-> 	fflush(stdout);
#  125|   	fprintf(stderr, "unzip: ");
#  126|   	va_start(ap, fmt);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def374]
libarchive-3.8.4/unzip/bsdunzip.c:227:29: warning[-Wanalyzer-malloc-leak]: leak of ‘pathdup(archive_entry_pathname(e))’
libarchive-3.8.4/unzip/bsdunzip.c:978:1: enter_function: entry to ‘unzip’
libarchive-3.8.4/unzip/bsdunzip.c:985:12: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:988:9: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:988:9: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:990:13: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:999:9: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1001:13: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1018:20: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1020:17: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1020:17: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1021:21: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1021:20: branch_true: following ‘true’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1022:29: branch_true: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1022:28: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1024:34: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1024:33: branch_false: following ‘false’ branch...
libarchive-3.8.4/unzip/bsdunzip.c:1026:34: branch_false: ...to here
libarchive-3.8.4/unzip/bsdunzip.c:1027:33: call_function: calling ‘extract_stdout’ from ‘unzip’
#  225|   	size_t i, len;
#  226|   
#  227|-> 	if (path == NULL || path[0] == '\0')
#  228|   		return (NULL);
#  229|   

Scan Properties

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