sbc-2.1-1.fc44

List of Findings

Error: GCC_ANALYZER_WARNING: [#def1]
sbc-2.1/sbc/sbc.c:642:25: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to 'memcpy'
sbc-2.1/sbc/sbc.c:1213:20: enter_function: entry to 'sbc_decode'
sbc-2.1/sbc/sbc.c:1220:12: branch_false: following 'false' branch...
sbc-2.1/sbc/sbc.c:1223:9: branch_false: ...to here
sbc-2.1/sbc/sbc.c:1245:12: branch_false: following 'false' branch (when 'output' is non-NULL)...
sbc-2.1/sbc/sbc.c:1248:12: branch_false: ...to here
sbc-2.1/sbc/sbc.c:1251:12: branch_false: following 'false' branch...
sbc-2.1/sbc/sbc.c:1254:19: branch_false: ...to here
sbc-2.1/sbc/sbc.c:1254:19: call_function: calling 'sbc_synthesize_audio' from 'sbc_decode'
#  640|   		if (offset[i] < 0) {
#  641|   			offset[i] = 79;
#  642|-> 			memcpy(v + 80, v, 9 * sizeof(*v));
#  643|   		}
#  644|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def2]
sbc-2.1/src/sbcdec.c:57:14: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:57:14: throw: if ‘open’ throws an exception...
sbc-2.1/src/sbcdec.c:57:14: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   55|   	}
#   56|   
#   57|-> 	fd = open(filename, O_RDONLY);
#   58|   	if (fd < 0) {
#   59|   		fprintf(stderr, "Can't open file %s: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
sbc-2.1/src/sbcdec.c:64:30: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(filename, 0)’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:57:14: acquire_resource: opened here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:30: danger: ‘open(filename, 0)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   62|   	}
#   63|   
#   64|-> 	if (read(fd, stream, st.st_size) != st.st_size) {
#   65|   		fprintf(stderr, "Can't read content of %s: %s\n",
#   66|   						filename, strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
sbc-2.1/src/sbcdec.c:67:17: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbcdec.c:66:68: branch_true: ...to here
sbc-2.1/src/sbcdec.c:67:17: throw: if ‘close’ throws an exception...
sbc-2.1/src/sbcdec.c:67:17: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   65|   		fprintf(stderr, "Can't read content of %s: %s\n",
#   66|   						filename, strerror(errno));
#   67|-> 		close(fd);
#   68|   		goto free;
#   69|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
sbc-2.1/src/sbcdec.c:71:9: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:71:9: throw: if ‘close’ throws an exception...
sbc-2.1/src/sbcdec.c:71:9: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#   69|   	}
#   70|   
#   71|-> 	close(fd);
#   72|   
#   73|   	pos = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
sbc-2.1/src/sbcdec.c:77:22: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:76:12: branch_true: following ‘true’ branch (when ‘tofile != 0’)...
sbc-2.1/src/sbcdec.c:77:22: branch_true: ...to here
sbc-2.1/src/sbcdec.c:77:22: throw: if ‘open’ throws an exception...
sbc-2.1/src/sbcdec.c:77:22: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   75|   
#   76|   	if (tofile)
#   77|-> 		ad = open(output, O_WRONLY | O_CREAT | O_TRUNC, 0644);
#   78|   	else
#   79|   		ad = open(output, O_WRONLY, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
sbc-2.1/src/sbcdec.c:79:22: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:76:12: branch_false: following ‘false’ branch (when ‘tofile == 0’)...
sbc-2.1/src/sbcdec.c:79:22: branch_false: ...to here
sbc-2.1/src/sbcdec.c:79:22: throw: if ‘open’ throws an exception...
sbc-2.1/src/sbcdec.c:79:22: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#   77|   		ad = open(output, O_WRONLY | O_CREAT | O_TRUNC, 0644);
#   78|   	else
#   79|-> 		ad = open(output, O_WRONLY, 0);
#   80|   
#   81|   	if (ad < 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
sbc-2.1/src/sbcdec.c:88:17: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:81:12: branch_false: following ‘false’ branch (when ‘ad >= 0’)...
sbc-2.1/src/sbcdec.c:87:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:87:12: branch_true: following ‘true’ branch (when ‘msbc != 0’)...
sbc-2.1/src/sbcdec.c:88:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:88:17: throw: if ‘sbc_init_msbc’ throws an exception...
sbc-2.1/src/sbcdec.c:88:17: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#   86|   
#   87|   	if (msbc)
#   88|-> 		sbc_init_msbc(&sbc, 0L);
#   89|   	else
#   90|   		sbc_init(&sbc, 0L);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
sbc-2.1/src/sbcdec.c:90:17: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:81:12: branch_false: following ‘false’ branch (when ‘ad >= 0’)...
sbc-2.1/src/sbcdec.c:87:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:87:12: branch_false: following ‘false’ branch (when ‘msbc == 0’)...
sbc-2.1/src/sbcdec.c:90:17: branch_false: ...to here
sbc-2.1/src/sbcdec.c:90:17: throw: if ‘sbc_init’ throws an exception...
sbc-2.1/src/sbcdec.c:90:17: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#   88|   		sbc_init_msbc(&sbc, 0L);
#   89|   	else
#   90|-> 		sbc_init(&sbc, 0L);
#   91|   	sbc.endian = SBC_BE;
#   92|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
sbc-2.1/src/sbcdec.c:93:20: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:81:12: branch_false: following ‘false’ branch (when ‘ad >= 0’)...
sbc-2.1/src/sbcdec.c:87:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:93:20: throw: if ‘sbc_decode’ throws an exception...
sbc-2.1/src/sbcdec.c:93:20: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#   91|   	sbc.endian = SBC_BE;
#   92|   
#   93|-> 	framelen = sbc_decode(&sbc, stream, streamlen, buf, sizeof(buf), &len);
#   94|   	channels = sbc.mode == SBC_MODE_MONO ? 1 : 2;
#   95|   	switch (sbc.frequency) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
sbc-2.1/src/sbcdec.c:135:27: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:43:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:49:25: branch_false: ...to here
sbc-2.1/src/sbcdec.c:49:18: acquire_memory: allocated here
sbc-2.1/src/sbcdec.c:51:12: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)...
sbc-2.1/src/sbcdec.c:57:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:58:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:64:30: branch_false: ...to here
sbc-2.1/src/sbcdec.c:64:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbcdec.c:71:9: branch_false: ...to here
sbc-2.1/src/sbcdec.c:81:12: branch_false: following ‘false’ branch (when ‘ad >= 0’)...
sbc-2.1/src/sbcdec.c:87:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:125:12: branch_true: following ‘true’ branch (when ‘tofile != 0’)...
sbc-2.1/src/sbcdec.c:128:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:135:27: throw: if ‘write’ throws an exception...
sbc-2.1/src/sbcdec.c:135:27: danger: ‘stream’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  133|   		au_hdr.channels    = BE_INT(channels);
#  134|   
#  135|-> 		written = write(ad, &au_hdr, sizeof(au_hdr));
#  136|   		if (written < (ssize_t) sizeof(au_hdr)) {
#  137|   			fprintf(stderr, "Failed to write header\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
sbc-2.1/src/sbcdec.c:170:35: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:236:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcdec.c:242:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
sbc-2.1/src/sbcdec.c:244:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:242:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcdec.c:274:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:278:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcdec.c:278:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:283:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: call_function: calling ‘decode’ from ‘main’
#  168|   			/* buffer is too full to stuff decoded audio in so it
#  169|   			 * must be written to the device */
#  170|-> 			written = write(ad, buf, count);
#  171|   			if (written > 0)
#  172|   				count -= written;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
sbc-2.1/src/sbcdec.c:187:28: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:236:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcdec.c:242:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
sbc-2.1/src/sbcdec.c:244:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:242:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcdec.c:274:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:278:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcdec.c:278:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:283:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: call_function: calling ‘decode’ from ‘main’
#  185|   		 * length of the file (!) */
#  186|   		pos += framelen;
#  187|-> 		framelen = sbc_decode(&sbc, stream + pos, streamlen - pos,
#  188|   					buf + count, sizeof(buf) - count, &len);
#  189|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
sbc-2.1/src/sbcdec.c:195:27: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:236:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcdec.c:242:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
sbc-2.1/src/sbcdec.c:244:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:242:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcdec.c:274:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:278:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcdec.c:278:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:283:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: call_function: calling ‘decode’ from ‘main’
#  193|   
#  194|   	if (count > 0) {
#  195|-> 		written = write(ad, buf, count);
#  196|   		if (written > 0)
#  197|   			count -= written;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
sbc-2.1/src/sbcdec.c:201:9: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’
sbc-2.1/src/sbcdec.c:236:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcdec.c:242:16: branch_true: following ‘true’ branch (when ‘opt != -1’)...
sbc-2.1/src/sbcdec.c:244:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:242:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcdec.c:274:14: branch_false: ...to here
sbc-2.1/src/sbcdec.c:278:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcdec.c:278:12: branch_false: ...to here
sbc-2.1/src/sbcdec.c:283:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)...
sbc-2.1/src/sbcdec.c:284:17: branch_true: ...to here
sbc-2.1/src/sbcdec.c:284:17: call_function: calling ‘decode’ from ‘main’
#  199|   
#  200|   close:
#  201|-> 	sbc_finish(&sbc);
#  202|   
#  203|   	close(ad);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def16]
sbc-2.1/src/sbcenc.c:64:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#   62|   						filename, strerror(errno));
#   63|   		else
#   64|-> 			perror("Can't read audio header");
#   65|   		goto done;
#   66|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def17]
sbc-2.1/src/sbcenc.c:73:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#   71|   			BE_INT(au_hdr.encoding) != AU_FMT_LIN16) {
#   72|   		fprintf(stderr, "Not in Sun/NeXT audio S16_BE format\n");
#   73|-> 		goto done;
#   74|   	}
#   75|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
sbc-2.1/src/sbcenc.c:79:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#   77|   
#   78|   	if (!msbc) {
#   79|-> 		sbc_init(&sbc, 0L);
#   80|   
#   81|   		switch (BE_INT(au_hdr.sample_rate)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
sbc-2.1/src/sbcenc.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  132|   		}
#  133|   
#  134|-> 		sbc_init_msbc(&sbc, 0);
#  135|   		sbc.endian = SBC_BE;
#  136|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
sbc-2.1/src/sbcenc.c:153:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  151|   	}
#  152|   
#  153|-> 	codesize = sbc_get_codesize(&sbc);
#  154|   	nframes = sizeof(input) / codesize;
#  155|   	while (1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def21]
sbc-2.1/src/sbcenc.c:161:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  159|   		if (size < 0) {
#  160|   			/* Something really bad happened */
#  161|-> 			perror("Can't read audio data");
#  162|   			break;
#  163|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
sbc-2.1/src/sbcenc.c:172:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  170|   		outp = output;
#  171|   		while (size >= codesize) {
#  172|-> 			len = sbc_encode(&sbc, inp, codesize,
#  173|   				outp, sizeof(output) - (outp - output),
#  174|   				&encoded);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def23]
sbc-2.1/src/sbcenc.c:185:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  183|   			outp += encoded;
#  184|   		}
#  185|-> 		len = write(fileno(stdout), output, outp - output);
#  186|   		if (len != outp - output) {
#  187|   			perror("Can't write SBC output");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def24]
sbc-2.1/src/sbcenc.c:187:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  185|   		len = write(fileno(stdout), output, outp - output);
#  186|   		if (len != outp - output) {
#  187|-> 			perror("Can't write SBC output");
#  188|   			break;
#  189|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def25]
sbc-2.1/src/sbcenc.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcenc.c:242:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcenc.c:248:16: branch_false: following ‘false’ branch (when ‘opt == -1’)...
sbc-2.1/src/sbcenc.c:302:14: branch_false: ...to here
sbc-2.1/src/sbcenc.c:306:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
sbc-2.1/src/sbcenc.c:306:12: branch_false: ...to here
sbc-2.1/src/sbcenc.c:311:21: branch_true: following ‘true’ branch (when ‘i < argc’)...
sbc-2.1/src/sbcenc.c:312:28: branch_true: ...to here
sbc-2.1/src/sbcenc.c:312:17: call_function: calling ‘encode’ from ‘main’
#  198|   	}
#  199|   
#  200|-> 	sbc_finish(&sbc);
#  201|   
#  202|   done:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def26]
sbc-2.1/src/sbcinfo.c:315:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
sbc-2.1/src/sbcinfo.c:317:5: enter_function: entry to ‘main’
sbc-2.1/src/sbcinfo.c:321:12: branch_false: following ‘false’ branch (when ‘argc > 1’)...
sbc-2.1/src/sbcinfo.c:321:12: branch_false: ...to here
sbc-2.1/src/sbcinfo.c:326:21: branch_true: following ‘true’ branch...
sbc-2.1/src/sbcinfo.c:326:21: branch_true: ...to here
sbc-2.1/src/sbcinfo.c:327:21: call_function: calling ‘analyze_file’ from ‘main’
#  313|   
#  314|   	return 0;
#  315|-> }
#  316|   
#  317|   int main(int argc, char *argv[])

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
sbc-2.1/src/sbctester.c:80:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_resource: opened here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:80:9: throw: if ‘sf_seek’ throws an exception...
sbc-2.1/src/sbctester.c:80:9: danger: ‘csv’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   78|   	}
#   79|   
#   80|-> 	sf_seek(sndref, 0, SEEK_SET);
#   81|   	sf_seek(sndtst, 0, SEEK_SET);
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
sbc-2.1/src/sbctester.c:80:9: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_memory: allocated here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:80:9: throw: if ‘sf_seek’ throws an exception...
sbc-2.1/src/sbctester.c:80:9: danger: ‘csv’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   78|   	}
#   79|   
#   80|-> 	sf_seek(sndref, 0, SEEK_SET);
#   81|   	sf_seek(sndtst, 0, SEEK_SET);
#   82|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def29]
sbc-2.1/src/sbctester.c:81:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_resource: opened here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:81:9: throw: if ‘sf_seek’ throws an exception...
sbc-2.1/src/sbctester.c:81:9: danger: ‘csv’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   79|   
#   80|   	sf_seek(sndref, 0, SEEK_SET);
#   81|-> 	sf_seek(sndtst, 0, SEEK_SET);
#   82|   
#   83|   	memset(rms_accu, 0, sizeof(rms_accu));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
sbc-2.1/src/sbctester.c:81:9: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_memory: allocated here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:81:9: throw: if ‘sf_seek’ throws an exception...
sbc-2.1/src/sbctester.c:81:9: danger: ‘csv’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#   79|   
#   80|   	sf_seek(sndref, 0, SEEK_SET);
#   81|-> 	sf_seek(sndtst, 0, SEEK_SET);
#   82|   
#   83|   	memset(rms_accu, 0, sizeof(rms_accu));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
sbc-2.1/src/sbctester.c:90:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_resource: opened here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:86:21: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:87:20: branch_true: ...to here
sbc-2.1/src/sbctester.c:87:20: branch_true: following ‘true’ branch (when ‘csv’ is non-NULL)...
sbc-2.1/src/sbctester.c:88:25: branch_true: ...to here
sbc-2.1/src/sbctester.c:90:22: throw: if ‘sf_read_short’ throws an exception...
sbc-2.1/src/sbctester.c:90:22: danger: ‘csv’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#   88|   			fprintf(csv, "%d;", i);
#   89|   
#   90|-> 		r1 = sf_read_short(sndref, refsample, infostst->channels);
#   91|   		if (r1 != infostst->channels) {
#   92|   			printf("Failed to read reference data: %s "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
sbc-2.1/src/sbctester.c:90:22: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_memory: allocated here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:86:21: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:87:20: branch_true: ...to here
sbc-2.1/src/sbctester.c:87:20: branch_true: following ‘true’ branch (when ‘csv’ is non-NULL)...
sbc-2.1/src/sbctester.c:88:25: branch_true: ...to here
sbc-2.1/src/sbctester.c:90:22: throw: if ‘sf_read_short’ throws an exception...
sbc-2.1/src/sbctester.c:90:22: danger: ‘csv’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#   88|   			fprintf(csv, "%d;", i);
#   89|   
#   90|-> 		r1 = sf_read_short(sndref, refsample, infostst->channels);
#   91|   		if (r1 != infostst->channels) {
#   92|   			printf("Failed to read reference data: %s "

Error: GCC_ANALYZER_WARNING (CWE-775): [#def33]
sbc-2.1/src/sbctester.c:92:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#   90|   		r1 = sf_read_short(sndref, refsample, infostst->channels);
#   91|   		if (r1 != infostst->channels) {
#   92|-> 			printf("Failed to read reference data: %s "
#   93|   					"(r1=%d, channels=%d)",
#   94|   					sf_strerror(sndref), r1,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
sbc-2.1/src/sbctester.c:92:25: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#   90|   		r1 = sf_read_short(sndref, refsample, infostst->channels);
#   91|   		if (r1 != infostst->channels) {
#   92|-> 			printf("Failed to read reference data: %s "
#   93|   					"(r1=%d, channels=%d)",
#   94|   					sf_strerror(sndref), r1,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
sbc-2.1/src/sbctester.c:101:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_resource: opened here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:86:21: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:87:20: branch_true: ...to here
sbc-2.1/src/sbctester.c:87:20: branch_true: following ‘true’ branch (when ‘csv’ is non-NULL)...
sbc-2.1/src/sbctester.c:88:25: branch_true: ...to here
sbc-2.1/src/sbctester.c:91:20: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:101:22: branch_false: ...to here
sbc-2.1/src/sbctester.c:101:22: throw: if ‘sf_read_short’ throws an exception...
sbc-2.1/src/sbctester.c:101:22: danger: ‘csv’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#   99|   		}
#  100|   
#  101|-> 		r2 = sf_read_short(sndtst, tstsample, infostst->channels);
#  102|   		if (r2 != infostst->channels) {
#  103|   			printf("Failed to read test data: %s "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
sbc-2.1/src/sbctester.c:101:22: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:70:12: branch_true: following ‘true’ branch (when ‘csvname’ is non-NULL)...
sbc-2.1/src/sbctester.c:71:23: branch_true: ...to here
sbc-2.1/src/sbctester.c:71:23: acquire_memory: allocated here
sbc-2.1/src/sbctester.c:73:12: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:74:17: branch_true: ...to here
sbc-2.1/src/sbctester.c:86:21: branch_true: following ‘true’ branch...
sbc-2.1/src/sbctester.c:87:20: branch_true: ...to here
sbc-2.1/src/sbctester.c:87:20: branch_true: following ‘true’ branch (when ‘csv’ is non-NULL)...
sbc-2.1/src/sbctester.c:88:25: branch_true: ...to here
sbc-2.1/src/sbctester.c:91:20: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:101:22: branch_false: ...to here
sbc-2.1/src/sbctester.c:101:22: throw: if ‘sf_read_short’ throws an exception...
sbc-2.1/src/sbctester.c:101:22: danger: ‘csv’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#   99|   		}
#  100|   
#  101|-> 		r2 = sf_read_short(sndtst, tstsample, infostst->channels);
#  102|   		if (r2 != infostst->channels) {
#  103|   			printf("Failed to read test data: %s "

Error: GCC_ANALYZER_WARNING (CWE-775): [#def37]
sbc-2.1/src/sbctester.c:103:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#  101|   		r2 = sf_read_short(sndtst, tstsample, infostst->channels);
#  102|   		if (r2 != infostst->channels) {
#  103|-> 			printf("Failed to read test data: %s "
#  104|   					"(r2=%d, channels=%d)\n",
#  105|   					sf_strerror(sndtst), r2,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
sbc-2.1/src/sbctester.c:103:25: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#  101|   		r2 = sf_read_short(sndtst, tstsample, infostst->channels);
#  102|   		if (r2 != infostst->channels) {
#  103|-> 			printf("Failed to read test data: %s "
#  104|   					"(r2=%d, channels=%d)\n",
#  105|   					sf_strerror(sndtst), r2,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
sbc-2.1/src/sbctester.c:153:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#  151|   
#  152|   	return verdict;
#  153|-> }
#  154|   
#  155|   static int check_absolute_diff(SNDFILE * sndref, SF_INFO * infosref,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
sbc-2.1/src/sbctester.c:153:1: warning[-Wanalyzer-malloc-leak]: leak of ‘csv’
sbc-2.1/src/sbctester.c:253:5: enter_function: entry to ‘main’
sbc-2.1/src/sbctester.c:263:12: branch_false: following ‘false’ branch (when ‘argc != 2’)...
sbc-2.1/src/sbctester.c:272:12: branch_false: ...to here
sbc-2.1/src/sbctester.c:272:12: branch_false: following ‘false’ branch (when ‘argc > 2’)...
sbc-2.1/src/sbctester.c:277:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:283:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:288:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:290:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:296:9: branch_false: ...to here
sbc-2.1/src/sbctester.c:304:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:310:12: branch_false: following ‘false’ branch...
sbc-2.1/src/sbctester.c:320:20: call_function: calling ‘calculate_rms_level’ from ‘main’
#  151|   
#  152|   	return verdict;
#  153|-> }
#  154|   
#  155|   static int check_absolute_diff(SNDFILE * sndref, SF_INFO * infosref,

Error: COMPILER_WARNING: [#def41]
sbc-2.1/src/sbctester.c: scope_hint: In function ‘check_absolute_diff’
sbc-2.1/src/sbctester.c:164:13: warning[-Wunused-but-set-variable=]: variable ‘calc_count’ set but not used
#  164 |         int calc_count = 0;
#      |             ^~~~~~~~~~
#  162|   	double rms_absolute = 1.0 / (pow(2, accuracy - 2));
#  163|   	double calc_max[MAXCHANNELS];
#  164|-> 	int calc_count = 0;
#  165|   	short r1, r2;
#  166|   	double cur_diff;

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-50.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-namesbc-2.1-1.fc44
store-results-to/tmp/tmps2huckyy/sbc-2.1-1.fc44.tar.xz
time-created2026-01-08 21:43:50
time-finished2026-01-08 21:45:08
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmps2huckyy/sbc-2.1-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmps2huckyy/sbc-2.1-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9