samba-4.23.4-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-457): [#def1]
/usr/bin/smbprint:50:21: warning[SC2154]: acct_file is referenced but not assigned.
#   48|   #
#   49|   eval acct_file="\${$#}"
#   50|-> spool_dir=$(dirname $acct_file)
#   51|   config_file=$spool_dir/.config
#   52|   

Error: SHELLCHECK_WARNING (CWE-156): [#def2]
/usr/bin/smbprint:59:6: warning[SC2046]: Quote this to prevent word splitting.
#   57|   #   password
#   58|   
#   59|-> eval $(cat $config_file)
#   60|   
#   61|   share=$(echo $share | sed "s/[\]/\//g")

Error: SHELLCHECK_WARNING (CWE-457): [#def3]
/usr/bin/smbprint:63:7: warning[SC2154]: user is referenced but not assigned.
#   61|   share=$(echo $share | sed "s/[\]/\//g")
#   62|   
#   63|-> if [ "$user" != "" ]; then
#   64|   	usercmd="-U"
#   65|   else

Error: SHELLCHECK_WARNING (CWE-457): [#def4]
/usr/bin/smbprint:69:7: warning[SC2154]: workgroup is referenced but not assigned.
#   67|   fi
#   68|   
#   69|-> if [ "$workgroup" != "" ]; then
#   70|   	workgroupcmd="-W"
#   71|   else

Error: SHELLCHECK_WARNING (CWE-457): [#def5]
/usr/bin/smbprint:75:7: warning[SC2154]: translate is referenced but not assigned.
#   73|   fi
#   74|   
#   75|-> if [ "$translate" = "yes" ]; then
#   76|   	command="translate ; print -"
#   77|   else

Error: SHELLCHECK_WARNING (CWE-457): [#def6]
/usr/bin/smbprint:82:36: warning[SC2154]: password is referenced but not assigned.
#   80|   #echo $share $password $translate $x_command > /tmp/smbprint.log
#   81|   
#   82|-> cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \
#   83|   	$hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \
#   84|   	-c "$command" 2>/dev/null

Error: SHELLCHECK_WARNING (CWE-156): [#def7]
/usr/bin/smbtar:160:7: warning[SC2046]: Quote this to prevent word splitting.
#  158|   done
#  159|   
#  160|-> shift $(expr $OPTIND - 1)
#  161|   
#  162|   if [ "$server" = "" ] || [ "$service" = "" ]; then

Error: SHELLCHECK_WARNING (CWE-398): [#def8]
/usr/share/doc/samba/LDAP/get_next_oid:3:41: warning[SC2062]: Quote the grep pattern so the shell won't interpret it.
#    1|   #!/bin/bash
#    2|   
#    3|-> nextattrib=$(cat samba.schema | grep -i attributetype.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' |
#    4|   	awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1)
#    5|   

Error: SHELLCHECK_WARNING (CWE-398): [#def9]
/usr/share/doc/samba/LDAP/get_next_oid:10:37: warning[SC2062]: Quote the grep pattern so the shell won't interpret it.
#    8|   echo "attributetype ( 1.3.6.1.4.1.7165.2.1.$nextattrib NAME ...."
#    9|   
#   10|-> nextoc=$(cat samba.schema | grep -i objectclass.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' |
#   11|   	awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1)
#   12|   

Error: COMPILER_WARNING (CWE-704): [#def10]
samba-4.23.4/auth/credentials/credentials.c: scope_hint: In function ‘cli_credentials_get_principal_and_obtained’
samba-4.23.4/auth/credentials/credentials.c:397:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  397 |                         p = strchr(cred->principal, '@');
#      |                           ^
#  395|   			}
#  396|   
#  397|-> 			p = strchr(cred->principal, '@');
#  398|   			if (p != NULL) {
#  399|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def11]
samba-4.23.4/auth/credentials/credentials.c:397:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  395|   			}
#  396|   
#  397|-> 			p = strchr(cred->principal, '@');
#  398|   			if (p != NULL) {
#  399|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def12]
samba-4.23.4/auth/credentials/credentials.c: scope_hint: In function ‘cli_credentials_set_principal’
samba-4.23.4/auth/credentials/credentials.c:487:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  487 |                         char *p = strchr(val, '@');
#      |                                   ^~~~~~
#  485|   		cred->principal = NULL;
#  486|   		if (val != NULL) {
#  487|-> 			char *p = strchr(val, '@');
#  488|   			if (p != NULL) {
#  489|   				/* For realm names, only ASCII is allowed */

Error: COMPILER_WARNING (CWE-704): [#def13]
samba-4.23.4/auth/credentials/credentials.c:487:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  485|   		cred->principal = NULL;
#  486|   		if (val != NULL) {
#  487|-> 			char *p = strchr(val, '@');
#  488|   			if (p != NULL) {
#  489|   				/* For realm names, only ASCII is allowed */

Error: COMPILER_WARNING (CWE-704): [#def14]
samba-4.23.4/auth/credentials/credentials.c:500:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  500 |                         p = strchr(cred->principal, '@');
#      |                           ^
#  498|   			}
#  499|   
#  500|-> 			p = strchr(cred->principal, '@');
#  501|   			if (p != NULL) {
#  502|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def15]
samba-4.23.4/auth/credentials/credentials.c:500:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  498|   			}
#  499|   
#  500|-> 			p = strchr(cred->principal, '@');
#  501|   			if (p != NULL) {
#  502|   				p += 1;

Error: COMPILER_WARNING (CWE-477): [#def16]
samba-4.23.4/auth/gensec/gensec.c: scope_hint: In function ‘gensec_update’
samba-4.23.4/auth/gensec/gensec.c:382:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  382 |         tevent_loop_allow_nesting(ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/auth/gensec/gensec.c:26: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#  380|   	 * are fixed.
#  381|   	 */
#  382|-> 	tevent_loop_allow_nesting(ev);
#  383|   
#  384|   	subreq = gensec_update_send(frame, ev, gensec_security, in);

Error: COMPILER_WARNING (CWE-477): [#def17]
samba-4.23.4/auth/gensec/gensec.c:382:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  380|   	 * are fixed.
#  381|   	 */
#  382|-> 	tevent_loop_allow_nesting(ev);
#  383|   
#  384|   	subreq = gensec_update_send(frame, ev, gensec_security, in);

Error: CPPCHECK_WARNING (CWE-758): [#def18]
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c:2: error[missingReturn]: Found an exit path from function with non-void return type that has missing return statement

Error: CPPCHECK_WARNING (CWE-404): [#def19]
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c:2: error[resourceLeak]: Resource leak: f

Error: COMPILER_WARNING (CWE-563): [#def20]
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c: scope_hint: In function ‘lib_func’
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c:2:28: warning[-Wunused-variable]: unused variable ‘f’
#    2 | int lib_func(void) { FILE *f = fopen("foo", "r");}
#      |                            ^

Error: GCC_ANALYZER_WARNING (CWE-457): [#def21]
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c:2:50: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<return-value>’

Error: COMPILER_WARNING (CWE-393): [#def22]
samba-4.23.4/bin/.conf_check_7983482e19abcf7ecc45fcaf70f17448/libdir/liblc1.c:2:50: warning[-Wreturn-type]: control reaches end of non-void function
#    2 | int lib_func(void) { FILE *f = fopen("foo", "r");}
#      |                                                  ^

Error: GCC_ANALYZER_WARNING (CWE-476): [#def23]
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1711:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1590:10: enter_function: entry to ‘__claims_tf_yy_restart’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1595:9: call_function: calling ‘__claims_tf_yy_ensure_buffer_stack’ from ‘__claims_tf_yy_restart’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1595:9: return_function: returning to ‘__claims_tf_yy_restart’ from ‘__claims_tf_yy_ensure_buffer_stack’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1597:13: call_function: calling ‘__claims_tf_yy__create_buffer’ from ‘__claims_tf_yy_restart’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1597:13: return_function: returning to ‘__claims_tf_yy_restart’ from ‘__claims_tf_yy__create_buffer’
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1600:9: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1600:9: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.lex.c:1600:9: call_function: calling ‘__claims_tf_yy__init_buffer’ from ‘__claims_tf_yy_restart’
# 1709|   	yy_flush_buffer( b , yyscanner);
# 1710|   
# 1711|-> 	b->yy_input_file = file;
# 1712|   	b->yy_fill_buffer = 1;
# 1713|   

Error: COMPILER_WARNING: [#def24]
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c: scope_hint: In function ‘__claims_tf_yy_parse’
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:74:25: warning[-Wunused-but-set-variable=]: variable ‘__claims_tf_yy_nerrs’ set but not used
#   74 | #define yynerrs         __claims_tf_yy_nerrs
#      |                         ^~~~~~~~~~~~~~~~~~~~
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1360:9: note: in expansion of macro ‘yynerrs’
# 1360 |     int yynerrs = 0;
#      |         ^~~~~~~
#   72|   #define yyerror         __claims_tf_yy_error
#   73|   #define yydebug         __claims_tf_yy_debug
#   74|-> #define yynerrs         __claims_tf_yy_nerrs
#   75|   
#   76|   /* First part of user prologue.  */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1439:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1508:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1508:6: branch_false: following ‘false’ branch (when ‘yystate != 22’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1511:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1523:6: branch_false: following ‘false’ branch (when ‘yyn != -50’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1529:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1529:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1532:16: branch_true: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1541:11: branch_false: following ‘false’ branch (when ‘yychar != 256’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1554:17: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1561:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1564:6: branch_false: following ‘false’ branch (when ‘yyn > 0’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1574:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1574:6: branch_false: following ‘false’ branch (when ‘yyerrstatus == 0’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1581:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1439:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1445:28: branch_true: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1471:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1473:7: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1480:11: acquire_memory: allocated here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1482:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1488:12: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1488:12: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1502:10: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1508:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1508:6: branch_false: following ‘false’ branch (when ‘yystate != 22’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1511:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1523:6: branch_false: following ‘false’ branch (when ‘yyn != -50’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1529:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1529:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1532:16: branch_true: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1532:16: throw: if ‘__claims_tf_yy_lex’ throws an exception...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: danger: ‘yyptr’ leaks here; was allocated at [(21)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/20)
# 1482|           if (! yyptr)
# 1483|             YYNOMEM;
# 1484|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1485|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1486|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def26]
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1439:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1445:28: branch_true: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1471:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1473:7: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1482:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: branch_false: ...to here
samba-4.23.4/bin/default/libcli/security/claims_transformation.tab.c:1484:9: danger: use of uninitialized value ‘yyss’ here
# 1482|           if (! yyptr)
# 1483|             YYNOMEM;
# 1484|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1485|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1486|           YYSTACK_RELOCATE (yyls_alloc, yyls);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1648:54: warning[-Wanalyzer-malloc-leak]: leak of ‘yyalloc(64, yyscanner)’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1635:21: enter_function: entry to ‘yy_create_buffer’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1639:24: call_function: calling ‘yyalloc’ from ‘yy_create_buffer’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1639:24: return_function: returning to ‘yy_create_buffer’ from ‘yyalloc’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1640:12: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1643:2: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1648:54: danger: ‘yyalloc(64, yyscanner)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 1646|   	/* yy_ch_buf has to be 2 characters longer than the size given because
# 1647|   	 * we need to put in 2 end-of-buffer characters.
# 1648|-> 	 */
# 1649|   	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1650|   	if ( ! b->yy_ch_buf )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def28]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1691:2: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘b’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1570:10: enter_function: entry to ‘yyrestart’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1575:16: call_function: calling ‘yyensure_buffer_stack’ from ‘yyrestart’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1575:16: return_function: returning to ‘yyrestart’ from ‘yyensure_buffer_stack’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1577:27: call_function: calling ‘yy_create_buffer’ from ‘yyrestart’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1577:27: return_function: returning to ‘yyrestart’ from ‘yy_create_buffer’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1580:2: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1580:2: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1580:2: call_function: calling ‘yy_init_buffer’ from ‘yyrestart’
# 1689|   
# 1690|   	yy_flush_buffer( b , yyscanner);
# 1691|-> 
# 1692|   	b->yy_input_file = file;
# 1693|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1909:26: warning[-Wanalyzer-malloc-leak]: leak of ‘yyalloc(n,  yyscanner)’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1893:17: enter_function: entry to ‘yy_scan_bytes’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1902:24: call_function: calling ‘yyalloc’ from ‘yy_scan_bytes’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1902:24: return_function: returning to ‘yy_scan_bytes’ from ‘yyalloc’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1903:12: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1903:12: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_lexer.c:1911:6: call_function: calling ‘yy_scan_buffer’ from ‘yy_scan_bytes’
# 1907|   	for ( i = 0; i < _yybytes_len; ++i )
# 1908|   		buf[i] = yybytes[i];
# 1909|-> 
# 1910|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1911|   

Error: COMPILER_WARNING: [#def30]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c: scope_hint: In function ‘yyparse’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:980:9: warning[-Wunused-but-set-variable=]: variable ‘yynerrs’ set but not used
#  980 |     int yynerrs = 0;
#      |         ^~~~~~~
#  978|   
#  979|       /* Number of syntax errors so far.  */
#  980|->     int yynerrs = 0;
#  981|   
#  982|       yy_state_fast_t yystate = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: warning[-Wanalyzer-malloc-leak]: leak of ‘yyptr’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1046:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: following ‘false’ branch (when ‘yystate != 15’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1113:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1125:6: branch_false: following ‘false’ branch (when ‘yyn != -60’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1134:16: branch_true: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1143:11: branch_false: following ‘false’ branch (when ‘yychar != 256’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1155:17: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1162:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1165:6: branch_false: following ‘false’ branch (when ‘yyn > 0’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1175:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1175:6: branch_false: following ‘false’ branch (when ‘yyerrstatus == 0’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1182:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1046:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: following ‘false’ branch (when ‘yystate != 15’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1113:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1125:6: branch_false: following ‘false’ branch (when ‘yyn != -60’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1134:16: branch_true: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1162:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1165:6: branch_false: following ‘false’ branch (when ‘yyn > 0’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1175:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1175:6: branch_false: following ‘false’ branch (when ‘yyerrstatus == 0’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1182:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1046:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1052:28: branch_true: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1075:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1077:7: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1084:11: acquire_memory: allocated here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1086:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1091:12: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1091:12: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1104:10: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1110:6: branch_false: following ‘false’ branch (when ‘yystate != 15’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1113:3: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1125:6: branch_false: following ‘false’ branch (when ‘yyn != -60’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1131:6: branch_true: following ‘true’ branch (when ‘yychar == -2’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1134:16: branch_true: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1134:16: throw: if ‘yylex’ throws an exception...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: danger: ‘yyptr’ leaks here; was allocated at [(35)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/34)
# 1086|           if (! yyptr)
# 1087|             YYNOMEM;
# 1088|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1089|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1090|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def32]
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1046:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1052:28: branch_true: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1075:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1077:7: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1086:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: branch_false: ...to here
samba-4.23.4/bin/default/libcli/wsp/wsp_aqs_parser.tab.c:1088:9: danger: use of uninitialized value ‘yyss’ here
# 1086|           if (! yyptr)
# 1087|             YYNOMEM;
# 1088|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1089|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1090|   #  undef YYSTACK_RELOCATE

Error: COMPILER_WARNING (CWE-1164): [#def33]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:89:13: warning[-Wunused-function]: ‘ndr_print_flags_domsid’ defined but not used
#   89 | static void ndr_print_flags_domsid(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct domsid *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~
#   87|   }
#   88|   
#   89|-> static void ndr_print_flags_domsid(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct domsid *r)
#   90|   {
#   91|   	ndr_print_domsid(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def34]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:228:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_100’ defined but not used
#  228 | static void ndr_print_flags_SERVER_INFO_100(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_100 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  226|   }
#  227|   
#  228|-> static void ndr_print_flags_SERVER_INFO_100(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_100 *r)
#  229|   {
#  230|   	ndr_print_SERVER_INFO_100(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def35]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:279:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_101’ defined but not used
#  279 | static void ndr_print_flags_SERVER_INFO_101(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_101 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  277|   }
#  278|   
#  279|-> static void ndr_print_flags_SERVER_INFO_101(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_101 *r)
#  280|   {
#  281|   	ndr_print_SERVER_INFO_101(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def36]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:348:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_102’ defined but not used
#  348 | static void ndr_print_flags_SERVER_INFO_102(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_102 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  346|   }
#  347|   
#  348|-> static void ndr_print_flags_SERVER_INFO_102(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_102 *r)
#  349|   {
#  350|   	ndr_print_SERVER_INFO_102(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def37]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:460:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_402’ defined but not used
#  460 | static void ndr_print_flags_SERVER_INFO_402(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_402 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  458|   }
#  459|   
#  460|-> static void ndr_print_flags_SERVER_INFO_402(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_402 *r)
#  461|   {
#  462|   	ndr_print_SERVER_INFO_402(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def38]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:596:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_403’ defined but not used
#  596 | static void ndr_print_flags_SERVER_INFO_403(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_403 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  594|   }
#  595|   
#  596|-> static void ndr_print_flags_SERVER_INFO_403(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_403 *r)
#  597|   {
#  598|   	ndr_print_SERVER_INFO_403(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def39]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:703:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_502’ defined but not used
#  703 | static void ndr_print_flags_SERVER_INFO_502(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_502 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  701|   }
#  702|   
#  703|-> static void ndr_print_flags_SERVER_INFO_502(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_502 *r)
#  704|   {
#  705|   	ndr_print_SERVER_INFO_502(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def40]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:842:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_503’ defined but not used
#  842 | static void ndr_print_flags_SERVER_INFO_503(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_503 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  840|   }
#  841|   
#  842|-> static void ndr_print_flags_SERVER_INFO_503(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_503 *r)
#  843|   {
#  844|   	ndr_print_SERVER_INFO_503(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def41]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1033:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_599’ defined but not used
# 1033 | static void ndr_print_flags_SERVER_INFO_599(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_599 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1031|   }
# 1032|   
# 1033|-> static void ndr_print_flags_SERVER_INFO_599(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_599 *r)
# 1034|   {
# 1035|   	ndr_print_SERVER_INFO_599(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def42]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1210:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_598’ defined but not used
# 1210 | static void ndr_print_flags_SERVER_INFO_598(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_598 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1208|   }
# 1209|   
# 1210|-> static void ndr_print_flags_SERVER_INFO_598(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_598 *r)
# 1211|   {
# 1212|   	ndr_print_SERVER_INFO_598(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def43]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1291:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1005’ defined but not used
# 1291 | static void ndr_print_flags_SERVER_INFO_1005(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1005 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1289|   }
# 1290|   
# 1291|-> static void ndr_print_flags_SERVER_INFO_1005(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1005 *r)
# 1292|   {
# 1293|   	ndr_print_SERVER_INFO_1005(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def44]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1331:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1107’ defined but not used
# 1331 | static void ndr_print_flags_SERVER_INFO_1107(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1107 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1329|   }
# 1330|   
# 1331|-> static void ndr_print_flags_SERVER_INFO_1107(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1107 *r)
# 1332|   {
# 1333|   	ndr_print_SERVER_INFO_1107(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def45]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1371:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1010’ defined but not used
# 1371 | static void ndr_print_flags_SERVER_INFO_1010(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1010 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1369|   }
# 1370|   
# 1371|-> static void ndr_print_flags_SERVER_INFO_1010(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1010 *r)
# 1372|   {
# 1373|   	ndr_print_SERVER_INFO_1010(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def46]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1411:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1016’ defined but not used
# 1411 | static void ndr_print_flags_SERVER_INFO_1016(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1016 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1409|   }
# 1410|   
# 1411|-> static void ndr_print_flags_SERVER_INFO_1016(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1016 *r)
# 1412|   {
# 1413|   	ndr_print_SERVER_INFO_1016(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def47]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1451:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1017’ defined but not used
# 1451 | static void ndr_print_flags_SERVER_INFO_1017(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1017 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1449|   }
# 1450|   
# 1451|-> static void ndr_print_flags_SERVER_INFO_1017(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1017 *r)
# 1452|   {
# 1453|   	ndr_print_SERVER_INFO_1017(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def48]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1491:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1018’ defined but not used
# 1491 | static void ndr_print_flags_SERVER_INFO_1018(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1018 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1489|   }
# 1490|   
# 1491|-> static void ndr_print_flags_SERVER_INFO_1018(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1018 *r)
# 1492|   {
# 1493|   	ndr_print_SERVER_INFO_1018(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def49]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1531:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1501’ defined but not used
# 1531 | static void ndr_print_flags_SERVER_INFO_1501(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1501 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1529|   }
# 1530|   
# 1531|-> static void ndr_print_flags_SERVER_INFO_1501(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1501 *r)
# 1532|   {
# 1533|   	ndr_print_SERVER_INFO_1501(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def50]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1571:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1502’ defined but not used
# 1571 | static void ndr_print_flags_SERVER_INFO_1502(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1502 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1569|   }
# 1570|   
# 1571|-> static void ndr_print_flags_SERVER_INFO_1502(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1502 *r)
# 1572|   {
# 1573|   	ndr_print_SERVER_INFO_1502(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def51]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1611:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1503’ defined but not used
# 1611 | static void ndr_print_flags_SERVER_INFO_1503(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1503 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1609|   }
# 1610|   
# 1611|-> static void ndr_print_flags_SERVER_INFO_1503(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1503 *r)
# 1612|   {
# 1613|   	ndr_print_SERVER_INFO_1503(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def52]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1651:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1506’ defined but not used
# 1651 | static void ndr_print_flags_SERVER_INFO_1506(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1506 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1649|   }
# 1650|   
# 1651|-> static void ndr_print_flags_SERVER_INFO_1506(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1506 *r)
# 1652|   {
# 1653|   	ndr_print_SERVER_INFO_1506(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def53]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1691:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1509’ defined but not used
# 1691 | static void ndr_print_flags_SERVER_INFO_1509(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1509 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1689|   }
# 1690|   
# 1691|-> static void ndr_print_flags_SERVER_INFO_1509(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1509 *r)
# 1692|   {
# 1693|   	ndr_print_SERVER_INFO_1509(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def54]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1731:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1510’ defined but not used
# 1731 | static void ndr_print_flags_SERVER_INFO_1510(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1510 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1729|   }
# 1730|   
# 1731|-> static void ndr_print_flags_SERVER_INFO_1510(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1510 *r)
# 1732|   {
# 1733|   	ndr_print_SERVER_INFO_1510(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def55]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1771:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1511’ defined but not used
# 1771 | static void ndr_print_flags_SERVER_INFO_1511(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1511 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1769|   }
# 1770|   
# 1771|-> static void ndr_print_flags_SERVER_INFO_1511(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1511 *r)
# 1772|   {
# 1773|   	ndr_print_SERVER_INFO_1511(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def56]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1811:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1512’ defined but not used
# 1811 | static void ndr_print_flags_SERVER_INFO_1512(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1512 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1809|   }
# 1810|   
# 1811|-> static void ndr_print_flags_SERVER_INFO_1512(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1512 *r)
# 1812|   {
# 1813|   	ndr_print_SERVER_INFO_1512(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def57]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1851:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1513’ defined but not used
# 1851 | static void ndr_print_flags_SERVER_INFO_1513(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1513 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1849|   }
# 1850|   
# 1851|-> static void ndr_print_flags_SERVER_INFO_1513(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1513 *r)
# 1852|   {
# 1853|   	ndr_print_SERVER_INFO_1513(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def58]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1891:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1514’ defined but not used
# 1891 | static void ndr_print_flags_SERVER_INFO_1514(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1514 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1889|   }
# 1890|   
# 1891|-> static void ndr_print_flags_SERVER_INFO_1514(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1514 *r)
# 1892|   {
# 1893|   	ndr_print_SERVER_INFO_1514(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def59]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1931:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1515’ defined but not used
# 1931 | static void ndr_print_flags_SERVER_INFO_1515(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1515 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1929|   }
# 1930|   
# 1931|-> static void ndr_print_flags_SERVER_INFO_1515(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1515 *r)
# 1932|   {
# 1933|   	ndr_print_SERVER_INFO_1515(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def60]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:1971:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1516’ defined but not used
# 1971 | static void ndr_print_flags_SERVER_INFO_1516(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1516 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1969|   }
# 1970|   
# 1971|-> static void ndr_print_flags_SERVER_INFO_1516(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1516 *r)
# 1972|   {
# 1973|   	ndr_print_SERVER_INFO_1516(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def61]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2011:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1518’ defined but not used
# 2011 | static void ndr_print_flags_SERVER_INFO_1518(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1518 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2009|   }
# 2010|   
# 2011|-> static void ndr_print_flags_SERVER_INFO_1518(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1518 *r)
# 2012|   {
# 2013|   	ndr_print_SERVER_INFO_1518(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def62]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2051:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1520’ defined but not used
# 2051 | static void ndr_print_flags_SERVER_INFO_1520(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1520 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2049|   }
# 2050|   
# 2051|-> static void ndr_print_flags_SERVER_INFO_1520(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1520 *r)
# 2052|   {
# 2053|   	ndr_print_SERVER_INFO_1520(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def63]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2091:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1521’ defined but not used
# 2091 | static void ndr_print_flags_SERVER_INFO_1521(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1521 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2089|   }
# 2090|   
# 2091|-> static void ndr_print_flags_SERVER_INFO_1521(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1521 *r)
# 2092|   {
# 2093|   	ndr_print_SERVER_INFO_1521(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def64]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2131:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1522’ defined but not used
# 2131 | static void ndr_print_flags_SERVER_INFO_1522(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1522 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2129|   }
# 2130|   
# 2131|-> static void ndr_print_flags_SERVER_INFO_1522(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1522 *r)
# 2132|   {
# 2133|   	ndr_print_SERVER_INFO_1522(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def65]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2171:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1523’ defined but not used
# 2171 | static void ndr_print_flags_SERVER_INFO_1523(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1523 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2169|   }
# 2170|   
# 2171|-> static void ndr_print_flags_SERVER_INFO_1523(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1523 *r)
# 2172|   {
# 2173|   	ndr_print_SERVER_INFO_1523(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def66]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2211:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1524’ defined but not used
# 2211 | static void ndr_print_flags_SERVER_INFO_1524(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1524 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2209|   }
# 2210|   
# 2211|-> static void ndr_print_flags_SERVER_INFO_1524(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1524 *r)
# 2212|   {
# 2213|   	ndr_print_SERVER_INFO_1524(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def67]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2251:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1525’ defined but not used
# 2251 | static void ndr_print_flags_SERVER_INFO_1525(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1525 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2249|   }
# 2250|   
# 2251|-> static void ndr_print_flags_SERVER_INFO_1525(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1525 *r)
# 2252|   {
# 2253|   	ndr_print_SERVER_INFO_1525(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def68]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2291:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1528’ defined but not used
# 2291 | static void ndr_print_flags_SERVER_INFO_1528(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1528 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2289|   }
# 2290|   
# 2291|-> static void ndr_print_flags_SERVER_INFO_1528(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1528 *r)
# 2292|   {
# 2293|   	ndr_print_SERVER_INFO_1528(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def69]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2331:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1529’ defined but not used
# 2331 | static void ndr_print_flags_SERVER_INFO_1529(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1529 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2329|   }
# 2330|   
# 2331|-> static void ndr_print_flags_SERVER_INFO_1529(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1529 *r)
# 2332|   {
# 2333|   	ndr_print_SERVER_INFO_1529(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def70]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2371:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1530’ defined but not used
# 2371 | static void ndr_print_flags_SERVER_INFO_1530(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1530 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2369|   }
# 2370|   
# 2371|-> static void ndr_print_flags_SERVER_INFO_1530(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1530 *r)
# 2372|   {
# 2373|   	ndr_print_SERVER_INFO_1530(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def71]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2411:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1533’ defined but not used
# 2411 | static void ndr_print_flags_SERVER_INFO_1533(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1533 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2409|   }
# 2410|   
# 2411|-> static void ndr_print_flags_SERVER_INFO_1533(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1533 *r)
# 2412|   {
# 2413|   	ndr_print_SERVER_INFO_1533(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def72]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2451:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1534’ defined but not used
# 2451 | static void ndr_print_flags_SERVER_INFO_1534(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1534 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2449|   }
# 2450|   
# 2451|-> static void ndr_print_flags_SERVER_INFO_1534(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1534 *r)
# 2452|   {
# 2453|   	ndr_print_SERVER_INFO_1534(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def73]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2491:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1535’ defined but not used
# 2491 | static void ndr_print_flags_SERVER_INFO_1535(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1535 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2489|   }
# 2490|   
# 2491|-> static void ndr_print_flags_SERVER_INFO_1535(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1535 *r)
# 2492|   {
# 2493|   	ndr_print_SERVER_INFO_1535(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def74]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2531:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1536’ defined but not used
# 2531 | static void ndr_print_flags_SERVER_INFO_1536(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1536 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2529|   }
# 2530|   
# 2531|-> static void ndr_print_flags_SERVER_INFO_1536(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1536 *r)
# 2532|   {
# 2533|   	ndr_print_SERVER_INFO_1536(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def75]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2571:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1537’ defined but not used
# 2571 | static void ndr_print_flags_SERVER_INFO_1537(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1537 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2569|   }
# 2570|   
# 2571|-> static void ndr_print_flags_SERVER_INFO_1537(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1537 *r)
# 2572|   {
# 2573|   	ndr_print_SERVER_INFO_1537(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def76]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2611:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1538’ defined but not used
# 2611 | static void ndr_print_flags_SERVER_INFO_1538(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1538 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2609|   }
# 2610|   
# 2611|-> static void ndr_print_flags_SERVER_INFO_1538(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1538 *r)
# 2612|   {
# 2613|   	ndr_print_SERVER_INFO_1538(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def77]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2651:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1539’ defined but not used
# 2651 | static void ndr_print_flags_SERVER_INFO_1539(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1539 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2649|   }
# 2650|   
# 2651|-> static void ndr_print_flags_SERVER_INFO_1539(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1539 *r)
# 2652|   {
# 2653|   	ndr_print_SERVER_INFO_1539(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def78]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2691:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1540’ defined but not used
# 2691 | static void ndr_print_flags_SERVER_INFO_1540(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1540 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2689|   }
# 2690|   
# 2691|-> static void ndr_print_flags_SERVER_INFO_1540(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1540 *r)
# 2692|   {
# 2693|   	ndr_print_SERVER_INFO_1540(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def79]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2731:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1541’ defined but not used
# 2731 | static void ndr_print_flags_SERVER_INFO_1541(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1541 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2729|   }
# 2730|   
# 2731|-> static void ndr_print_flags_SERVER_INFO_1541(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1541 *r)
# 2732|   {
# 2733|   	ndr_print_SERVER_INFO_1541(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def80]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2771:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1542’ defined but not used
# 2771 | static void ndr_print_flags_SERVER_INFO_1542(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1542 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2769|   }
# 2770|   
# 2771|-> static void ndr_print_flags_SERVER_INFO_1542(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1542 *r)
# 2772|   {
# 2773|   	ndr_print_SERVER_INFO_1542(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def81]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2811:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1543’ defined but not used
# 2811 | static void ndr_print_flags_SERVER_INFO_1543(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1543 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2809|   }
# 2810|   
# 2811|-> static void ndr_print_flags_SERVER_INFO_1543(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1543 *r)
# 2812|   {
# 2813|   	ndr_print_SERVER_INFO_1543(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def82]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2851:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1544’ defined but not used
# 2851 | static void ndr_print_flags_SERVER_INFO_1544(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1544 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2849|   }
# 2850|   
# 2851|-> static void ndr_print_flags_SERVER_INFO_1544(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1544 *r)
# 2852|   {
# 2853|   	ndr_print_SERVER_INFO_1544(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def83]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2891:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1545’ defined but not used
# 2891 | static void ndr_print_flags_SERVER_INFO_1545(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1545 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2889|   }
# 2890|   
# 2891|-> static void ndr_print_flags_SERVER_INFO_1545(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1545 *r)
# 2892|   {
# 2893|   	ndr_print_SERVER_INFO_1545(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def84]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2931:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1546’ defined but not used
# 2931 | static void ndr_print_flags_SERVER_INFO_1546(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1546 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2929|   }
# 2930|   
# 2931|-> static void ndr_print_flags_SERVER_INFO_1546(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1546 *r)
# 2932|   {
# 2933|   	ndr_print_SERVER_INFO_1546(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def85]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:2971:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1547’ defined but not used
# 2971 | static void ndr_print_flags_SERVER_INFO_1547(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1547 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 2969|   }
# 2970|   
# 2971|-> static void ndr_print_flags_SERVER_INFO_1547(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1547 *r)
# 2972|   {
# 2973|   	ndr_print_SERVER_INFO_1547(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def86]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3011:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1548’ defined but not used
# 3011 | static void ndr_print_flags_SERVER_INFO_1548(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1548 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3009|   }
# 3010|   
# 3011|-> static void ndr_print_flags_SERVER_INFO_1548(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1548 *r)
# 3012|   {
# 3013|   	ndr_print_SERVER_INFO_1548(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def87]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3051:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1549’ defined but not used
# 3051 | static void ndr_print_flags_SERVER_INFO_1549(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1549 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3049|   }
# 3050|   
# 3051|-> static void ndr_print_flags_SERVER_INFO_1549(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1549 *r)
# 3052|   {
# 3053|   	ndr_print_SERVER_INFO_1549(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def88]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3091:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1550’ defined but not used
# 3091 | static void ndr_print_flags_SERVER_INFO_1550(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1550 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3089|   }
# 3090|   
# 3091|-> static void ndr_print_flags_SERVER_INFO_1550(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1550 *r)
# 3092|   {
# 3093|   	ndr_print_SERVER_INFO_1550(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def89]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3131:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1552’ defined but not used
# 3131 | static void ndr_print_flags_SERVER_INFO_1552(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1552 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3129|   }
# 3130|   
# 3131|-> static void ndr_print_flags_SERVER_INFO_1552(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1552 *r)
# 3132|   {
# 3133|   	ndr_print_SERVER_INFO_1552(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def90]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3171:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1553’ defined but not used
# 3171 | static void ndr_print_flags_SERVER_INFO_1553(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1553 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3169|   }
# 3170|   
# 3171|-> static void ndr_print_flags_SERVER_INFO_1553(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1553 *r)
# 3172|   {
# 3173|   	ndr_print_SERVER_INFO_1553(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def91]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3211:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1554’ defined but not used
# 3211 | static void ndr_print_flags_SERVER_INFO_1554(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1554 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3209|   }
# 3210|   
# 3211|-> static void ndr_print_flags_SERVER_INFO_1554(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1554 *r)
# 3212|   {
# 3213|   	ndr_print_SERVER_INFO_1554(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def92]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3251:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1555’ defined but not used
# 3251 | static void ndr_print_flags_SERVER_INFO_1555(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1555 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3249|   }
# 3250|   
# 3251|-> static void ndr_print_flags_SERVER_INFO_1555(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1555 *r)
# 3252|   {
# 3253|   	ndr_print_SERVER_INFO_1555(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def93]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3291:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1556’ defined but not used
# 3291 | static void ndr_print_flags_SERVER_INFO_1556(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1556 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3289|   }
# 3290|   
# 3291|-> static void ndr_print_flags_SERVER_INFO_1556(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1556 *r)
# 3292|   {
# 3293|   	ndr_print_SERVER_INFO_1556(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def94]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3331:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1557’ defined but not used
# 3331 | static void ndr_print_flags_SERVER_INFO_1557(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1557 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3329|   }
# 3330|   
# 3331|-> static void ndr_print_flags_SERVER_INFO_1557(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1557 *r)
# 3332|   {
# 3333|   	ndr_print_SERVER_INFO_1557(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def95]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3371:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1560’ defined but not used
# 3371 | static void ndr_print_flags_SERVER_INFO_1560(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1560 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3369|   }
# 3370|   
# 3371|-> static void ndr_print_flags_SERVER_INFO_1560(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1560 *r)
# 3372|   {
# 3373|   	ndr_print_SERVER_INFO_1560(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def96]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3411:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1561’ defined but not used
# 3411 | static void ndr_print_flags_SERVER_INFO_1561(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1561 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3409|   }
# 3410|   
# 3411|-> static void ndr_print_flags_SERVER_INFO_1561(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1561 *r)
# 3412|   {
# 3413|   	ndr_print_SERVER_INFO_1561(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def97]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3451:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1562’ defined but not used
# 3451 | static void ndr_print_flags_SERVER_INFO_1562(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1562 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3449|   }
# 3450|   
# 3451|-> static void ndr_print_flags_SERVER_INFO_1562(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1562 *r)
# 3452|   {
# 3453|   	ndr_print_SERVER_INFO_1562(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def98]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3491:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1563’ defined but not used
# 3491 | static void ndr_print_flags_SERVER_INFO_1563(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1563 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3489|   }
# 3490|   
# 3491|-> static void ndr_print_flags_SERVER_INFO_1563(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1563 *r)
# 3492|   {
# 3493|   	ndr_print_SERVER_INFO_1563(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def99]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3531:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1564’ defined but not used
# 3531 | static void ndr_print_flags_SERVER_INFO_1564(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1564 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3529|   }
# 3530|   
# 3531|-> static void ndr_print_flags_SERVER_INFO_1564(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1564 *r)
# 3532|   {
# 3533|   	ndr_print_SERVER_INFO_1564(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def100]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3571:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1565’ defined but not used
# 3571 | static void ndr_print_flags_SERVER_INFO_1565(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1565 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3569|   }
# 3570|   
# 3571|-> static void ndr_print_flags_SERVER_INFO_1565(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1565 *r)
# 3572|   {
# 3573|   	ndr_print_SERVER_INFO_1565(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def101]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3611:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1566’ defined but not used
# 3611 | static void ndr_print_flags_SERVER_INFO_1566(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1566 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3609|   }
# 3610|   
# 3611|-> static void ndr_print_flags_SERVER_INFO_1566(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1566 *r)
# 3612|   {
# 3613|   	ndr_print_SERVER_INFO_1566(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def102]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3651:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1567’ defined but not used
# 3651 | static void ndr_print_flags_SERVER_INFO_1567(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1567 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3649|   }
# 3650|   
# 3651|-> static void ndr_print_flags_SERVER_INFO_1567(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1567 *r)
# 3652|   {
# 3653|   	ndr_print_SERVER_INFO_1567(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def103]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3691:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1568’ defined but not used
# 3691 | static void ndr_print_flags_SERVER_INFO_1568(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1568 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3689|   }
# 3690|   
# 3691|-> static void ndr_print_flags_SERVER_INFO_1568(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1568 *r)
# 3692|   {
# 3693|   	ndr_print_SERVER_INFO_1568(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def104]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3731:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1569’ defined but not used
# 3731 | static void ndr_print_flags_SERVER_INFO_1569(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1569 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3729|   }
# 3730|   
# 3731|-> static void ndr_print_flags_SERVER_INFO_1569(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1569 *r)
# 3732|   {
# 3733|   	ndr_print_SERVER_INFO_1569(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def105]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3771:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1570’ defined but not used
# 3771 | static void ndr_print_flags_SERVER_INFO_1570(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1570 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3769|   }
# 3770|   
# 3771|-> static void ndr_print_flags_SERVER_INFO_1570(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1570 *r)
# 3772|   {
# 3773|   	ndr_print_SERVER_INFO_1570(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def106]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3811:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1571’ defined but not used
# 3811 | static void ndr_print_flags_SERVER_INFO_1571(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1571 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3809|   }
# 3810|   
# 3811|-> static void ndr_print_flags_SERVER_INFO_1571(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1571 *r)
# 3812|   {
# 3813|   	ndr_print_SERVER_INFO_1571(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def107]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3851:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1572’ defined but not used
# 3851 | static void ndr_print_flags_SERVER_INFO_1572(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1572 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3849|   }
# 3850|   
# 3851|-> static void ndr_print_flags_SERVER_INFO_1572(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1572 *r)
# 3852|   {
# 3853|   	ndr_print_SERVER_INFO_1572(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def108]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3891:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1573’ defined but not used
# 3891 | static void ndr_print_flags_SERVER_INFO_1573(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1573 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3889|   }
# 3890|   
# 3891|-> static void ndr_print_flags_SERVER_INFO_1573(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1573 *r)
# 3892|   {
# 3893|   	ndr_print_SERVER_INFO_1573(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def109]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3931:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1574’ defined but not used
# 3931 | static void ndr_print_flags_SERVER_INFO_1574(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1574 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3929|   }
# 3930|   
# 3931|-> static void ndr_print_flags_SERVER_INFO_1574(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1574 *r)
# 3932|   {
# 3933|   	ndr_print_SERVER_INFO_1574(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def110]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:3971:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1575’ defined but not used
# 3971 | static void ndr_print_flags_SERVER_INFO_1575(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1575 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 3969|   }
# 3970|   
# 3971|-> static void ndr_print_flags_SERVER_INFO_1575(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1575 *r)
# 3972|   {
# 3973|   	ndr_print_SERVER_INFO_1575(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def111]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4011:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1576’ defined but not used
# 4011 | static void ndr_print_flags_SERVER_INFO_1576(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1576 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4009|   }
# 4010|   
# 4011|-> static void ndr_print_flags_SERVER_INFO_1576(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1576 *r)
# 4012|   {
# 4013|   	ndr_print_SERVER_INFO_1576(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def112]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4051:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1577’ defined but not used
# 4051 | static void ndr_print_flags_SERVER_INFO_1577(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1577 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4049|   }
# 4050|   
# 4051|-> static void ndr_print_flags_SERVER_INFO_1577(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1577 *r)
# 4052|   {
# 4053|   	ndr_print_SERVER_INFO_1577(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def113]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4091:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1578’ defined but not used
# 4091 | static void ndr_print_flags_SERVER_INFO_1578(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1578 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4089|   }
# 4090|   
# 4091|-> static void ndr_print_flags_SERVER_INFO_1578(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1578 *r)
# 4092|   {
# 4093|   	ndr_print_SERVER_INFO_1578(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def114]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4131:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1579’ defined but not used
# 4131 | static void ndr_print_flags_SERVER_INFO_1579(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1579 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4129|   }
# 4130|   
# 4131|-> static void ndr_print_flags_SERVER_INFO_1579(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1579 *r)
# 4132|   {
# 4133|   	ndr_print_SERVER_INFO_1579(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def115]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4171:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1580’ defined but not used
# 4171 | static void ndr_print_flags_SERVER_INFO_1580(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1580 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4169|   }
# 4170|   
# 4171|-> static void ndr_print_flags_SERVER_INFO_1580(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1580 *r)
# 4172|   {
# 4173|   	ndr_print_SERVER_INFO_1580(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def116]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4211:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1581’ defined but not used
# 4211 | static void ndr_print_flags_SERVER_INFO_1581(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1581 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4209|   }
# 4210|   
# 4211|-> static void ndr_print_flags_SERVER_INFO_1581(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1581 *r)
# 4212|   {
# 4213|   	ndr_print_SERVER_INFO_1581(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def117]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4251:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1582’ defined but not used
# 4251 | static void ndr_print_flags_SERVER_INFO_1582(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1582 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4249|   }
# 4250|   
# 4251|-> static void ndr_print_flags_SERVER_INFO_1582(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1582 *r)
# 4252|   {
# 4253|   	ndr_print_SERVER_INFO_1582(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def118]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4291:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1583’ defined but not used
# 4291 | static void ndr_print_flags_SERVER_INFO_1583(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1583 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4289|   }
# 4290|   
# 4291|-> static void ndr_print_flags_SERVER_INFO_1583(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1583 *r)
# 4292|   {
# 4293|   	ndr_print_SERVER_INFO_1583(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def119]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4331:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1584’ defined but not used
# 4331 | static void ndr_print_flags_SERVER_INFO_1584(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1584 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4329|   }
# 4330|   
# 4331|-> static void ndr_print_flags_SERVER_INFO_1584(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1584 *r)
# 4332|   {
# 4333|   	ndr_print_SERVER_INFO_1584(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def120]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4371:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1585’ defined but not used
# 4371 | static void ndr_print_flags_SERVER_INFO_1585(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1585 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4369|   }
# 4370|   
# 4371|-> static void ndr_print_flags_SERVER_INFO_1585(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1585 *r)
# 4372|   {
# 4373|   	ndr_print_SERVER_INFO_1585(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def121]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4411:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1586’ defined but not used
# 4411 | static void ndr_print_flags_SERVER_INFO_1586(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1586 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4409|   }
# 4410|   
# 4411|-> static void ndr_print_flags_SERVER_INFO_1586(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1586 *r)
# 4412|   {
# 4413|   	ndr_print_SERVER_INFO_1586(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def122]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4451:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1587’ defined but not used
# 4451 | static void ndr_print_flags_SERVER_INFO_1587(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1587 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4449|   }
# 4450|   
# 4451|-> static void ndr_print_flags_SERVER_INFO_1587(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1587 *r)
# 4452|   {
# 4453|   	ndr_print_SERVER_INFO_1587(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def123]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4491:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1588’ defined but not used
# 4491 | static void ndr_print_flags_SERVER_INFO_1588(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1588 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4489|   }
# 4490|   
# 4491|-> static void ndr_print_flags_SERVER_INFO_1588(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1588 *r)
# 4492|   {
# 4493|   	ndr_print_SERVER_INFO_1588(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def124]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4531:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1590’ defined but not used
# 4531 | static void ndr_print_flags_SERVER_INFO_1590(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1590 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4529|   }
# 4530|   
# 4531|-> static void ndr_print_flags_SERVER_INFO_1590(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1590 *r)
# 4532|   {
# 4533|   	ndr_print_SERVER_INFO_1590(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def125]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4571:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1591’ defined but not used
# 4571 | static void ndr_print_flags_SERVER_INFO_1591(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1591 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4569|   }
# 4570|   
# 4571|-> static void ndr_print_flags_SERVER_INFO_1591(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1591 *r)
# 4572|   {
# 4573|   	ndr_print_SERVER_INFO_1591(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def126]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4611:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1592’ defined but not used
# 4611 | static void ndr_print_flags_SERVER_INFO_1592(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1592 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4609|   }
# 4610|   
# 4611|-> static void ndr_print_flags_SERVER_INFO_1592(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1592 *r)
# 4612|   {
# 4613|   	ndr_print_SERVER_INFO_1592(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def127]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4651:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1593’ defined but not used
# 4651 | static void ndr_print_flags_SERVER_INFO_1593(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1593 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4649|   }
# 4650|   
# 4651|-> static void ndr_print_flags_SERVER_INFO_1593(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1593 *r)
# 4652|   {
# 4653|   	ndr_print_SERVER_INFO_1593(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def128]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4691:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1594’ defined but not used
# 4691 | static void ndr_print_flags_SERVER_INFO_1594(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1594 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4689|   }
# 4690|   
# 4691|-> static void ndr_print_flags_SERVER_INFO_1594(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1594 *r)
# 4692|   {
# 4693|   	ndr_print_SERVER_INFO_1594(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def129]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4731:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1595’ defined but not used
# 4731 | static void ndr_print_flags_SERVER_INFO_1595(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1595 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4729|   }
# 4730|   
# 4731|-> static void ndr_print_flags_SERVER_INFO_1595(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1595 *r)
# 4732|   {
# 4733|   	ndr_print_SERVER_INFO_1595(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def130]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4771:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1596’ defined but not used
# 4771 | static void ndr_print_flags_SERVER_INFO_1596(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1596 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4769|   }
# 4770|   
# 4771|-> static void ndr_print_flags_SERVER_INFO_1596(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1596 *r)
# 4772|   {
# 4773|   	ndr_print_SERVER_INFO_1596(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def131]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4811:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1597’ defined but not used
# 4811 | static void ndr_print_flags_SERVER_INFO_1597(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1597 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4809|   }
# 4810|   
# 4811|-> static void ndr_print_flags_SERVER_INFO_1597(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1597 *r)
# 4812|   {
# 4813|   	ndr_print_SERVER_INFO_1597(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def132]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4851:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1598’ defined but not used
# 4851 | static void ndr_print_flags_SERVER_INFO_1598(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1598 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4849|   }
# 4850|   
# 4851|-> static void ndr_print_flags_SERVER_INFO_1598(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1598 *r)
# 4852|   {
# 4853|   	ndr_print_SERVER_INFO_1598(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def133]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4891:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1599’ defined but not used
# 4891 | static void ndr_print_flags_SERVER_INFO_1599(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1599 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4889|   }
# 4890|   
# 4891|-> static void ndr_print_flags_SERVER_INFO_1599(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1599 *r)
# 4892|   {
# 4893|   	ndr_print_SERVER_INFO_1599(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def134]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4931:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1600’ defined but not used
# 4931 | static void ndr_print_flags_SERVER_INFO_1600(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1600 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4929|   }
# 4930|   
# 4931|-> static void ndr_print_flags_SERVER_INFO_1600(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1600 *r)
# 4932|   {
# 4933|   	ndr_print_SERVER_INFO_1600(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def135]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:4971:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1601’ defined but not used
# 4971 | static void ndr_print_flags_SERVER_INFO_1601(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1601 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 4969|   }
# 4970|   
# 4971|-> static void ndr_print_flags_SERVER_INFO_1601(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1601 *r)
# 4972|   {
# 4973|   	ndr_print_SERVER_INFO_1601(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def136]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5011:13: warning[-Wunused-function]: ‘ndr_print_flags_SERVER_INFO_1602’ defined but not used
# 5011 | static void ndr_print_flags_SERVER_INFO_1602(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1602 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5009|   }
# 5010|   
# 5011|-> static void ndr_print_flags_SERVER_INFO_1602(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct SERVER_INFO_1602 *r)
# 5012|   {
# 5013|   	ndr_print_SERVER_INFO_1602(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def137]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5059:13: warning[-Wunused-function]: ‘ndr_print_flags_WKSTA_INFO_100’ defined but not used
# 5059 | static void ndr_print_flags_WKSTA_INFO_100(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_100 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5057|   }
# 5058|   
# 5059|-> static void ndr_print_flags_WKSTA_INFO_100(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_100 *r)
# 5060|   {
# 5061|   	ndr_print_WKSTA_INFO_100(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def138]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5113:13: warning[-Wunused-function]: ‘ndr_print_flags_WKSTA_INFO_101’ defined but not used
# 5113 | static void ndr_print_flags_WKSTA_INFO_101(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_101 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5111|   }
# 5112|   
# 5113|-> static void ndr_print_flags_WKSTA_INFO_101(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_101 *r)
# 5114|   {
# 5115|   	ndr_print_WKSTA_INFO_101(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def139]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5170:13: warning[-Wunused-function]: ‘ndr_print_flags_WKSTA_INFO_102’ defined but not used
# 5170 | static void ndr_print_flags_WKSTA_INFO_102(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_102 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5168|   }
# 5169|   
# 5170|-> static void ndr_print_flags_WKSTA_INFO_102(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct WKSTA_INFO_102 *r)
# 5171|   {
# 5172|   	ndr_print_WKSTA_INFO_102(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def140]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5270:13: warning[-Wunused-function]: ‘ndr_print_flags_DOMAIN_CONTROLLER_INFO’ defined but not used
# 5270 | static void ndr_print_flags_DOMAIN_CONTROLLER_INFO(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct DOMAIN_CONTROLLER_INFO *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5268|   }
# 5269|   
# 5270|-> static void ndr_print_flags_DOMAIN_CONTROLLER_INFO(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct DOMAIN_CONTROLLER_INFO *r)
# 5271|   {
# 5272|   	ndr_print_DOMAIN_CONTROLLER_INFO(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def141]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5318:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_0’ defined but not used
# 5318 | static void ndr_print_flags_USER_INFO_0(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_0 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5316|   }
# 5317|   
# 5318|-> static void ndr_print_flags_USER_INFO_0(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_0 *r)
# 5319|   {
# 5320|   	ndr_print_USER_INFO_0(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def142]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5372:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1’ defined but not used
# 5372 | static void ndr_print_flags_USER_INFO_1(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5370|   }
# 5371|   
# 5372|-> static void ndr_print_flags_USER_INFO_1(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1 *r)
# 5373|   {
# 5374|   	ndr_print_USER_INFO_1(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def143]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5481:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_2’ defined but not used
# 5481 | static void ndr_print_flags_USER_INFO_2(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_2 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5479|   }
# 5480|   
# 5481|-> static void ndr_print_flags_USER_INFO_2(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_2 *r)
# 5482|   {
# 5483|   	ndr_print_USER_INFO_2(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def144]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5619:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_3’ defined but not used
# 5619 | static void ndr_print_flags_USER_INFO_3(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_3 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5617|   }
# 5618|   
# 5619|-> static void ndr_print_flags_USER_INFO_3(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_3 *r)
# 5620|   {
# 5621|   	ndr_print_USER_INFO_3(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def145]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5779:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_4’ defined but not used
# 5779 | static void ndr_print_flags_USER_INFO_4(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_4 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5777|   }
# 5778|   
# 5779|-> static void ndr_print_flags_USER_INFO_4(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_4 *r)
# 5780|   {
# 5781|   	ndr_print_USER_INFO_4(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def146]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5863:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_10’ defined but not used
# 5863 | static void ndr_print_flags_USER_INFO_10(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_10 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5861|   }
# 5862|   
# 5863|-> static void ndr_print_flags_USER_INFO_10(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_10 *r)
# 5864|   {
# 5865|   	ndr_print_USER_INFO_10(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def147]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:5960:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_11’ defined but not used
# 5960 | static void ndr_print_flags_USER_INFO_11(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_11 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 5958|   }
# 5959|   
# 5960|-> static void ndr_print_flags_USER_INFO_11(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_11 *r)
# 5961|   {
# 5962|   	ndr_print_USER_INFO_11(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def148]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6032:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_20’ defined but not used
# 6032 | static void ndr_print_flags_USER_INFO_20(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_20 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6030|   }
# 6031|   
# 6032|-> static void ndr_print_flags_USER_INFO_20(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_20 *r)
# 6033|   {
# 6034|   	ndr_print_USER_INFO_20(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def149]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6079:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_21’ defined but not used
# 6079 | static void ndr_print_flags_USER_INFO_21(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_21 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6077|   }
# 6078|   
# 6079|-> static void ndr_print_flags_USER_INFO_21(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_21 *r)
# 6080|   {
# 6081|   	ndr_print_USER_INFO_21(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def150]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6184:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_22’ defined but not used
# 6184 | static void ndr_print_flags_USER_INFO_22(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_22 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6182|   }
# 6183|   
# 6184|-> static void ndr_print_flags_USER_INFO_22(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_22 *r)
# 6185|   {
# 6186|   	ndr_print_USER_INFO_22(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def151]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6276:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_23’ defined but not used
# 6276 | static void ndr_print_flags_USER_INFO_23(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_23 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6274|   }
# 6275|   
# 6276|-> static void ndr_print_flags_USER_INFO_23(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_23 *r)
# 6277|   {
# 6278|   	ndr_print_USER_INFO_23(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def152]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6325:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1003’ defined but not used
# 6325 | static void ndr_print_flags_USER_INFO_1003(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1003 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6323|   }
# 6324|   
# 6325|-> static void ndr_print_flags_USER_INFO_1003(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1003 *r)
# 6326|   {
# 6327|   	ndr_print_USER_INFO_1003(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def153]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6365:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1005’ defined but not used
# 6365 | static void ndr_print_flags_USER_INFO_1005(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1005 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6363|   }
# 6364|   
# 6365|-> static void ndr_print_flags_USER_INFO_1005(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1005 *r)
# 6366|   {
# 6367|   	ndr_print_USER_INFO_1005(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def154]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6405:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1006’ defined but not used
# 6405 | static void ndr_print_flags_USER_INFO_1006(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1006 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6403|   }
# 6404|   
# 6405|-> static void ndr_print_flags_USER_INFO_1006(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1006 *r)
# 6406|   {
# 6407|   	ndr_print_USER_INFO_1006(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def155]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6445:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1007’ defined but not used
# 6445 | static void ndr_print_flags_USER_INFO_1007(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1007 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6443|   }
# 6444|   
# 6445|-> static void ndr_print_flags_USER_INFO_1007(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1007 *r)
# 6446|   {
# 6447|   	ndr_print_USER_INFO_1007(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def156]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6485:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1008’ defined but not used
# 6485 | static void ndr_print_flags_USER_INFO_1008(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1008 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6483|   }
# 6484|   
# 6485|-> static void ndr_print_flags_USER_INFO_1008(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1008 *r)
# 6486|   {
# 6487|   	ndr_print_USER_INFO_1008(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def157]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6525:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1009’ defined but not used
# 6525 | static void ndr_print_flags_USER_INFO_1009(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1009 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6523|   }
# 6524|   
# 6525|-> static void ndr_print_flags_USER_INFO_1009(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1009 *r)
# 6526|   {
# 6527|   	ndr_print_USER_INFO_1009(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def158]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6565:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1010’ defined but not used
# 6565 | static void ndr_print_flags_USER_INFO_1010(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1010 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6563|   }
# 6564|   
# 6565|-> static void ndr_print_flags_USER_INFO_1010(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1010 *r)
# 6566|   {
# 6567|   	ndr_print_USER_INFO_1010(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def159]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6605:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1011’ defined but not used
# 6605 | static void ndr_print_flags_USER_INFO_1011(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1011 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6603|   }
# 6604|   
# 6605|-> static void ndr_print_flags_USER_INFO_1011(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1011 *r)
# 6606|   {
# 6607|   	ndr_print_USER_INFO_1011(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def160]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6645:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1012’ defined but not used
# 6645 | static void ndr_print_flags_USER_INFO_1012(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1012 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6643|   }
# 6644|   
# 6645|-> static void ndr_print_flags_USER_INFO_1012(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1012 *r)
# 6646|   {
# 6647|   	ndr_print_USER_INFO_1012(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def161]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6685:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1013’ defined but not used
# 6685 | static void ndr_print_flags_USER_INFO_1013(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1013 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6683|   }
# 6684|   
# 6685|-> static void ndr_print_flags_USER_INFO_1013(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1013 *r)
# 6686|   {
# 6687|   	ndr_print_USER_INFO_1013(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def162]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6725:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1014’ defined but not used
# 6725 | static void ndr_print_flags_USER_INFO_1014(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1014 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6723|   }
# 6724|   
# 6725|-> static void ndr_print_flags_USER_INFO_1014(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1014 *r)
# 6726|   {
# 6727|   	ndr_print_USER_INFO_1014(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def163]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6765:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1017’ defined but not used
# 6765 | static void ndr_print_flags_USER_INFO_1017(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1017 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6763|   }
# 6764|   
# 6765|-> static void ndr_print_flags_USER_INFO_1017(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1017 *r)
# 6766|   {
# 6767|   	ndr_print_USER_INFO_1017(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def164]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6805:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1018’ defined but not used
# 6805 | static void ndr_print_flags_USER_INFO_1018(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1018 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6803|   }
# 6804|   
# 6805|-> static void ndr_print_flags_USER_INFO_1018(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1018 *r)
# 6806|   {
# 6807|   	ndr_print_USER_INFO_1018(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def165]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6863:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1020’ defined but not used
# 6863 | static void ndr_print_flags_USER_INFO_1020(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1020 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6861|   }
# 6862|   
# 6863|-> static void ndr_print_flags_USER_INFO_1020(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1020 *r)
# 6864|   {
# 6865|   	ndr_print_USER_INFO_1020(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def166]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6909:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1023’ defined but not used
# 6909 | static void ndr_print_flags_USER_INFO_1023(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1023 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6907|   }
# 6908|   
# 6909|-> static void ndr_print_flags_USER_INFO_1023(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1023 *r)
# 6910|   {
# 6911|   	ndr_print_USER_INFO_1023(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def167]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6949:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1024’ defined but not used
# 6949 | static void ndr_print_flags_USER_INFO_1024(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1024 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6947|   }
# 6948|   
# 6949|-> static void ndr_print_flags_USER_INFO_1024(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1024 *r)
# 6950|   {
# 6951|   	ndr_print_USER_INFO_1024(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def168]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:6989:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1025’ defined but not used
# 6989 | static void ndr_print_flags_USER_INFO_1025(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1025 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 6987|   }
# 6988|   
# 6989|-> static void ndr_print_flags_USER_INFO_1025(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1025 *r)
# 6990|   {
# 6991|   	ndr_print_USER_INFO_1025(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def169]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7029:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1051’ defined but not used
# 7029 | static void ndr_print_flags_USER_INFO_1051(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1051 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7027|   }
# 7028|   
# 7029|-> static void ndr_print_flags_USER_INFO_1051(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1051 *r)
# 7030|   {
# 7031|   	ndr_print_USER_INFO_1051(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def170]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7069:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1052’ defined but not used
# 7069 | static void ndr_print_flags_USER_INFO_1052(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1052 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7067|   }
# 7068|   
# 7069|-> static void ndr_print_flags_USER_INFO_1052(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1052 *r)
# 7070|   {
# 7071|   	ndr_print_USER_INFO_1052(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def171]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7109:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_1053’ defined but not used
# 7109 | static void ndr_print_flags_USER_INFO_1053(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1053 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7107|   }
# 7108|   
# 7109|-> static void ndr_print_flags_USER_INFO_1053(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_1053 *r)
# 7110|   {
# 7111|   	ndr_print_USER_INFO_1053(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def172]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7221:13: warning[-Wunused-function]: ‘ndr_print_flags_USER_INFO_X’ defined but not used
# 7221 | static void ndr_print_flags_USER_INFO_X(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_X *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7219|   }
# 7220|   
# 7221|-> static void ndr_print_flags_USER_INFO_X(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct USER_INFO_X *r)
# 7222|   {
# 7223|   	ndr_print_USER_INFO_X(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def173]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7294:13: warning[-Wunused-function]: ‘ndr_print_flags_GROUP_USERS_INFO_0’ defined but not used
# 7294 | static void ndr_print_flags_GROUP_USERS_INFO_0(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct GROUP_USERS_INFO_0 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7292|   }
# 7293|   
# 7294|-> static void ndr_print_flags_GROUP_USERS_INFO_0(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct GROUP_USERS_INFO_0 *r)
# 7295|   {
# 7296|   	ndr_print_GROUP_USERS_INFO_0(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def174]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7336:13: warning[-Wunused-function]: ‘ndr_print_flags_GROUP_USERS_INFO_1’ defined but not used
# 7336 | static void ndr_print_flags_GROUP_USERS_INFO_1(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct GROUP_USERS_INFO_1 *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7334|   }
# 7335|   
# 7336|-> static void ndr_print_flags_GROUP_USERS_INFO_1(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct GROUP_USERS_INFO_1 *r)
# 7337|   {
# 7338|   	ndr_print_GROUP_USERS_INFO_1(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def175]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7387:13: warning[-Wunused-function]: ‘ndr_print_flags_NET_DISPLAY_USER’ defined but not used
# 7387 | static void ndr_print_flags_NET_DISPLAY_USER(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_USER *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7385|   }
# 7386|   
# 7387|-> static void ndr_print_flags_NET_DISPLAY_USER(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_USER *r)
# 7388|   {
# 7389|   	ndr_print_NET_DISPLAY_USER(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def176]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7440:13: warning[-Wunused-function]: ‘ndr_print_flags_NET_DISPLAY_MACHINE’ defined but not used
# 7440 | static void ndr_print_flags_NET_DISPLAY_MACHINE(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_MACHINE *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7438|   }
# 7439|   
# 7440|-> static void ndr_print_flags_NET_DISPLAY_MACHINE(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_MACHINE *r)
# 7441|   {
# 7442|   	ndr_print_NET_DISPLAY_MACHINE(ndr, name, r);

Error: COMPILER_WARNING (CWE-1164): [#def177]
samba-4.23.4/bin/default/source3/librpc/gen_ndr/ndr_libnetapi.c:7492:13: warning[-Wunused-function]: ‘ndr_print_flags_NET_DISPLAY_GROUP’ defined but not used
# 7492 | static void ndr_print_flags_NET_DISPLAY_GROUP(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_GROUP *r)
#      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 7490|   }
# 7491|   
# 7492|-> static void ndr_print_flags_NET_DISPLAY_GROUP(struct ndr_print *ndr, const char *name, ndr_flags_type unused, const struct NET_DISPLAY_GROUP *r)
# 7493|   {
# 7494|   	ndr_print_NET_DISPLAY_GROUP(ndr, name, r);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def178]
samba-4.23.4/bin/default/source3/modules/getdate.c:1303:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
samba-4.23.4/bin/default/source3/modules/getdate.c:1261:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/source3/modules/getdate.c:1264:31: branch_true: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1291:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/source3/modules/getdate.c:1293:7: branch_false: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1301:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/source3/modules/getdate.c:1301:12: branch_false: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1303:9: danger: use of uninitialized value ‘yyss’ here

Error: GCC_ANALYZER_WARNING (CWE-457): [#def179]
samba-4.23.4/bin/default/source3/modules/getdate.c:1420:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
samba-4.23.4/bin/default/source3/modules/getdate.c:1261:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/source3/modules/getdate.c:1324:6: branch_false: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1324:6: branch_false: following ‘false’ branch (when ‘yystate != 2’)...
samba-4.23.4/bin/default/source3/modules/getdate.c:1327:3: branch_false: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1339:6: branch_true: following ‘true’ branch (when ‘yyn == -17’)...
samba-4.23.4/bin/default/source3/modules/getdate.c:1340:5: branch_true: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1400:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
samba-4.23.4/bin/default/source3/modules/getdate.c:1402:3: branch_false: ...to here
samba-4.23.4/bin/default/source3/modules/getdate.c:1420:3: danger: use of uninitialized value ‘*<unknown>’ here

Error: CPPCHECK_WARNING (CWE-476): [#def180]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1668: warning[nullPointer]: Possible null pointer dereference: b
# 1666|   	yy_flush_buffer( b );
# 1667|   
# 1668|-> 	b->yy_input_file = file;
# 1669|   	b->yy_fill_buffer = 1;
# 1670|   

Error: CPPCHECK_WARNING (CWE-476): [#def181]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1669: warning[nullPointer]: Possible null pointer dereference: b
# 1667|   
# 1668|   	b->yy_input_file = file;
# 1669|-> 	b->yy_fill_buffer = 1;
# 1670|   
# 1671|       /* If b is the current buffer, then yy_init_buffer was _probably_

Error: GCC_ANALYZER_WARNING (CWE-401): [#def182]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1797:63: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1866:17: enter_function: entry to ‘mdsyyl_scan_bytes’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1875:24: acquire_memory: allocated here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1876:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1876:12: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1884:13: call_function: calling ‘mdsyyl_scan_buffer’ from ‘mdsyyl_scan_bytes’
# 1795|   
# 1796|   		num_to_alloc = (yy_buffer_stack_max) + grow_size;
# 1797|-> 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
# 1798|   								((yy_buffer_stack),
# 1799|   								num_to_alloc * sizeof(struct yy_buffer_state*)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def183]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1797:63: warning[-Wanalyzer-malloc-leak]: leak of ‘b’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1816:17: enter_function: entry to ‘mdsyyl_scan_buffer’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1826:31: acquire_memory: allocated here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1827:12: branch_false: following ‘false’ branch (when ‘b’ is non-NULL)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1830:32: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_lexer.lex.c:1840:9: call_function: calling ‘mdsyyl_switch_to_buffer’ from ‘mdsyyl_scan_buffer’
# 1795|   
# 1796|   		num_to_alloc = (yy_buffer_stack_max) + grow_size;
# 1797|-> 		(yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
# 1798|   								((yy_buffer_stack),
# 1799|   								num_to_alloc * sizeof(struct yy_buffer_state*)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def184]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1295:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘yyss’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1253:6: branch_true: following ‘true’ branch...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1259:28: branch_true: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1282:10: branch_false: following ‘false’ branch (when ‘yystacksize <= 9999’)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1284:7: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1293:12: branch_false: following ‘false’ branch (when ‘yyptr’ is non-NULL)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1295:9: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1295:9: danger: use of uninitialized value ‘yyss’ here
# 1293|           if (! yyptr)
# 1294|             YYNOMEM;
# 1295|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1296|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1297|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-457): [#def185]
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1422:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*(const char **)<unknown>’
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1253:6: branch_false: following ‘false’ branch...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1317:6: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1317:6: branch_false: following ‘false’ branch (when ‘yystate != 2’)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1320:3: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1332:6: branch_true: following ‘true’ branch (when ‘yyn == -19’)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1333:5: branch_true: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1402:6: branch_false: following ‘false’ branch (when ‘yyn != 0’)...
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1404:3: branch_false: ...to here
samba-4.23.4/bin/default/source3/rpc_server/mdssvc/es_parser.tab.c:1422:3: danger: use of uninitialized value ‘*(const char **)<unknown>’ here
# 1420|        unconditionally makes the parser a bit smaller, and it avoids a
# 1421|        GCC warning that YYVAL may be used uninitialized.  */
# 1422|->   yyval = yyvsp[1-yylen];
# 1423|   
# 1424|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def186]
samba-4.23.4/ctdb/client/client_connect.c:126:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘socket(1, 1, 0)’
samba-4.23.4/ctdb/client/client_connect.c:68:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:72:12: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:72:12: branch_false: following ‘false’ branch (when ‘sockpath’ is non-NULL)...
samba-4.23.4/ctdb/client/client_connect.c:78:18: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:79:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:83:15: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:91:15: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:92:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:99:15: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:100:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:107:9: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:117:22: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:117:22: acquire_resource: stream socket created here
samba-4.23.4/ctdb/client/client_connect.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/client/client_connect.c:126:15: branch_false: ...to here
samba-4.23.4/ctdb/client/client_connect.c:126:15: danger: ‘socket(1, 1, 0)’ leaks here
#  124|   	}
#  125|   
#  126|-> 	ret = connect(client->fd, (struct sockaddr *)&addr, sizeof(addr));
#  127|   	if (ret == -1) {
#  128|   		ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def187]
samba-4.23.4/ctdb/common/ctdb_io.c:469:23: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/ctdb/common/ctdb_io.c:467:9: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/ctdb_io.c:468:9: branch_false: ...to here
samba-4.23.4/ctdb/common/ctdb_io.c:468:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/ctdb/common/ctdb_io.c:469:23: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/ctdb/common/ctdb_io.c:469:23: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  467|   	CTDB_NO_MEMORY_NULL(ctdb, queue);
#  468|   	va_start(ap, fmt);
#  469|-> 	queue->name = talloc_vasprintf(mem_ctx, fmt, ap);
#  470|   	va_end(ap);
#  471|   	CTDB_NO_MEMORY_NULL(ctdb, queue->name);

Error: CPPCHECK_WARNING (CWE-476): [#def188]
samba-4.23.4/ctdb/common/ctdb_ltdb.c:359: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  357|   
#  358|   		buf = malloc(byte_pos + 1);
#  359|-> 		memset(buf, 0, byte_pos + 1);
#  360|   		if (buf == NULL) {
#  361|   			DEBUG(DEBUG_ERR, ("Out of memory when allocating buffer of %d bytes for trackingdb\n", byte_pos + 1));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def189]
samba-4.23.4/ctdb/common/ctdb_ltdb.c:359:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
samba-4.23.4/ctdb/common/ctdb_ltdb.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/ctdb_ltdb.c:358:23: branch_true: ...to here
samba-4.23.4/ctdb/common/ctdb_ltdb.c:358:23: acquire_memory: this call could return NULL
samba-4.23.4/ctdb/common/ctdb_ltdb.c:359:17: danger: argument 1 (‘buf’) from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  357|   
#  358|   		buf = malloc(byte_pos + 1);
#  359|-> 		memset(buf, 0, byte_pos + 1);
#  360|   		if (buf == NULL) {
#  361|   			DEBUG(DEBUG_ERR, ("Out of memory when allocating buffer of %d bytes for trackingdb\n", byte_pos + 1));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def190]
samba-4.23.4/ctdb/common/ctdb_util.c:57:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/ctdb/common/ctdb_util.c:56:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/ctdb/common/ctdb_util.c:57:25: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/ctdb/common/ctdb_util.c:57:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   55|   	talloc_free(ctdb->err_msg);
#   56|   	va_start(ap, fmt);
#   57|-> 	ctdb->err_msg = talloc_vasprintf(ctdb, fmt, ap);
#   58|   	DEBUG(DEBUG_ERR,("ctdb error: %s\n", ctdb->err_msg));
#   59|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def191]
samba-4.23.4/ctdb/common/event_script.c:174:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(script_dir)’
samba-4.23.4/ctdb/common/event_script.c:168:16: acquire_memory: allocated here
samba-4.23.4/ctdb/common/event_script.c:169:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/event_script.c:169:12: branch_false: ...to here
samba-4.23.4/ctdb/common/event_script.c:174:22: throw: if ‘readdir’ throws an exception...
samba-4.23.4/ctdb/common/event_script.c:174:22: danger: ‘opendir(script_dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  172|   
#  173|   	found = false;
#  174|-> 	while ((de = readdir(dirp)) != NULL) {
#  175|   		if (strcmp(de->d_name, script_file) == 0) {
#  176|   			/* check for valid script names */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def192]
samba-4.23.4/ctdb/common/run_event.c:412:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/ctdb/common/run_event.c:404:13: acquire_memory: allocated here
samba-4.23.4/ctdb/common/run_event.c:405:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/ctdb/common/run_event.c:410:16: branch_false: ...to here
samba-4.23.4/ctdb/common/run_event.c:411:16: branch_true: following ‘true’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/ctdb/common/run_event.c:412:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_event.c:412:17: branch_true: following ‘true’ branch (when ‘loglevel <= 1000’)...
samba-4.23.4/ctdb/common/run_event.c:412:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_event.c:412:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/ctdb/common/run_event.c:412:17: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  410|   	line = strtok(s, "\n");
#  411|   	while (line != NULL) {
#  412|-> 		DEBUG(loglevel, ("%s: %s\n", log_prefix, line));
#  413|   		line = strtok(NULL, "\n");
#  414|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def193]
samba-4.23.4/ctdb/common/run_proc.c:108:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:107:23: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:108:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:108:17: danger: ‘fd[0]’ leaks here
#  106|   	if (proc->pid == -1) {
#  107|   		ret = errno;
#  108|-> 		close(fd[0]);
#  109|   		close(fd[1]);
#  110|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def194]
samba-4.23.4/ctdb/common/run_proc.c:108:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:107:23: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:108:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:108:17: danger: ‘fd[1]’ leaks here
#  106|   	if (proc->pid == -1) {
#  107|   		ret = errno;
#  108|-> 		close(fd[0]);
#  109|   		close(fd[1]);
#  110|   		return ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def195]
samba-4.23.4/ctdb/common/run_proc.c:109:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:107:23: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:109:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:109:17: danger: ‘fd[1]’ leaks here
#  107|   		ret = errno;
#  108|   		close(fd[0]);
#  109|-> 		close(fd[1]);
#  110|   		return ret;
#  111|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def196]
samba-4.23.4/ctdb/common/run_proc.c:114:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:114:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:114:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:114:17: danger: ‘fd[0]’ leaks here
#  112|   
#  113|   	if (proc->pid == 0) {
#  114|-> 		close(fd[0]);
#  115|   
#  116|   		ret = dup2(fd[1], STDOUT_FILENO);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def197]
samba-4.23.4/ctdb/common/run_proc.c:114:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:114:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:114:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:114:17: danger: ‘fd[1]’ leaks here
#  112|   
#  113|   	if (proc->pid == 0) {
#  114|-> 		close(fd[0]);
#  115|   
#  116|   		ret = dup2(fd[1], STDOUT_FILENO);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def198]
samba-4.23.4/ctdb/common/run_proc.c:125:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:114:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:117:20: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/common/run_proc.c:120:23: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:121:20: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/common/run_proc.c:125:17: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:125:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:125:17: danger: ‘fd[1]’ leaks here
#  123|   		}
#  124|   
#  125|-> 		close(fd[1]);
#  126|   
#  127|   		if (stdin_fd != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def199]
samba-4.23.4/ctdb/common/run_proc.c:125:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/run_proc.c:114:17: branch_true: ...to here
samba-4.23.4/ctdb/common/run_proc.c:116:23: acquire_resource: opened here
samba-4.23.4/ctdb/common/run_proc.c:117:20: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/common/run_proc.c:120:23: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:121:20: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/common/run_proc.c:125:17: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:125:17: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:125:17: danger: ‘ret’ leaks here; was opened at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7)
#  123|   		}
#  124|   
#  125|-> 		close(fd[1]);
#  126|   
#  127|   		if (stdin_fd != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def200]
samba-4.23.4/ctdb/common/run_proc.c:147:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[0]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:147:9: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:147:9: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:147:9: danger: ‘fd[0]’ leaks here
#  145|   	}
#  146|   
#  147|-> 	close(fd[1]);
#  148|   
#  149|   	proc->fd = fd[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def201]
samba-4.23.4/ctdb/common/run_proc.c:147:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd[1]’
samba-4.23.4/ctdb/common/run_proc.c:101:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/common/run_proc.c:105:21: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/run_proc.c:147:9: branch_false: ...to here
samba-4.23.4/ctdb/common/run_proc.c:147:9: throw: if ‘close’ throws an exception...
samba-4.23.4/ctdb/common/run_proc.c:147:9: danger: ‘fd[1]’ leaks here
#  145|   	}
#  146|   
#  147|-> 	close(fd[1]);
#  148|   
#  149|   	proc->fd = fd[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def202]
samba-4.23.4/ctdb/common/sock_client.c:73:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/ctdb/common/sock_client.c:62:12: branch_false: following ‘false’ branch (when ‘len <= 107’)...
samba-4.23.4/ctdb/common/sock_client.c:67:14: branch_false: ...to here
samba-4.23.4/ctdb/common/sock_client.c:67:14: acquire_resource: stream socket created here
samba-4.23.4/ctdb/common/sock_client.c:68:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/ctdb/common/sock_client.c:73:15: branch_false: ...to here
samba-4.23.4/ctdb/common/sock_client.c:73:15: throw: if ‘connect’ throws an exception...
samba-4.23.4/ctdb/common/sock_client.c:73:15: danger: ‘fd’ leaks here
#   71|   	}
#   72|   
#   73|-> 	ret = connect(fd, (struct sockaddr *)&addr, sizeof(addr));
#   74|   	if (ret != 0) {
#   75|   		D_ERR("socket connect failed - %s\n", sockpath);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def203]
samba-4.23.4/ctdb/common/system_socket.c:133:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ips_ctx’
samba-4.23.4/ctdb/common/system_socket.c:196:6: enter_function: entry to ‘ctdb_sys_have_ip’
samba-4.23.4/ctdb/common/system_socket.c:198:44: release_memory: ‘ips_ctx’ is NULL
samba-4.23.4/ctdb/common/system_socket.c:202:15: call_function: calling ‘ctdb_sys_local_ips_init’ from ‘ctdb_sys_have_ip’
samba-4.23.4/ctdb/common/system_socket.c:202:15: return_function: returning to ‘ctdb_sys_have_ip’ from ‘ctdb_sys_local_ips_init’
samba-4.23.4/ctdb/common/system_socket.c:203:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/system_socket.c:209:19: branch_false: ...to here
samba-4.23.4/ctdb/common/system_socket.c:209:19: release_memory: ‘ips_ctx’ is NULL
samba-4.23.4/ctdb/common/system_socket.c:209:19: call_function: calling ‘ctdb_sys_local_ip_check’ from ‘ctdb_sys_have_ip’
#  131|   	int ret;
#  132|   
#  133|-> 	for (ifa = ips_ctx->ifa; ifa != NULL; ifa = ifa->ifa_next) {
#  134|   		ctdb_sock_addr sock_addr;
#  135|   		bool match;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def204]
samba-4.23.4/ctdb/common/system_socket.c:452:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
samba-4.23.4/ctdb/common/system_socket.c:446:13: acquire_resource: socket created here
samba-4.23.4/ctdb/common/system_socket.c:447:12: branch_false: following ‘false’ branch (when ‘s != -1’)...
samba-4.23.4/ctdb/common/system_socket.c:452:9: branch_false: ...to here
samba-4.23.4/ctdb/common/system_socket.c:452:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/ctdb/common/system_socket.c:452:9: danger: ‘s’ leaks here
#  450|   		return ret;
#  451|   	}
#  452|-> 	DBG_DEBUG("Created SOCKET FD:%d for sending arp\n", s);
#  453|   
#  454|   	/* Find interface */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def205]
samba-4.23.4/ctdb/common/system_socket.c:978:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
samba-4.23.4/ctdb/common/system_socket.c:972:13: acquire_resource: socket created here
samba-4.23.4/ctdb/common/system_socket.c:973:12: branch_false: following ‘false’ branch (when ‘s != -1’)...
samba-4.23.4/ctdb/common/system_socket.c:978:9: branch_false: ...to here
samba-4.23.4/ctdb/common/system_socket.c:978:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/ctdb/common/system_socket.c:978:9: danger: ‘s’ leaks here
#  976|   	}
#  977|   
#  978|-> 	DBG_DEBUG("Opened raw socket for TCP tickle capture (fd=%d)\n", s);
#  979|   
#  980|   	ret = set_blocking(s, false);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def206]
samba-4.23.4/ctdb/common/system_socket.c:980:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’
samba-4.23.4/ctdb/common/system_socket.c:972:13: acquire_resource: socket created here
samba-4.23.4/ctdb/common/system_socket.c:973:12: branch_false: following ‘false’ branch (when ‘s != -1’)...
samba-4.23.4/ctdb/common/system_socket.c:978:9: branch_false: ...to here
samba-4.23.4/ctdb/common/system_socket.c:980:15: throw: if ‘set_blocking’ throws an exception...
samba-4.23.4/ctdb/common/system_socket.c:980:15: danger: ‘s’ leaks here
#  978|   	DBG_DEBUG("Opened raw socket for TCP tickle capture (fd=%d)\n", s);
#  979|   
#  980|-> 	ret = set_blocking(s, false);
#  981|   	if (ret != 0) {
#  982|   		DBG_ERR("Failed to set socket non-blocking (%s)\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def207]
samba-4.23.4/ctdb/common/tunable.c:381:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(file, "r")’
samba-4.23.4/ctdb/common/tunable.c:370:14: acquire_resource: opened here
samba-4.23.4/ctdb/common/tunable.c:371:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_false: ...to here
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_true: ...to here
samba-4.23.4/ctdb/common/tunable.c:381:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/ctdb/common/tunable.c:381:9: danger: ‘fopen(file, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  379|   	}
#  380|   
#  381|-> 	D_NOTICE("Loading tunables from %s\n", file);
#  382|   	/*
#  383|   	 * allow_empty_value=true is somewhat counter-intuitive.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def208]
samba-4.23.4/ctdb/common/tunable.c:381:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(file, "r")’
samba-4.23.4/ctdb/common/tunable.c:370:14: acquire_memory: allocated here
samba-4.23.4/ctdb/common/tunable.c:371:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_false: ...to here
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/common/tunable.c:381:9: branch_true: ...to here
samba-4.23.4/ctdb/common/tunable.c:381:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/ctdb/common/tunable.c:381:9: danger: ‘fopen(file, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  379|   	}
#  380|   
#  381|-> 	D_NOTICE("Loading tunables from %s\n", file);
#  382|   	/*
#  383|   	 * allow_empty_value=true is somewhat counter-intuitive.

Error: GCC_ANALYZER_WARNING (CWE-457): [#def209]
samba-4.23.4/ctdb/conf/conf_tool.c:147:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘i_val’
samba-4.23.4/ctdb/conf/conf_tool.c:85:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/ctdb/conf/conf_tool.c:90:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:94:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/conf/conf_tool.c:100:15: branch_true: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:101:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/conf/conf_tool.c:106:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:136:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/conf/conf_tool.c:141:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:147:17: danger: use of uninitialized value ‘i_val’ here
#  145|   
#  146|   	case CONF_INTEGER:
#  147|-> 		printf("%d\n", i_val);
#  148|   		break;
#  149|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def210]
samba-4.23.4/ctdb/conf/conf_tool.c:151:38: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘b_val’
samba-4.23.4/ctdb/conf/conf_tool.c:85:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/ctdb/conf/conf_tool.c:90:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:94:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/conf/conf_tool.c:100:15: branch_true: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:101:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/conf/conf_tool.c:106:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:136:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/ctdb/conf/conf_tool.c:141:9: branch_false: ...to here
samba-4.23.4/ctdb/conf/conf_tool.c:151:38: danger: use of uninitialized value ‘b_val’ here
#  149|   
#  150|   	case CONF_BOOLEAN:
#  151|-> 		printf("%s\n", b_val ? "true" : "false");
#  152|   		break;
#  153|   	}

Error: COMPILER_WARNING (CWE-704): [#def211]
samba-4.23.4/ctdb/protocol/protocol_util.c: scope_hint: In function ‘ip_from_string’
samba-4.23.4/ctdb/protocol/protocol_util.c:257:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  257 |         p = strrchr(str, ':');
#      |           ^
#  255|   	 * IPv4-mapped IPv6 addresses anyway...
#  256|   	 */
#  257|-> 	p = strrchr(str, ':');
#  258|   	if (p == NULL) {
#  259|   		ret = ipv4_from_string(str, &addr->ip);

Error: COMPILER_WARNING (CWE-704): [#def212]
samba-4.23.4/ctdb/protocol/protocol_util.c:257:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  255|   	 * IPv4-mapped IPv6 addresses anyway...
#  256|   	 */
#  257|-> 	p = strrchr(str, ':');
#  258|   	if (p == NULL) {
#  259|   		ret = ipv4_from_string(str, &addr->ip);

Error: COMPILER_WARNING (CWE-704): [#def213]
samba-4.23.4/ctdb/protocol/protocol_util.c:275:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  275 |                         p = strrchr(str, ':');
#      |                           ^
#  273|   			s[len-1] = '\0';
#  274|   			str = s+1;
#  275|-> 			p = strrchr(str, ':');
#  276|   		}
#  277|   

Error: COMPILER_WARNING (CWE-704): [#def214]
samba-4.23.4/ctdb/protocol/protocol_util.c:275:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  273|   			s[len-1] = '\0';
#  274|   			str = s+1;
#  275|-> 			p = strrchr(str, ':');
#  276|   		}
#  277|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def215]
samba-4.23.4/ctdb/server/ctdb_call.c:98:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/ctdb/server/ctdb_call.c:92:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/server/ctdb_call.c:97:9: branch_false: ...to here
samba-4.23.4/ctdb/server/ctdb_call.c:97:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/ctdb/server/ctdb_call.c:98:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/ctdb/server/ctdb_call.c:98:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   96|   
#   97|   	va_start(ap, fmt);
#   98|-> 	msg = talloc_vasprintf(ctdb, fmt, ap);
#   99|   	if (msg == NULL) {
#  100|   		ctdb_fatal(ctdb, "Unable to allocate error in ctdb_send_error\n");

Error: COMPILER_WARNING (CWE-477): [#def216]
samba-4.23.4/ctdb/server/ctdb_daemon.c: scope_hint: In function ‘ctdb_start_daemon’
samba-4.23.4/ctdb/server/ctdb_daemon.c:1568:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
# 1568 |         tevent_loop_allow_nesting(ctdb->ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/ctdb/server/ctdb_daemon.c:30: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
# 1566|   		exit(1);
# 1567|   	}
# 1568|-> 	tevent_loop_allow_nesting(ctdb->ev);
# 1569|   	ctdb_tevent_trace_init();
# 1570|   	tevent_set_trace_callback(ctdb->ev, ctdb_tevent_trace, ctdb);

Error: COMPILER_WARNING (CWE-477): [#def217]
samba-4.23.4/ctdb/server/ctdb_daemon.c:1568:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
# 1566|   		exit(1);
# 1567|   	}
# 1568|-> 	tevent_loop_allow_nesting(ctdb->ev);
# 1569|   	ctdb_tevent_trace_init();
# 1570|   	tevent_set_trace_callback(ctdb->ev, ctdb_tevent_trace, ctdb);

Error: COMPILER_WARNING (CWE-477): [#def218]
samba-4.23.4/ctdb/server/ctdb_daemon.c: scope_hint: In function ‘switch_from_server_to_client’
samba-4.23.4/ctdb/server/ctdb_daemon.c:2488:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
# 2488 |         tevent_loop_allow_nesting(ctdb->ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
# 2486|   		exit(1);
# 2487|   	}
# 2488|-> 	tevent_loop_allow_nesting(ctdb->ev);
# 2489|   
# 2490|   	/* Connect to main CTDB daemon */

Error: COMPILER_WARNING (CWE-477): [#def219]
samba-4.23.4/ctdb/server/ctdb_daemon.c:2488:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
# 2486|   		exit(1);
# 2487|   	}
# 2488|-> 	tevent_loop_allow_nesting(ctdb->ev);
# 2489|   
# 2490|   	/* Connect to main CTDB daemon */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def220]
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1323:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(*ctdb.db_directory_persistent)’
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1318:13: acquire_memory: allocated here
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1319:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1319:12: branch_false: ...to here
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1323:20: throw: if ‘readdir’ throws an exception...
samba-4.23.4/ctdb/server/ctdb_ltdb_server.c:1323:20: danger: ‘opendir(*ctdb.db_directory_persistent)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1321|   	}
# 1322|   
# 1323|-> 	while ((de=readdir(d))) {
# 1324|   		char *p, *s, *q;
# 1325|   		size_t len = strlen(de->d_name);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def221]
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:120:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘nlist’
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2540:13: enter_function: entry to ‘recovery_nodemap_verify’
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2560:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2578:39: branch_true: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2579:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2579:12: branch_false: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2583:19: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2584:39: branch_true: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2593:20: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2593:20: branch_false: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2600:27: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2601:29: branch_true: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2601:28: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2602:33: branch_true: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2609:20: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2613:22: branch_false: ...to here
samba-4.23.4/ctdb/server/ctdb_recovery_helper.c:2613:22: call_function: calling ‘node_list_add’ from ‘recovery_nodemap_verify’
#  118|   	unsigned int i;
#  119|   
#  120|-> 	if (nlist->count == nlist->size) {
#  121|   		return false;
#  122|   	}

Error: COMPILER_WARNING (CWE-477): [#def222]
samba-4.23.4/ctdb/server/ctdbd.c: scope_hint: In function ‘main’
samba-4.23.4/ctdb/server/ctdbd.c:188:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  188 |         tevent_loop_allow_nesting(ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/ctdb/server/ctdbd.c:31: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#  186|   		exit(1);
#  187|   	}
#  188|-> 	tevent_loop_allow_nesting(ev);
#  189|   
#  190|   	ctdb = ctdb_init(ev);

Error: COMPILER_WARNING (CWE-477): [#def223]
samba-4.23.4/ctdb/server/ctdbd.c:188:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  186|   		exit(1);
#  187|   	}
#  188|-> 	tevent_loop_allow_nesting(ev);
#  189|   
#  190|   	ctdb = ctdb_init(ev);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def224]
samba-4.23.4/ctdb/server/eventscript.c:610:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/ctdb/server/eventscript.c:760:5: enter_function: entry to ‘ctdb_event_script_callback’
samba-4.23.4/ctdb/server/eventscript.c:770:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/ctdb/server/eventscript.c:771:15: call_function: calling ‘ctdb_event_script_run’ from ‘ctdb_event_script_callback’
#  608|   	if ( (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) &&
#  609|   	     (! event_allowed_during_recovery(event)) ) {
#  610|-> 		DEBUG(DEBUG_ERR,
#  611|   		      ("Refusing to run event '%s' while in recovery\n",
#  612|   		       ctdb_event_to_string(event)));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def225]
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:160:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘hn’
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:134:6: enter_function: entry to ‘ipalloc_deterministic’
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:136:40: call_function: calling ‘ipalloc_get_home_nodes’ from ‘ipalloc_deterministic’
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:136:40: return_function: returning to ‘ipalloc_deterministic’ from ‘ipalloc_get_home_nodes’
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:150:49: branch_true: following ‘true’ branch (when ‘t’ is non-NULL)...
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:153:26: branch_true: ...to here
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:155:29: branch_true: following ‘true’ branch (when ‘j < num_home_nodes’)...
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:156:59: branch_true: ...to here
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:158:28: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:160:37: branch_true: ...to here
samba-4.23.4/ctdb/server/ipalloc_deterministic.c:160:37: danger: dereference of NULL ‘hn’
#  158|   			if (ctdb_sock_addr_same_ip(&t->addr, &hn->addr)) {
#  159|   
#  160|-> 				if (hn->pnn >= numnodes) {
#  161|   					DBG_WARNING("pnn %" PRIu32
#  162|   						    " too large\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def226]
samba-4.23.4/ctdb/tools/ctdb.c:207:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/ctdb/tools/ctdb.c:192:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/tools/ctdb.c:196:9: branch_false: ...to here
samba-4.23.4/ctdb/tools/ctdb.c:200:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/tools/ctdb.c:206:16: branch_false: ...to here
samba-4.23.4/ctdb/tools/ctdb.c:207:13: danger: dereference of NULL ‘<unknown>’
#  205|   
#  206|   	node = get_node_by_pnn(nodemap, current_node);
#  207|-> 	if (node->flags & NODE_FLAGS_BANNED) {
#  208|   		/* Pick next node */
#  209|   		do {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def227]
samba-4.23.4/ctdb/tools/ctdb.c:212:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/ctdb/tools/ctdb.c:175:30: enter_function: entry to ‘get_nodemap’
samba-4.23.4/ctdb/tools/ctdb.c:192:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/tools/ctdb.c:196:9: branch_false: ...to here
samba-4.23.4/ctdb/tools/ctdb.c:200:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/tools/ctdb.c:206:16: branch_false: ...to here
samba-4.23.4/ctdb/tools/ctdb.c:206:16: call_function: inlined call to ‘get_node_by_pnn’ from ‘get_nodemap’
samba-4.23.4/ctdb/tools/ctdb.c:207:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/tools/ctdb.c:207:12: branch_true: ...to here
samba-4.23.4/ctdb/tools/ctdb.c:211:32: call_function: inlined call to ‘get_node_by_pnn’ from ‘get_nodemap’
samba-4.23.4/ctdb/tools/ctdb.c:212:32: danger: dereference of NULL ‘<unknown>’
#  210|   			current_node = (current_node + 1) % nodemap->num;
#  211|   			node = get_node_by_pnn(nodemap, current_node);
#  212|-> 			if (! (node->flags &
#  213|   			      (NODE_FLAGS_DELETED|NODE_FLAGS_DISCONNECTED))) {
#  214|   				break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def228]
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:71:16: warning[-Wanalyzer-malloc-leak]: leak of ‘val’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:119:13: enter_function: entry to ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:129:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:13: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: acquire_memory: allocated here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:143:12: branch_false: following ‘false’ branch (when ‘val’ is non-NULL)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:151:9: call_function: inlined call to ‘start_timer’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:153:15: call_function: calling ‘lock_range’ from ‘ping_pong’
#   69|   	lock.l_pid = 0;
#   70|   	
#   71|-> 	return fcntl(fd, wait ? F_SETLKW : F_SETLK, &lock);
#   72|   }
#   73|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def229]
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:86:15: warning[-Wanalyzer-malloc-leak]: leak of ‘val’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:119:13: enter_function: entry to ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:129:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:13: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: acquire_memory: allocated here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:143:12: branch_false: following ‘false’ branch (when ‘val’ is non-NULL)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:151:9: call_function: inlined call to ‘start_timer’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:153:15: call_function: calling ‘lock_range’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:153:15: return_function: returning to ‘ping_pong’ from ‘lock_range’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:154:12: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:162:21: call_function: calling ‘lock_range’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:162:21: return_function: returning to ‘ping_pong’ from ‘lock_range’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:166:20: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:167:31: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:167:31: call_function: calling ‘check_lock’ from ‘ping_pong’
#   84|   	lock.l_pid = 0;
#   85|   
#   86|-> 	ret = fcntl(fd, F_GETLK, &lock);
#   87|   	if (ret != 0) {
#   88|   		printf("error calling fcntl F_GETLCK: %s\n", strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def230]
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:115:16: warning[-Wanalyzer-malloc-leak]: leak of ‘val’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:119:13: enter_function: entry to ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:129:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:13: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:134:12: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:135:21: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:136:20: branch_false: following ‘false’ branch (when ‘p != 18446744073709551615’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:142:32: acquire_memory: allocated here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:143:12: branch_false: following ‘false’ branch (when ‘val’ is non-NULL)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:151:9: call_function: inlined call to ‘start_timer’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:153:15: call_function: calling ‘lock_range’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:153:15: return_function: returning to ‘ping_pong’ from ‘lock_range’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:154:12: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:162:21: call_function: calling ‘lock_range’ from ‘ping_pong’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:162:21: return_function: returning to ‘ping_pong’ from ‘lock_range’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:166:20: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:167:31: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:168:28: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:172:21: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:172:20: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:174:29: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:174:28: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:175:38: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:182:20: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:183:37: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:184:28: branch_true: following ‘true’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:185:34: branch_true: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:190:21: call_function: calling ‘unlock_range’ from ‘ping_pong’
#  113|   	lock.l_pid = 0;
#  114|   	
#  115|-> 	return fcntl(fd,F_SETLKW,&lock);
#  116|   }
#  117|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def231]
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:186:36: warning[-Wanalyzer-malloc-leak]: leak of ‘val’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:230:5: enter_function: entry to ‘main’
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:262:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:267:9: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:270:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:274:13: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:274:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:289:12: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:289:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:294:21: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:295:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:300:9: branch_false: ...to here
samba-4.23.4/ctdb/utils/ping_pong/ping_pong.c:300:9: call_function: calling ‘ping_pong’ from ‘main’
#  184|   			if (use_mmap) {
#  185|   				p[i] = c;
#  186|-> 			} else if (pwrite(fd, &c, 1, i) != 1) {
#  187|   				printf("write failed at %d\n", i);
#  188|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def232]
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:71:16: warning[-Wanalyzer-malloc-leak]: leak of ‘key.dptr’
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:60:12: enter_function: entry to ‘get_hash_chain’
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:67:20: call_function: calling ‘hex_decode’ from ‘get_hash_chain’
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:67:20: return_function: returning to ‘get_hash_chain’ from ‘hex_decode’
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:68:12: branch_false: following ‘false’ branch...
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:71:16: throw: if ‘tdb_jenkins_hash’ throws an exception...
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:71:16: danger: ‘key.dptr’ leaks here; was allocated at [(6)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/5)
#   69|   		return -1;
#   70|   	}
#   71|-> 	hash = tdb_jenkins_hash(&key);
#   72|   	free(key.dptr);
#   73|   

Error: COMPILER_WARNING (CWE-477): [#def233]
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c: scope_hint: In function ‘check_one’
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:90:17: warning[-Wdeprecated-declarations]: ‘pthread_mutex_consistent_np’ is deprecated: pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent
#   90 |                 ret = pthread_mutex_consistent_np(m);
#      |                 ^~~
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:20: included_from: Included from here.
/usr/include/pthread.h:859:12: note: declared here
#  859 | extern int __REDIRECT_NTH (pthread_mutex_consistent_np, (pthread_mutex_t *),
#      |            ^~~~~~~~~~~~~~
#   88|   	}
#   89|   	if (ret == EOWNERDEAD) {
#   90|-> 		ret = pthread_mutex_consistent_np(m);
#   91|   		if (ret != 0) {
#   92|   			printf("[%6d] consistent failed (%d)\n", chain, ret);

Error: COMPILER_WARNING (CWE-477): [#def234]
samba-4.23.4/ctdb/utils/tdb/tdb_mutex_check.c:90:17: warning[-Wdeprecated-declarations]: ‘pthread_mutex_consistent_np’ is deprecated: pthread_mutex_consistent_np is deprecated, use pthread_mutex_consistent
#   88|   	}
#   89|   	if (ret == EOWNERDEAD) {
#   90|-> 		ret = pthread_mutex_consistent_np(m);
#   91|   		if (ret != 0) {
#   92|   			printf("[%6d] consistent failed (%d)\n", chain, ret);

Error: COMPILER_WARNING (CWE-704): [#def235]
samba-4.23.4/lib/addns/dnsquery_srv.c: scope_hint: In function ‘ads_dns_query_srv_send’
samba-4.23.4/lib/addns/dnsquery_srv.c:348:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  348 |                 after_tcp = strstr(state->query, "._tcp.");
#      |                           ^
#  346|   		 * ".<SITENAME>._sites" comes after "._tcp."
#  347|   		 */
#  348|-> 		after_tcp = strstr(state->query, "._tcp.");
#  349|   		if (after_tcp == NULL) {
#  350|   			tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);

Error: COMPILER_WARNING (CWE-704): [#def236]
samba-4.23.4/lib/addns/dnsquery_srv.c:348:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  346|   		 * ".<SITENAME>._sites" comes after "._tcp."
#  347|   		 */
#  348|-> 		after_tcp = strstr(state->query, "._tcp.");
#  349|   		if (after_tcp == NULL) {
#  350|   			tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);

Error: COMPILER_WARNING (CWE-704): [#def237]
samba-4.23.4/lib/cmdline/cmdline.c: scope_hint: In function ‘is_password_option’
samba-4.23.4/lib/cmdline/cmdline.c:241:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  241 |         equals = strchr(p, '=');
#      |                ^
#  239|   	 * the argument to it, which should not be burnt.
#  240|   	 */
#  241|-> 	equals = strchr(p, '=');
#  242|   	if (equals == NULL) {
#  243|   		*ulen = strlen(p);

Error: COMPILER_WARNING (CWE-704): [#def238]
samba-4.23.4/lib/cmdline/cmdline.c:241:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  239|   	 * the argument to it, which should not be burnt.
#  240|   	 */
#  241|-> 	equals = strchr(p, '=');
#  242|   	if (equals == NULL) {
#  243|   		*ulen = strlen(p);

Error: COMPILER_WARNING (CWE-704): [#def239]
samba-4.23.4/lib/cmdline/cmdline.c:245:30: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  245 |                 char *pass = (strstr(p, "pass"));
#      |                              ^
#  243|   		*ulen = strlen(p);
#  244|   	} else {
#  245|-> 		char *pass = (strstr(p, "pass"));
#  246|   		if (pass > equals) {
#  247|   			/* this is --foo=pass, not --pass=foo */

Error: COMPILER_WARNING (CWE-704): [#def240]
samba-4.23.4/lib/cmdline/cmdline.c:245:30: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  243|   		*ulen = strlen(p);
#  244|   	} else {
#  245|-> 		char *pass = (strstr(p, "pass"));
#  246|   		if (pass > equals) {
#  247|   			/* this is --foo=pass, not --pass=foo */

Error: CPPCHECK_WARNING (CWE-457): [#def241]
samba-4.23.4/lib/compression/lzxpress_huffman.c:219: warning[uninitvar]: Uninitialized variable: row
#  217|   		}
#  218|   		for (j = 0; j < depth; j++) {
#  219|-> 			switch (row[j]) {
#  220|   			case -3:
#  221|   				code[j] = '1';

Error: CPPCHECK_WARNING (CWE-786): [#def242]
samba-4.23.4/lib/dbwrap/dbwrap.c:184: error[negativeIndex]: Array 'locked_dbs[4]' accessed at index -1, which is out of bounds.
#  182|   
#  183|   	for (idx=lock_order-1; idx<DBWRAP_LOCK_ORDER_MAX; idx++) {
#  184|-> 		if (locked_dbs[idx] != NULL) {
#  185|   			DBG_ERR("Lock order violation: Trying %s at %d while "
#  186|   				"%s at %d is locked\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def243]
samba-4.23.4/lib/krb5_wrap/gss_samba.c:132:32: warning[-Wanalyzer-malloc-leak]: leak of ‘keytab_element.value’
samba-4.23.4/lib/krb5_wrap/gss_samba.c:118:12: branch_false: following ‘false’ branch (when ‘id’ is NULL)...
samba-4.23.4/lib/krb5_wrap/gss_samba.c:127:12: branch_false: ...to here
samba-4.23.4/lib/krb5_wrap/gss_samba.c:127:12: branch_true: following ‘true’ branch (when ‘keytab’ is non-NULL)...
samba-4.23.4/lib/krb5_wrap/gss_samba.c:128:40: branch_true: ...to here
samba-4.23.4/lib/krb5_wrap/gss_samba.c:128:40: acquire_memory: allocated here
samba-4.23.4/lib/krb5_wrap/gss_samba.c:129:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/krb5_wrap/gss_samba.c:132:32: branch_false: ...to here
samba-4.23.4/lib/krb5_wrap/gss_samba.c:132:32: throw: if ‘krb5_kt_get_name’ throws an exception...
samba-4.23.4/lib/krb5_wrap/gss_samba.c:132:32: danger: ‘keytab_element.value’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  130|   			return ENOMEM;
#  131|   		}
#  132|-> 		major_status = krb5_kt_get_name(ctx,
#  133|   						keytab,
#  134|   						discard_const(keytab_element.value), 4096);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def244]
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:2994:16: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:2993:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:2994:16: throw: if ‘krb5_build_principal_alloc_va’ throws an exception...
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:2994:16: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 2992|   
# 2993|   	va_start(ap, _realm);
# 2994|-> 	code = krb5_build_principal_alloc_va(context, principal,
# 2995|   					     strlen(realm), realm,
# 2996|   					     ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def245]
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:3529:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:3528:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:3529:9: throw: if ‘com_err_va’ throws an exception...
samba-4.23.4/lib/krb5_wrap/krb5_samba.c:3529:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 3527|   
# 3528|   	va_start(args, fmt);
# 3529|-> 	com_err_va("samba-kdc", errno, fmt, args);
# 3530|   	va_end(args);
# 3531|   

Error: COMPILER_WARNING: [#def246]
samba-4.23.4/lib/krb5_wrap/krb5_samba.h:209:24: warning[-Wunused-but-set-variable=]: variable ‘key’ set but not used
#  209 |         krb5_keyblock *key = NULL;
#      |                        ^~~
#  207|   	char tmp[2 * MAX_KEYLEN + 1] = { 0, };
#  208|   	krb5_enctype enctype = 0;
#  209|-> 	krb5_keyblock *key = NULL;
#  210|   	TALLOC_CTX *frame = talloc_stackframe();
#  211|   	krb5_error_code code;

Error: COMPILER_WARNING (CWE-563): [#def247]
samba-4.23.4/lib/krb5_wrap/krb5_samba.h:212:24: warning[-Wunused-variable]: unused variable ‘ptr’
#  212 |         const uint8_t *ptr = NULL;
#      |                        ^~~
#  210|   	TALLOC_CTX *frame = talloc_stackframe();
#  211|   	krb5_error_code code;
#  212|-> 	const uint8_t *ptr = NULL;
#  213|   	unsigned len, i;
#  214|   

Error: COMPILER_WARNING (CWE-563): [#def248]
samba-4.23.4/lib/krb5_wrap/krb5_samba.h:213:18: warning[-Wunused-variable]: unused variable ‘len’
#  213 |         unsigned len, i;
#      |                  ^~~
#  211|   	krb5_error_code code;
#  212|   	const uint8_t *ptr = NULL;
#  213|-> 	unsigned len, i;
#  214|   
#  215|   	code = smb_krb5_unparse_name(frame,

Error: COMPILER_WARNING (CWE-563): [#def249]
samba-4.23.4/lib/krb5_wrap/keytab_util.c:37: included_from: Included from here.
samba-4.23.4/lib/krb5_wrap/krb5_samba.h: scope_hint: In function ‘samba_trace_keytab_entry’
samba-4.23.4/lib/krb5_wrap/krb5_samba.h:213:23: warning[-Wunused-variable]: unused variable ‘i’
#  213 |         unsigned len, i;
#      |                       ^
#  211|   	krb5_error_code code;
#  212|   	const uint8_t *ptr = NULL;
#  213|-> 	unsigned len, i;
#  214|   
#  215|   	code = smb_krb5_unparse_name(frame,

Error: COMPILER_WARNING (CWE-477): [#def250]
samba-4.23.4/lib/ldb/common/ldb.c: scope_hint: In function ‘ldb_init’
samba-4.23.4/lib/ldb/common/ldb.c:121:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  121 |                 tevent_loop_allow_nesting(ev_ctx);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/lib/ldb/include/ldb.h:51: included_from: Included from here.
samba-4.23.4/lib/ldb/include/ldb_private.h:43: included_from: Included from here.
samba-4.23.4/lib/ldb/common/ldb.c:36: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#  119|   		tevent_set_debug(ev_ctx, ldb_tevent_debug, ldb);
#  120|   		tevent_set_max_debug_level(ev_ctx, TEVENT_DEBUG_TRACE);
#  121|-> 		tevent_loop_allow_nesting(ev_ctx);
#  122|   	}
#  123|   

Error: COMPILER_WARNING (CWE-477): [#def251]
samba-4.23.4/lib/ldb/common/ldb.c:121:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  119|   		tevent_set_debug(ev_ctx, ldb_tevent_debug, ldb);
#  120|   		tevent_set_max_debug_level(ev_ctx, TEVENT_DEBUG_TRACE);
#  121|-> 		tevent_loop_allow_nesting(ev_ctx);
#  122|   	}
#  123|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def252]
samba-4.23.4/lib/ldb/common/ldb.c:314:27: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb.c:1504:5: enter_function: entry to ‘ldb_build_search_req’
samba-4.23.4/lib/ldb/common/ldb.c:1520:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb.c:1521:17: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb.c:1521:17: call_function: calling ‘ldb_set_errstring’ from ‘ldb_build_search_req’
#  312|   
#  313|   	va_start(ap, format);
#  314|-> 	ldb->err_string = talloc_vasprintf(ldb, format, ap);
#  315|   	va_end(ap);
#  316|   

Error: COMPILER_WARNING (CWE-477): [#def253]
samba-4.23.4/lib/ldb/common/ldb.c: scope_hint: In function ‘ldb_handle_new’
samba-4.23.4/lib/ldb/common/ldb.c:761:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  761 |                 tevent_loop_allow_nesting(h->event_context);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#  759|   		tevent_set_debug(h->event_context, ldb_tevent_debug, ldb);
#  760|   		tevent_set_max_debug_level(h->event_context, TEVENT_DEBUG_TRACE);
#  761|-> 		tevent_loop_allow_nesting(h->event_context);
#  762|   	}
#  763|   

Error: COMPILER_WARNING (CWE-477): [#def254]
samba-4.23.4/lib/ldb/common/ldb.c:761:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#  759|   		tevent_set_debug(h->event_context, ldb_tevent_debug, ldb);
#  760|   		tevent_set_max_debug_level(h->event_context, TEVENT_DEBUG_TRACE);
#  761|-> 		tevent_loop_allow_nesting(h->event_context);
#  762|   	}
#  763|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def255]
samba-4.23.4/lib/ldb/common/ldb.c:1769:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb.c:1763:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb.c:1767:12: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb.c:1767:12: branch_true: following ‘true’ branch (when ‘exp_fmt’ is non-NULL)...
samba-4.23.4/lib/ldb/common/ldb.c:1768:17: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb.c:1768:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb.c:1769:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb.c:1769:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
# 1767|   	if (exp_fmt) {
# 1768|   		va_start(ap, exp_fmt);
# 1769|-> 		expression = talloc_vasprintf(mem_ctx, exp_fmt, ap);
# 1770|   		va_end(ap);
# 1771|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def256]
samba-4.23.4/lib/ldb/common/ldb_debug.c:93:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_debug.c:99:6: enter_function: entry to ‘ldb_debug’
samba-4.23.4/lib/ldb/common/ldb_debug.c:102:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_debug.c:103:9: call_function: calling ‘ldb_vdebug’ from ‘ldb_debug’
#   91|   		}
#   92|   	}
#   93|-> 	ldb->debug_ops.debug(ldb->debug_ops.context, level, fmt, ap);
#   94|   }
#   95|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def257]
samba-4.23.4/lib/ldb/common/ldb_debug.c:115:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_debug.c:113:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_debug.c:114:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_debug.c:115:38: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_debug.c:115:38: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_debug.c:115:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  113|   	va_start(ap, fmt);
#  114|   	if (ldb->partial_debug == NULL) {
#  115|-> 		ldb->partial_debug = talloc_vasprintf(ldb, fmt, ap);
#  116|   	} else {
#  117|   		ldb->partial_debug = talloc_vasprintf_append(ldb->partial_debug, 

Error: GCC_ANALYZER_WARNING (CWE-404): [#def258]
samba-4.23.4/lib/ldb/common/ldb_debug.c:117:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_debug.c:113:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_debug.c:114:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_debug.c:117:38: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_debug.c:117:38: throw: if ‘talloc_vasprintf_append’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_debug.c:117:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  115|   		ldb->partial_debug = talloc_vasprintf(ldb, fmt, ap);
#  116|   	} else {
#  117|-> 		ldb->partial_debug = talloc_vasprintf_append(ldb->partial_debug, 
#  118|   							     fmt, ap);
#  119|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def259]
samba-4.23.4/lib/ldb/common/ldb_debug.c:142:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_debug.c:141:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_debug.c:142:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_debug.c:142:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  140|   	char *msg;
#  141|   	va_start(ap, fmt);
#  142|-> 	msg = talloc_vasprintf(ldb, fmt, ap);
#  143|   	va_end(ap);
#  144|   	if (msg != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def260]
samba-4.23.4/lib/ldb/common/ldb_dn.c:1545:20: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_dn.c:1540:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_dn.c:1544:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_dn.c:1545:20: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_dn.c:1545:20: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1543|   
# 1544|   	va_start(ap, base_fmt);
# 1545|-> 	base_str = talloc_vasprintf(dn, base_fmt, ap);
# 1546|   	va_end(ap);
# 1547|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def261]
samba-4.23.4/lib/ldb/common/ldb_dn.c:1674:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_dn.c:1669:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_dn.c:1673:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_dn.c:1674:21: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_dn.c:1674:21: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 1672|   
# 1673|   	va_start(ap, child_fmt);
# 1674|-> 	child_str = talloc_vasprintf(dn, child_fmt, ap);
# 1675|   	va_end(ap);
# 1676|   

Error: COMPILER_WARNING (CWE-704): [#def262]
samba-4.23.4/lib/ldb/common/ldb_ldif.c: scope_hint: In function ‘ldb_base64_decode’
samba-4.23.4/lib/ldb/common/ldb_ldif.c:117:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  117 |         while (*s && (p=strchr(b64,*s))) {
#      |                        ^
#  115|   	n=i=0;
#  116|   
#  117|-> 	while (*s && (p=strchr(b64,*s))) {
#  118|   		idx = (int)(p - b64);
#  119|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def263]
samba-4.23.4/lib/ldb/common/ldb_ldif.c:117:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  115|   	n=i=0;
#  116|   
#  117|-> 	while (*s && (p=strchr(b64,*s))) {
#  118|   		idx = (int)(p - b64);
#  119|   		byte_offset = (i*6)/8;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def264]
samba-4.23.4/lib/ldb/common/ldb_ldif.c:1057:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_ldif.c:1066:7: enter_function: entry to ‘ldb_ldif_write_redacted_trace_string’
samba-4.23.4/lib/ldb/common/ldb_ldif.c:1071:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_ldif.c:1074:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_ldif.c:1074:13: call_function: calling ‘ldb_ldif_write_trace’ from ‘ldb_ldif_write_redacted_trace_string’
# 1055|   	va_start(ap, fmt);
# 1056|   
# 1057|-> 	state->string = talloc_vasprintf_append(state->string, fmt, ap);
# 1058|   	va_end(ap);
# 1059|   	if (!state->string) {

Error: COMPILER_WARNING (CWE-704): [#def265]
samba-4.23.4/lib/ldb/common/ldb_modules.c: scope_hint: In function ‘ldb_module_connect_backend’
samba-4.23.4/lib/ldb/common/ldb_modules.c:202:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  202 |         colon = strchr(url, ':');
#      |               ^
#  200|   	char *colon = NULL;
#  201|   
#  202|-> 	colon = strchr(url, ':');
#  203|   	if (colon != NULL) {
#  204|   		backend = talloc_strndup(ldb, url, colon-url);

Error: COMPILER_WARNING (CWE-704): [#def266]
samba-4.23.4/lib/ldb/common/ldb_modules.c:202:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  200|   	char *colon = NULL;
#  201|   
#  202|-> 	colon = strchr(url, ':');
#  203|   	if (colon != NULL) {
#  204|   		backend = talloc_strndup(ldb, url, colon-url);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def267]
samba-4.23.4/lib/ldb/common/ldb_modules.c:1063:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(modules_dir)’
samba-4.23.4/lib/ldb/common/ldb_modules.c:1049:15: acquire_memory: allocated here
samba-4.23.4/lib/ldb/common/ldb_modules.c:1050:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_modules.c:1050:12: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_modules.c:1063:22: throw: if ‘readdir’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_modules.c:1063:22: danger: ‘opendir(modules_dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1061|   
# 1062|   
# 1063|-> 	while ((de = readdir(dir))) {
# 1064|   		if (ISDOT(de->d_name) || ISDOTDOT(de->d_name))
# 1065|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def268]
samba-4.23.4/lib/ldb/common/ldb_msg.c:597:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_msg.c:596:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_msg.c:597:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_msg.c:597:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  595|   
#  596|   	va_start(ap, fmt);
#  597|-> 	str = talloc_vasprintf(msg, fmt, ap);
#  598|   	va_end(ap);
#  599|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def269]
samba-4.23.4/lib/ldb/common/ldb_msg.c:729:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/common/ldb_msg.c:728:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/common/ldb_msg.c:729:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/common/ldb_msg.c:729:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  727|   
#  728|   	va_start(ap, fmt);
#  729|-> 	str = talloc_vasprintf(msg, fmt, ap);
#  730|   	va_end(ap);
#  731|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def270]
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/lib/ldb/common/ldb_pack.c:555:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:562:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:612:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:617:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:617:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:621:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:621:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:626:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:642:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:642:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:643:40: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:645:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:651:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:651:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:660:20: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:660:20: branch_false: following ‘false’ branch (when ‘remaining > 9’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:669:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:670:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:674:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:674:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:680:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:684:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:688:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:691:17: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:695:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:704:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:705:20: branch_false: following ‘false’ branch (when ‘remaining > 3’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:709:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:710:29: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:715:28: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:715:28: branch_false: following ‘false’ branch (when ‘remaining > 4’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:719:25: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:722:28: branch_false: following ‘false’ branch (when ‘remaining >= len’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  729|   			}
#  730|   
#  731|-> 			element->values[j].length = len;
#  732|   			element->values[j].data = p + U32_LEN;
#  733|   			remaining -= len;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def271]
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ldb_val_single_array’
samba-4.23.4/lib/ldb/common/ldb_pack.c:555:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:562:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:612:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:617:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:617:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:621:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:621:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:626:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:642:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:642:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:651:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:651:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:660:20: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:660:20: branch_false: following ‘false’ branch (when ‘remaining > 9’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:669:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:670:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:674:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:674:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:680:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:684:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:688:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:691:17: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:692:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:695:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:695:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:704:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:705:20: branch_false: following ‘false’ branch (when ‘remaining > 3’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:709:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:710:29: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:715:28: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:715:28: branch_false: following ‘false’ branch (when ‘remaining > 4’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:719:25: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:722:28: branch_false: following ‘false’ branch (when ‘remaining >= len’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:731:25: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  729|   			}
#  730|   
#  731|-> 			element->values[j].length = len;
#  732|   			element->values[j].data = p + U32_LEN;
#  733|   			remaining -= len;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def272]
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:876:40: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:879:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_true: following ‘true’ branch (when ‘val_len_width == 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:972:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  971|   		if (val_len_width == U8_LEN) {
#  972|   			for (j = 0; j < element->num_values; j++) {
#  973|-> 				element->values[j].length = PULL_LE_U8(p, 0);
#  974|   				p += U8_LEN;
#  975|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def273]
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ldb_val_single_array’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:935:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_true: following ‘true’ branch (when ‘val_len_width == 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:972:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:973:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  971|   		if (val_len_width == U8_LEN) {
#  972|   			for (j = 0; j < element->num_values; j++) {
#  973|-> 				element->values[j].length = PULL_LE_U8(p, 0);
#  974|   				p += U8_LEN;
#  975|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def274]
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:876:40: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:879:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: following ‘false’ branch (when ‘val_len_width != 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_true: following ‘true’ branch (when ‘val_len_width == 2’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:977:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  976|   		} else if (val_len_width == U16_LEN) {
#  977|   			for (j = 0; j < element->num_values; j++) {
#  978|-> 				element->values[j].length = PULL_LE_U16(p, 0);
#  979|   				p += U16_LEN;
#  980|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def275]
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ldb_val_single_array’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:935:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: following ‘false’ branch (when ‘val_len_width != 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_true: following ‘true’ branch (when ‘val_len_width == 2’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:977:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:978:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  976|   		} else if (val_len_width == U16_LEN) {
#  977|   			for (j = 0; j < element->num_values; j++) {
#  978|-> 				element->values[j].length = PULL_LE_U16(p, 0);
#  979|   				p += U16_LEN;
#  980|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def276]
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:876:40: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:879:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: following ‘false’ branch (when ‘val_len_width != 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: following ‘false’ branch (when ‘val_len_width != 2’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_true: following ‘true’ branch (when ‘val_len_width == 4’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:982:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  981|   		} else if (val_len_width == U32_LEN) {
#  982|   			for (j = 0; j < element->num_values; j++) {
#  983|-> 				element->values[j].length = PULL_LE_U32(p, 0);
#  984|   				p += U32_LEN;
#  985|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def277]
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ldb_val_single_array’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:935:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: following ‘false’ branch (when ‘val_len_width != 1’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:976:27: branch_false: following ‘false’ branch (when ‘val_len_width != 2’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_true: following ‘true’ branch (when ‘val_len_width == 4’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:981:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:982:37: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:61: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:983:33: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  981|   		} else if (val_len_width == U32_LEN) {
#  982|   			for (j = 0; j < element->num_values; j++) {
#  983|-> 				element->values[j].length = PULL_LE_U32(p, 0);
#  984|   				p += U32_LEN;
#  985|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def278]
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*element.values’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:876:40: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:879:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:972:37: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:991:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:991:29: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:31: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:31: release_memory: ‘*element.values’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:25: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  990|   
#  991|   		for (j = 0; j < element->num_values; j++) {
#  992|-> 			len = element->values[j].length;
#  993|   			if (len + NULL_PAD_BYTE_LEN < len) {
#  994|   				errno = EIO;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def279]
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ldb_val_single_array’
samba-4.23.4/lib/ldb/common/ldb_pack.c:789:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:794:33: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:800:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:805:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:820:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:826:15: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:829:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:834:9: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:836:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:841:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:853:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:858:29: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:861:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:13: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:875:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:885:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:889:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:898:27: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:895:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:903:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:906:20: branch_false: following ‘false’ branch (when ‘attr_len != 0’)...
samba-4.23.4/lib/ldb/common/ldb_pack.c:912:22: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:919:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:21: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:924:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:929:28: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:934:17: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:935:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:939:27: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:956:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:959:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:971:20: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:972:37: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:991:17: branch_false: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:991:29: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:31: branch_true: ...to here
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:31: release_memory: ‘ldb_val_single_array’ is NULL
samba-4.23.4/lib/ldb/common/ldb_pack.c:992:25: danger: dereference of NULL ‘*element.values + (long unsigned int)j * 16’
#  990|   
#  991|   		for (j = 0; j < element->num_values; j++) {
#  992|-> 			len = element->values[j].length;
#  993|   			if (len + NULL_PAD_BYTE_LEN < len) {
#  994|   				errno = EIO;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def280]
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:40:19: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:36:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:39:9: branch_false: ...to here
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:39:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:40:19: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c:40:19: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   38|   
#   39|   	va_start(ap, fmt);
#   40|-> 	message = talloc_vasprintf(ldb, fmt, ap);
#   41|   	va_end(ap);
#   42|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def281]
samba-4.23.4/lib/ldb/tools/ldbadd.c:58:100: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
samba-4.23.4/lib/ldb/tools/ldbadd.c:131:5: enter_function: entry to ‘main’
samba-4.23.4/lib/ldb/tools/ldbadd.c:139:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:143:19: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:146:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:20: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:154:26: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:155:45: branch_true: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:157:29: acquire_resource: opened here
samba-4.23.4/lib/ldb/tools/ldbadd.c:158:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:162:31: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:162:31: call_function: calling ‘process_file’ from ‘main’
#   56|   	struct ldb_ldif *ldif;
#   57|   	int fun_ret = LDB_SUCCESS, ret;
#   58|->         struct ldb_control **req_ctrls = ldb_parse_control_strings(ldb, ldb, (const char **)options->controls);
#   59|   	struct ldif_read_file_state state = {
#   60|   		.f = f

Error: GCC_ANALYZER_WARNING (CWE-401): [#def282]
samba-4.23.4/lib/ldb/tools/ldbadd.c:58:100: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
samba-4.23.4/lib/ldb/tools/ldbadd.c:131:5: enter_function: entry to ‘main’
samba-4.23.4/lib/ldb/tools/ldbadd.c:139:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:143:19: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:146:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:20: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:151:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:154:26: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:155:45: branch_true: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:157:29: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbadd.c:158:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbadd.c:162:31: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbadd.c:162:31: call_function: calling ‘process_file’ from ‘main’
#   56|   	struct ldb_ldif *ldif;
#   57|   	int fun_ret = LDB_SUCCESS, ret;
#   58|->         struct ldb_control **req_ctrls = ldb_parse_control_strings(ldb, ldb, (const char **)options->controls);
#   59|   	struct ldif_read_file_state state = {
#   60|   		.f = f

Error: GCC_ANALYZER_WARNING (CWE-401): [#def283]
samba-4.23.4/lib/ldb/tools/ldbedit.c:206:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/lib/ldb/tools/ldbedit.c:216:12: enter_function: entry to ‘do_edit’
samba-4.23.4/lib/ldb/tools/ldbedit.c:231:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:236:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:236:13: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbedit.c:238:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/lib/ldb/tools/ldbedit.c:245:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:245:13: call_function: calling ‘save_ldif’ from ‘do_edit’
#  204|   		ldif.msg = msgs[i];
#  205|   
#  206|-> 		ldb_ldif_write_file(ldb, f, &ldif);
#  207|   	}
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def284]
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&file_template, "r")’
samba-4.23.4/lib/ldb/tools/ldbedit.c:231:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:236:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:238:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/lib/ldb/tools/ldbedit.c:245:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:253:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:260:15: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:263:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:270:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:270:13: acquire_resource: opened here
samba-4.23.4/lib/ldb/tools/ldbedit.c:271:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:271:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: throw: if ‘ldb_ldif_read_file’ throws an exception...
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: danger: ‘fopen(&file_template, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  274|   	}
#  275|   
#  276|-> 	while ((ldif = ldb_ldif_read_file(ldb, f))) {
#  277|   		msgs2 = talloc_realloc(ldb, msgs2, struct ldb_message *, count2+1);
#  278|   		if (!msgs2) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def285]
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&file_template, "r")’
samba-4.23.4/lib/ldb/tools/ldbedit.c:231:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:236:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:238:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/lib/ldb/tools/ldbedit.c:245:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:253:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:260:15: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:263:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:270:13: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:270:13: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbedit.c:271:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbedit.c:271:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: throw: if ‘ldb_ldif_read_file’ throws an exception...
samba-4.23.4/lib/ldb/tools/ldbedit.c:276:24: danger: ‘fopen(&file_template, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  274|   	}
#  275|   
#  276|-> 	while ((ldif = ldb_ldif_read_file(ldb, f))) {
#  277|   		msgs2 = talloc_realloc(ldb, msgs2, struct ldb_message *, count2+1);
#  278|   		if (!msgs2) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def286]
samba-4.23.4/lib/ldb/tools/ldbmodify.c:57:100: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fname, "r")’
samba-4.23.4/lib/ldb/tools/ldbmodify.c:151:5: enter_function: entry to ‘main’
samba-4.23.4/lib/ldb/tools/ldbmodify.c:159:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:163:19: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:165:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:165:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:168:26: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:169:45: branch_true: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:171:29: acquire_resource: opened here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:172:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:176:31: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:176:31: call_function: calling ‘process_file’ from ‘main’
#   55|   	struct ldb_ldif *ldif;
#   56|   	int fun_ret = LDB_SUCCESS, ret;
#   57|-> 	struct ldb_control **req_ctrls = ldb_parse_control_strings(ldb, ldb, (const char **)options->controls);
#   58|   	struct ldif_read_file_state state = {
#   59|   		.f = f

Error: GCC_ANALYZER_WARNING (CWE-401): [#def287]
samba-4.23.4/lib/ldb/tools/ldbmodify.c:57:100: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fname, "r")’
samba-4.23.4/lib/ldb/tools/ldbmodify.c:151:5: enter_function: entry to ‘main’
samba-4.23.4/lib/ldb/tools/ldbmodify.c:159:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:163:19: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:165:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:165:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:168:26: branch_true: following ‘true’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:169:45: branch_true: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:171:29: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:172:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbmodify.c:176:31: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbmodify.c:176:31: call_function: calling ‘process_file’ from ‘main’
#   55|   	struct ldb_ldif *ldif;
#   56|   	int fun_ret = LDB_SUCCESS, ret;
#   57|-> 	struct ldb_control **req_ctrls = ldb_parse_control_strings(ldb, ldb, (const char **)options->controls);
#   58|   	struct ldif_read_file_state state = {
#   59|   		.f = f

Error: GCC_ANALYZER_WARNING (CWE-401): [#def288]
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup("uid")’
samba-4.23.4/lib/ldb/tools/ldbtest.c:327:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:332:9: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:45: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:9: danger: ‘strdup("uid")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  331|   
#  332|   	msg->dn = indexlist;
#  333|-> 	ldb_msg_add_string(msg, "@IDXATTR", strdup("uid"));
#  334|   
#  335|   	if (ldb_add(*ldb, msg) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def289]
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup("test")’
samba-4.23.4/lib/ldb/tools/ldbtest.c:327:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:332:9: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:45: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:335:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:340:48: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:9: danger: ‘strdup("test")’ leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5)
#  343|   	msg->dn = ldb_dn_copy(msg, basedn);
#  344|   	ldb_dn_add_child_fmt(msg->dn, "cn=test");
#  345|-> 	ldb_msg_add_string(msg, "cn", strdup("test"));
#  346|   	ldb_msg_add_string(msg, "sn", strdup("test"));
#  347|   	ldb_msg_add_string(msg, "uid", strdup("test"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def290]
samba-4.23.4/lib/ldb/tools/ldbtest.c:346:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup("test")’
samba-4.23.4/lib/ldb/tools/ldbtest.c:327:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:332:9: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:45: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:335:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:340:48: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:346:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:346:9: danger: ‘strdup("test")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  344|   	ldb_dn_add_child_fmt(msg->dn, "cn=test");
#  345|   	ldb_msg_add_string(msg, "cn", strdup("test"));
#  346|-> 	ldb_msg_add_string(msg, "sn", strdup("test"));
#  347|   	ldb_msg_add_string(msg, "uid", strdup("test"));
#  348|   	ldb_msg_add_string(msg, "objectClass", strdup("OpenLDAPperson"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def291]
samba-4.23.4/lib/ldb/tools/ldbtest.c:347:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup("test")’
samba-4.23.4/lib/ldb/tools/ldbtest.c:327:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:332:9: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:45: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:335:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:340:48: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:346:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:347:40: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:347:9: danger: ‘strdup("test")’ leaks here; was allocated at [(8)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/7)
#  345|   	ldb_msg_add_string(msg, "cn", strdup("test"));
#  346|   	ldb_msg_add_string(msg, "sn", strdup("test"));
#  347|-> 	ldb_msg_add_string(msg, "uid", strdup("test"));
#  348|   	ldb_msg_add_string(msg, "objectClass", strdup("OpenLDAPperson"));
#  349|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def292]
samba-4.23.4/lib/ldb/tools/ldbtest.c:348:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup("OpenLDAPperson")’
samba-4.23.4/lib/ldb/tools/ldbtest.c:327:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:332:9: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:333:45: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:335:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbtest.c:340:48: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbtest.c:345:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:346:39: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:347:40: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:348:48: acquire_memory: allocated here
samba-4.23.4/lib/ldb/tools/ldbtest.c:348:9: danger: ‘strdup("OpenLDAPperson")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  346|   	ldb_msg_add_string(msg, "sn", strdup("test"));
#  347|   	ldb_msg_add_string(msg, "uid", strdup("test"));
#  348|-> 	ldb_msg_add_string(msg, "objectClass", strdup("OpenLDAPperson"));
#  349|   
#  350|   	if (ldb_add(*ldb, msg) != LDB_SUCCESS) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def293]
samba-4.23.4/lib/ldb/tools/ldbutil.c:181:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/ldb/tools/ldbutil.c:175:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/ldb/tools/ldbutil.c:179:12: branch_false: ...to here
samba-4.23.4/lib/ldb/tools/ldbutil.c:179:12: branch_true: following ‘true’ branch (when ‘exp_fmt’ is non-NULL)...
samba-4.23.4/lib/ldb/tools/ldbutil.c:180:17: branch_true: ...to here
samba-4.23.4/lib/ldb/tools/ldbutil.c:180:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/ldb/tools/ldbutil.c:181:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/ldb/tools/ldbutil.c:181:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  179|   	if (exp_fmt) {
#  180|   		va_start(ap, exp_fmt);
#  181|-> 		expression = talloc_vasprintf(mem_ctx, exp_fmt, ap);
#  182|   		va_end(ap);
#  183|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def294]
samba-4.23.4/lib/messaging/messages_dgm.c:1665:22: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&*ctx.socket_dir.buf)’
samba-4.23.4/lib/messaging/messages_dgm.c:1648:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
samba-4.23.4/lib/messaging/messages_dgm.c:1660:26: branch_false: ...to here
samba-4.23.4/lib/messaging/messages_dgm.c:1660:18: acquire_memory: allocated here
samba-4.23.4/lib/messaging/messages_dgm.c:1661:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/messaging/messages_dgm.c:1661:12: branch_false: ...to here
samba-4.23.4/lib/messaging/messages_dgm.c:1665:22: throw: if ‘readdir’ throws an exception...
samba-4.23.4/lib/messaging/messages_dgm.c:1665:22: danger: ‘opendir(&*ctx.socket_dir.buf)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1663|   	}
# 1664|   
# 1665|-> 	while ((dp = readdir(msgdir)) != NULL) {
# 1666|   		unsigned long pid;
# 1667|   		int ret;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def295]
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
samba-4.23.4/lib/mscat/mscat_pkcs7.c:73:14: acquire_resource: opened here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:74:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:78:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:79:12: branch_false: following ‘false’ branch (when ‘rc == 0’)...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:88:43: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:88:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:93:22: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:95:16: throw: if ‘data_blob_talloc_zero’ throws an exception...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   81|   	}
#   82|   
#   83|-> 	if (!S_ISREG(sb.st_mode)) {
#   84|   		errno = EINVAL;
#   85|   		rc = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def296]
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
samba-4.23.4/lib/mscat/mscat_pkcs7.c:73:14: acquire_memory: allocated here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:74:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:78:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:79:12: branch_false: following ‘false’ branch (when ‘rc == 0’)...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:88:43: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:88:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:93:22: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:95:16: throw: if ‘data_blob_talloc_zero’ throws an exception...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:83:14: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   81|   	}
#   82|   
#   83|-> 	if (!S_ISREG(sb.st_mode)) {
#   84|   		errno = EINVAL;
#   85|   		rc = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def297]
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
samba-4.23.4/lib/mscat/mscat_pkcs7.c:73:14: acquire_resource: opened here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:74:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:78:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: throw: if ‘data_blob_free’ throws an exception...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  114|   	return 0;
#  115|   error:
#  116|-> 	data_blob_free(&blob);
#  117|   	fclose(fp);
#  118|   	return rc;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def298]
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
samba-4.23.4/lib/mscat/mscat_pkcs7.c:73:14: acquire_memory: allocated here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:74:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:78:14: branch_false: ...to here
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: throw: if ‘data_blob_free’ throws an exception...
samba-4.23.4/lib/mscat/mscat_pkcs7.c:116:9: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  114|   	return 0;
#  115|   error:
#  116|-> 	data_blob_free(&blob);
#  117|   	fclose(fp);
#  118|   	return rc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def299]
samba-4.23.4/lib/param/loadparm.c:626:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dest’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
#  624|   
#  625|   	if ((src == NULL) || (*src == '\0')) {
#  626|-> 		*dest = discard_const_p(char, lpcfg_string_empty);
#  627|   		return true;
#  628|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def300]
samba-4.23.4/lib/param/loadparm.c:630:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dest’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
#  628|   	}
#  629|   
#  630|-> 	*dest = talloc_strdup(mem_ctx, src);
#  631|   	if ((*dest) == NULL) {
#  632|   		DEBUG(0,("Out of memory in string_set\n"));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def301]
samba-4.23.4/lib/param/loadparm.c:648:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dest’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
#  646|   
#  647|   	if ((src == NULL) || (*src == '\0')) {
#  648|-> 		*dest = discard_const_p(char, lpcfg_string_empty);
#  649|   		return true;
#  650|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def302]
samba-4.23.4/lib/param/loadparm.c:652:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dest’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
#  650|   	}
#  651|   
#  652|-> 	*dest = strupper_talloc(mem_ctx, src);
#  653|   	if ((*dest) == NULL) {
#  654|   		DEBUG(0,("Out of memory in string_set_upper\n"));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def303]
samba-4.23.4/lib/param/loadparm.c:1057:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1055|   	for (i = 0; parm->enum_list[i].name; i++) {
# 1056|   		if (strwicmp(pszParmValue, parm->enum_list[i].name) == 0) {
# 1057|-> 			*ptr = parm->enum_list[i].value;
# 1058|   			return true;
# 1059|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def304]
samba-4.23.4/lib/param/loadparm.c:1663:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1661|   				return false;
# 1662|   			}
# 1663|-> 			*(bool *)parm_ptr = b;
# 1664|   			}
# 1665|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def305]
samba-4.23.4/lib/param/loadparm.c:1674:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1672|   				return false;
# 1673|   			}
# 1674|-> 			*(bool *)parm_ptr = !b;
# 1675|   			}
# 1676|   			break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def306]
samba-4.23.4/lib/param/loadparm.c:1679:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:3378:13: enter_function: entry to ‘lpcfg_update’
samba-4.23.4/lib/param/loadparm.c:3387:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:3391:41: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:3393:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/param/loadparm.c:3394:17: call_function: calling ‘lpcfg_do_global_parameter’ from ‘lpcfg_update’
# 1677|   
# 1678|   		case P_INTEGER:
# 1679|-> 			*(int *)parm_ptr = lp_int(pszParmValue);
# 1680|   			break;
# 1681|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def307]
samba-4.23.4/lib/param/loadparm.c:1683:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1681|   
# 1682|   		case P_CHAR:
# 1683|-> 			*(char *)parm_ptr = *pszParmValue;
# 1684|   			break;
# 1685|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def308]
samba-4.23.4/lib/param/loadparm.c:1699:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1697|   			if (conv_str_size_error(pszParmValue, &val)) {
# 1698|   				if (val <= INT_MAX) {
# 1699|-> 					*(int *)parm_ptr = (int)val;
# 1700|   					break;
# 1701|   				}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def309]
samba-4.23.4/lib/param/loadparm.c:1710:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1708|   
# 1709|   		case P_CMDLIST:
# 1710|-> 			TALLOC_FREE(*(char ***)parm_ptr);
# 1711|   			*(char ***)parm_ptr = str_list_make_v3(mem_ctx,
# 1712|   							pszParmValue, NULL);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def310]
samba-4.23.4/lib/param/loadparm.c:1724:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/lib/param/loadparm.c:1994:6: enter_function: entry to ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2000:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2010:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2014:13: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2026:20: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_do_global_parameter’
samba-4.23.4/lib/param/loadparm.c:2026:20: return_function: returning to ‘lpcfg_do_global_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2028:16: call_function: calling ‘set_variable’ from ‘lpcfg_do_global_parameter’
# 1722|   
# 1723|   			for (i=0; new_list[i]; i++) {
# 1724|-> 				if (*(const char ***)parm_ptr != NULL &&
# 1725|   				    new_list[i][0] == '+' &&
# 1726|   				    new_list[i][1])

Error: GCC_ANALYZER_WARNING (CWE-404): [#def311]
samba-4.23.4/lib/param/loadparm.c:2117:13: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/param/loadparm.c:2116:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/param/loadparm.c:2117:13: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/param/loadparm.c:2117:13: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
# 2115|   
# 2116|   	va_start(ap, fmt);
# 2117|-> 	s = talloc_vasprintf(NULL, fmt, ap);
# 2118|   	va_end(ap);
# 2119|   	ret = lpcfg_do_global_parameter(lp_ctx, pszParmName, s);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def312]
samba-4.23.4/lib/param/loadparm.c:2231:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2229|   		case P_ENUM:
# 2230|   			for (i = 0; p->enum_list[i].name; i++) {
# 2231|-> 				if (*(int *)ptr == p->enum_list[i].value) {
# 2232|   					fprintf(f, "%s",
# 2233|   						p->enum_list[i].name);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def313]
samba-4.23.4/lib/param/loadparm.c:2240:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2238|   
# 2239|   		case P_BOOL:
# 2240|-> 			fprintf(f, "%s", BOOLSTR(*(bool *)ptr));
# 2241|   			break;
# 2242|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def314]
samba-4.23.4/lib/param/loadparm.c:2244:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2242|   
# 2243|   		case P_BOOLREV:
# 2244|-> 			fprintf(f, "%s", BOOLSTR(!*(bool *)ptr));
# 2245|   			break;
# 2246|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def315]
samba-4.23.4/lib/param/loadparm.c:2249:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2247|   		case P_INTEGER:
# 2248|   		case P_BYTES:
# 2249|-> 			fprintf(f, "%d", *(int *)ptr);
# 2250|   			break;
# 2251|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def316]
samba-4.23.4/lib/param/loadparm.c:2253:42: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2251|   
# 2252|   		case P_CHAR:
# 2253|-> 			fprintf(f, "%c", *(char *)ptr);
# 2254|   			break;
# 2255|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def317]
samba-4.23.4/lib/param/loadparm.c:2257:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2255|   
# 2256|   		case P_OCTAL: {
# 2257|-> 			int val = *(int *)ptr;
# 2258|   			if (val == -1) {
# 2259|   				fprintf(f, "-1");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def318]
samba-4.23.4/lib/param/loadparm.c:2290:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ptr’
samba-4.23.4/lib/param/loadparm.c:2533:6: enter_function: entry to ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2545:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2549:20: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2551:12: branch_false: following ‘false’ branch (when ‘parm_opt’ is NULL)...
samba-4.23.4/lib/param/loadparm.c:2566:9: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2569:16: call_function: calling ‘lpcfg_parm_struct’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2569:16: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_struct’
samba-4.23.4/lib/param/loadparm.c:2570:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/param/loadparm.c:2574:12: branch_false: ...to here
samba-4.23.4/lib/param/loadparm.c:2578:15: call_function: calling ‘lpcfg_parm_ptr’ from ‘lpcfg_dump_a_parameter’
samba-4.23.4/lib/param/loadparm.c:2578:15: return_function: returning to ‘lpcfg_dump_a_parameter’ from ‘lpcfg_parm_ptr’
samba-4.23.4/lib/param/loadparm.c:2580:9: call_function: calling ‘lpcfg_print_parameter’ from ‘lpcfg_dump_a_parameter’
# 2288|   		case P_STRING:
# 2289|   		case P_USTRING:
# 2290|-> 			if (*(char **)ptr) {
# 2291|   				fprintf(f, "%s", *(char **)ptr);
# 2292|   			}

Error: COMPILER_WARNING (CWE-704): [#def319]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘find_manufacturer_name’
samba-4.23.4/lib/printer_driver/printer_driver.c:153:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  153 |         p = strchr(s, ':');
#      |           ^
#  151|   	}
#  152|   
#  153|-> 	p = strchr(s, ':');
#  154|   	if (p == NULL) {
#  155|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def320]
samba-4.23.4/lib/printer_driver/printer_driver.c:153:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  151|   	}
#  152|   
#  153|-> 	p = strchr(s, ':');
#  154|   	if (p == NULL) {
#  155|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def321]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘find_manufacturer_url’
samba-4.23.4/lib/printer_driver/printer_driver.c:208:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  208 |         p = strchr(keys[0], ':');
#      |           ^
#  206|   	}
#  207|   
#  208|-> 	p = strchr(keys[0], ':');
#  209|   	if (p == NULL) {
#  210|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def322]
samba-4.23.4/lib/printer_driver/printer_driver.c:208:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  206|   	}
#  207|   
#  208|-> 	p = strchr(keys[0], ':');
#  209|   	if (p == NULL) {
#  210|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def323]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘add_dependent_driver_file’
samba-4.23.4/lib/printer_driver/printer_driver.c:303:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  303 |         p = strchr(file, ',');
#      |           ^
#  301|   	}
#  302|   
#  303|-> 	p = strchr(file, ',');
#  304|   	if (p != NULL) {
#  305|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def324]
samba-4.23.4/lib/printer_driver/printer_driver.c:303:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  301|   	}
#  302|   
#  303|-> 	p = strchr(file, ',');
#  304|   	if (p != NULL) {
#  305|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def325]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘enum_devices_in_toc’
samba-4.23.4/lib/printer_driver/printer_driver.c:395:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  395 |                                 p = strchr(s, ':');
#      |                                   ^
#  393|   				}
#  394|   
#  395|-> 				p = strchr(s, ':');
#  396|   				if (p == NULL) {
#  397|   					return NT_STATUS_DRIVER_INTERNAL_ERROR;

Error: COMPILER_WARNING (CWE-704): [#def326]
samba-4.23.4/lib/printer_driver/printer_driver.c:395:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  393|   				}
#  394|   
#  395|-> 				p = strchr(s, ':');
#  396|   				if (p == NULL) {
#  397|   					return NT_STATUS_DRIVER_INTERNAL_ERROR;

Error: COMPILER_WARNING (CWE-704): [#def327]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_section_copyfiles’
samba-4.23.4/lib/printer_driver/printer_driver.c:509:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  509 |                                 p = strchr(keys[i], ':');
#      |                                   ^
#  507|   		if (NT_STATUS_IS_OK(status)) {
#  508|   			for (i = 0; i < num_keys; i++) {
#  509|-> 				p = strchr(keys[i], ':');
#  510|   				if (p == NULL) {
#  511|   					return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def328]
samba-4.23.4/lib/printer_driver/printer_driver.c:509:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  507|   		if (NT_STATUS_IS_OK(status)) {
#  508|   			for (i = 0; i < num_keys; i++) {
#  509|-> 				p = strchr(keys[i], ':');
#  510|   				if (p == NULL) {
#  511|   					return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def329]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_section_printprocessor’
samba-4.23.4/lib/printer_driver/printer_driver.c:587:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  587 |                 p = strchr(s, ',');
#      |                   ^
#  585|   		s = get_string_unquote(s);
#  586|   
#  587|-> 		p = strchr(s, ',');
#  588|   		if (p == NULL) {
#  589|   			return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def330]
samba-4.23.4/lib/printer_driver/printer_driver.c:587:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  585|   		s = get_string_unquote(s);
#  586|   
#  587|-> 		p = strchr(s, ',');
#  588|   		if (p == NULL) {
#  589|   			return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def331]
samba-4.23.4/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_driverver’
samba-4.23.4/lib/printer_driver/printer_driver.c:886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  886 |         p = strchr(str, ',');
#      |           ^
#  884|   	}
#  885|   
#  886|-> 	p = strchr(str, ',');
#  887|   	if (p) {
#  888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def332]
samba-4.23.4/lib/printer_driver/printer_driver.c:886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  884|   	}
#  885|   
#  886|-> 	p = strchr(str, ',');
#  887|   	if (p) {
#  888|   		*p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def333]
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:44:12: branch_false: following ‘false’ branch (when ‘pool’ is non-NULL)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:47:21: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:50:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: throw: if ‘pthreadpool_init’ throws an exception...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: danger: leaks here
#   54|   	}
#   55|   
#   56|-> 	ret = pthreadpool_init(max_threads, &pool->pool,
#   57|   			       pthreadpool_pipe_signal, pool);
#   58|   	if (ret != 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def334]
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pool’
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:43:16: acquire_memory: allocated here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:44:12: branch_false: following ‘false’ branch (when ‘pool’ is non-NULL)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:47:21: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:50:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: throw: if ‘pthreadpool_init’ throws an exception...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:56:15: danger: ‘pool’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   54|   	}
#   55|   
#   56|-> 	ret = pthreadpool_init(max_threads, &pool->pool,
#   57|   			       pthreadpool_pipe_signal, pool);
#   58|   	if (ret != 0) {

Error: GCC_ANALYZER_WARNING: [#def335]
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:134:15: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘signal_fd’
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:117:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:121:9: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:123:9: release_resource: closed here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:130:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:134:15: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:134:15: danger: ‘signal_fd’ could be invalid
#  132|   	}
#  133|   
#  134|-> 	ret = dup2(pool->pipe_fds[0], signal_fd);
#  135|   	if (ret != 0) {
#  136|   		return errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def336]
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:139:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*pool.pipe_fds[0]’
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:117:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:121:9: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:130:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:134:15: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:135:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:139:9: branch_false: ...to here
samba-4.23.4/lib/pthreadpool/pthreadpool_pipe.c:139:9: danger: ‘*pool.pipe_fds[0]’ leaks here
#  137|   	}
#  138|   
#  139|-> 	pool->pipe_fds[0] = signal_fd;
#  140|   	pool->num_jobs = 0;
#  141|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def337]
samba-4.23.4/lib/socket/interfaces.c:144:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:137:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:138:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:143:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:143:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/socket/interfaces.c:144:17: branch_true: ...to here
samba-4.23.4/lib/socket/interfaces.c:144:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:144:17: danger: ‘fd’ leaks here
#  142|   
#  143|   	if (strlen(name) >= IF_NAMESIZE) {
#  144|-> 		DBG_ERR("Interface name too long.\n");
#  145|   		goto done;
#  146|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def338]
samba-4.23.4/lib/socket/interfaces.c:148:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:137:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:138:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:143:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/socket/interfaces.c:148:9: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:148:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:148:9: danger: ‘fd’ leaks here
#  146|   	}
#  147|   
#  148|-> 	ZERO_STRUCT(ifr);
#  149|   	strlcpy(ifr.ifr_name, name, IF_NAMESIZE);
#  150|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def339]
samba-4.23.4/lib/socket/interfaces.c:152:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:137:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:138:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:143:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/socket/interfaces.c:148:9: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:152:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:152:9: danger: ‘fd’ leaks here
#  150|   
#  151|   	ifr.ifr_data = (void *)&edata;
#  152|-> 	ZERO_STRUCT(edata);
#  153|   	edata.cmd = ETHTOOL_GLINK;
#  154|   	ret = ioctl(fd, SIOCETHTOOL, &ifr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def340]
samba-4.23.4/lib/socket/interfaces.c:174:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:137:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:138:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:143:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:143:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/socket/interfaces.c:144:17: branch_true: ...to here
samba-4.23.4/lib/socket/interfaces.c:174:15: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:174:15: danger: ‘fd’ leaks here
#  172|   
#  173|   done:
#  174|-> 	(void)close(fd);
#  175|   }
#  176|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def341]
samba-4.23.4/lib/socket/interfaces.c:192:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:185:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:186:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:191:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:191:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/socket/interfaces.c:192:17: branch_true: ...to here
samba-4.23.4/lib/socket/interfaces.c:192:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:192:17: danger: ‘fd’ leaks here
#  190|   
#  191|   	if (strlen(name) >= IF_NAMESIZE) {
#  192|-> 		DBG_ERR("Interface name too long.\n");
#  193|   		goto done;
#  194|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def342]
samba-4.23.4/lib/socket/interfaces.c:196:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:185:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:186:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:191:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:191:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/socket/interfaces.c:196:9: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:196:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:196:9: danger: ‘fd’ leaks here
#  194|   	}
#  195|   
#  196|-> 	ZERO_STRUCT(ifr);
#  197|   	strlcpy(ifr.ifr_name, name, IF_NAMESIZE);
#  198|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def343]
samba-4.23.4/lib/socket/interfaces.c:200:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:185:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:186:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:191:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:191:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/socket/interfaces.c:196:9: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:200:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:200:9: danger: ‘fd’ leaks here
#  198|   
#  199|   	ifr.ifr_data = (void *)&rxcmd;
#  200|-> 	ZERO_STRUCT(rxcmd);
#  201|   	rxcmd.cmd = ETHTOOL_GRXRINGS;
#  202|   	ret = ioctl(fd, SIOCETHTOOL, &ifr);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def344]
samba-4.23.4/lib/socket/interfaces.c:210:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/socket/interfaces.c:185:14: acquire_resource: datagram socket created here
samba-4.23.4/lib/socket/interfaces.c:186:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/socket/interfaces.c:191:13: branch_false: ...to here
samba-4.23.4/lib/socket/interfaces.c:191:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/socket/interfaces.c:192:17: branch_true: ...to here
samba-4.23.4/lib/socket/interfaces.c:210:15: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/socket/interfaces.c:210:15: danger: ‘fd’ leaks here
#  208|   
#  209|   done:
#  210|-> 	(void)close(fd);
#  211|   }
#  212|   #endif

Error: COMPILER_WARNING (CWE-477): [#def345]
samba-4.23.4/lib/talloc/testsuite.c: scope_hint: In function ‘test_memlimit’
samba-4.23.4/lib/talloc/testsuite.c:1680:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1680 |         torture_assert("memlimit", talloc_set_memlimit(l1, 2048) == 0,
#      |         ^~~~~~~~~~~~~~
samba-4.23.4/lib/talloc/testsuite.c:28: included_from: Included from here.
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1678|   
# 1679|   	printf("==== talloc_set_memlimit(l1, 2048)\n");
# 1680|-> 	torture_assert("memlimit", talloc_set_memlimit(l1, 2048) == 0,
# 1681|   		"failed: setting memlimit should never fail\n");
# 1682|   

Error: COMPILER_WARNING (CWE-477): [#def346]
samba-4.23.4/lib/talloc/testsuite.c:1680:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1678|   
# 1679|   	printf("==== talloc_set_memlimit(l1, 2048)\n");
# 1680|-> 	torture_assert("memlimit", talloc_set_memlimit(l1, 2048) == 0,
# 1681|   		"failed: setting memlimit should never fail\n");
# 1682|   

Error: COMPILER_WARNING (CWE-477): [#def347]
samba-4.23.4/lib/talloc/testsuite.c:1740:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1740 |         torture_assert("memlimit", talloc_set_memlimit(l3, 1024) == 0,
#      |         ^~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1738|   
# 1739|   	printf("==== talloc_set_memlimit(l3, 1024)\n");
# 1740|-> 	torture_assert("memlimit", talloc_set_memlimit(l3, 1024) == 0,
# 1741|   		"failed: setting memlimit should never fail\n");
# 1742|   

Error: COMPILER_WARNING (CWE-477): [#def348]
samba-4.23.4/lib/talloc/testsuite.c:1740:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1738|   
# 1739|   	printf("==== talloc_set_memlimit(l3, 1024)\n");
# 1740|-> 	torture_assert("memlimit", talloc_set_memlimit(l3, 1024) == 0,
# 1741|   		"failed: setting memlimit should never fail\n");
# 1742|   

Error: COMPILER_WARNING (CWE-477): [#def349]
samba-4.23.4/lib/talloc/testsuite.c:1753:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1753 |         torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
#      |         ^~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1751|   
# 1752|   	printf("==== talloc_set_memlimit(l4, 512)\n");
# 1753|-> 	torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
# 1754|   		"failed: setting memlimit should never fail\n");
# 1755|   

Error: COMPILER_WARNING (CWE-477): [#def350]
samba-4.23.4/lib/talloc/testsuite.c:1753:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1751|   
# 1752|   	printf("==== talloc_set_memlimit(l4, 512)\n");
# 1753|-> 	torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
# 1754|   		"failed: setting memlimit should never fail\n");
# 1755|   

Error: COMPILER_WARNING (CWE-477): [#def351]
samba-4.23.4/lib/talloc/testsuite.c:1787:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1787 |         torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
#      |         ^~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1785|   
# 1786|   	printf("==== talloc_set_memlimit(l4, 512)\n");
# 1787|-> 	torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
# 1788|   		"failed: setting memlimit should never fail\n");
# 1789|   

Error: COMPILER_WARNING (CWE-477): [#def352]
samba-4.23.4/lib/talloc/testsuite.c:1787:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1785|   
# 1786|   	printf("==== talloc_set_memlimit(l4, 512)\n");
# 1787|-> 	torture_assert("memlimit", talloc_set_memlimit(l4, 512) == 0,
# 1788|   		"failed: setting memlimit should never fail\n");
# 1789|   

Error: COMPILER_WARNING (CWE-477): [#def353]
samba-4.23.4/lib/talloc/testsuite.c:1820:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1820 |         talloc_set_memlimit(pool, 10*1024);
#      |         ^~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1818|   
# 1819|   	printf("==== talloc_set_memlimit(pool, 10*1024)\n");
# 1820|-> 	talloc_set_memlimit(pool, 10*1024);
# 1821|   	for (i = 0; i < 9; i++) {
# 1822|   		printf("==== talloc_size(pool, 1024) %i/10\n", i + 1);

Error: COMPILER_WARNING (CWE-477): [#def354]
samba-4.23.4/lib/talloc/testsuite.c:1820:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1818|   
# 1819|   	printf("==== talloc_set_memlimit(pool, 10*1024)\n");
# 1820|-> 	talloc_set_memlimit(pool, 10*1024);
# 1821|   	for (i = 0; i < 9; i++) {
# 1822|   		printf("==== talloc_size(pool, 1024) %i/10\n", i + 1);

Error: COMPILER_WARNING (CWE-477): [#def355]
samba-4.23.4/lib/talloc/testsuite.c:1873:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1873 |         talloc_set_memlimit(pool, 11*1024);
#      |         ^~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1871|   	/* Increase the memlimit */
# 1872|   	printf("==== talloc_set_memlimit(pool, 11*1024)\n");
# 1873|-> 	talloc_set_memlimit(pool, 11*1024);
# 1874|   
# 1875|   	/* The final realloc should still fail

Error: COMPILER_WARNING (CWE-477): [#def356]
samba-4.23.4/lib/talloc/testsuite.c:1873:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1871|   	/* Increase the memlimit */
# 1872|   	printf("==== talloc_set_memlimit(pool, 11*1024)\n");
# 1873|-> 	talloc_set_memlimit(pool, 11*1024);
# 1874|   
# 1875|   	/* The final realloc should still fail

Error: COMPILER_WARNING (CWE-477): [#def357]
samba-4.23.4/lib/talloc/testsuite.c:1885:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1885 |         talloc_set_memlimit(pool, 21*1024);
#      |         ^~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1883|   
# 1884|   	printf("==== talloc_set_memlimit(pool, 21*1024)\n");
# 1885|-> 	talloc_set_memlimit(pool, 21*1024);
# 1886|   
# 1887|   	/* There's now sufficient space to move the chunk out of the pool */

Error: COMPILER_WARNING (CWE-477): [#def358]
samba-4.23.4/lib/talloc/testsuite.c:1885:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1883|   
# 1884|   	printf("==== talloc_set_memlimit(pool, 21*1024)\n");
# 1885|-> 	talloc_set_memlimit(pool, 21*1024);
# 1886|   
# 1887|   	/* There's now sufficient space to move the chunk out of the pool */

Error: COMPILER_WARNING (CWE-477): [#def359]
samba-4.23.4/lib/talloc/testsuite.c:1923:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1923 |         talloc_set_memlimit(pool, 1024);
#      |         ^~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1921|   
# 1922|   	printf("==== talloc_set_memlimit(pool, 1024)\n");
# 1923|-> 	talloc_set_memlimit(pool, 1024);
# 1924|   
# 1925|   	/* We should still be able to allocate up to the pool limit

Error: COMPILER_WARNING (CWE-477): [#def360]
samba-4.23.4/lib/talloc/testsuite.c:1923:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1921|   
# 1922|   	printf("==== talloc_set_memlimit(pool, 1024)\n");
# 1923|-> 	talloc_set_memlimit(pool, 1024);
# 1924|   
# 1925|   	/* We should still be able to allocate up to the pool limit

Error: COMPILER_WARNING (CWE-477): [#def361]
samba-4.23.4/lib/talloc/testsuite.c:1944:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1944 |         talloc_set_memlimit(pool, 10*1024);
#      |         ^~~~~~~~~~~~~~~~~~~
/usr/include/talloc.h:1951:14: note: declared here
# 1951 | _PUBLIC_ int talloc_set_memlimit(const void *ctx, size_t max_size) _DEPRECATED_;
#      |              ^~~~~~~~~~~~~~~~~~~
# 1942|   
# 1943|   	printf("==== talloc_set_memlimit(pool, 10*1024)\n");
# 1944|-> 	talloc_set_memlimit(pool, 10*1024);
# 1945|   
# 1946|   	printf("==== talloc_size(pool, 1024)\n");

Error: COMPILER_WARNING (CWE-477): [#def362]
samba-4.23.4/lib/talloc/testsuite.c:1944:9: warning[-Wdeprecated-declarations]: ‘talloc_set_memlimit’ is deprecated
# 1942|   
# 1943|   	printf("==== talloc_set_memlimit(pool, 10*1024)\n");
# 1944|-> 	talloc_set_memlimit(pool, 10*1024);
# 1945|   
# 1946|   	printf("==== talloc_size(pool, 1024)\n");

Error: COMPILER_WARNING (CWE-477): [#def363]
samba-4.23.4/lib/tevent/testsuite.c: scope_hint: In function ‘test_wrapper’
samba-4.23.4/lib/tevent/testsuite.c:1716:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_wrapper_create’ is deprecated
# 1716 |         wrap_ev = tevent_context_wrapper_create(
#      |         ^~~~~~~
samba-4.23.4/lib/tevent/testsuite.c:29: included_from: Included from here.
samba-4.23.4/lib/tevent/tevent.h:2911:24: note: declared here
# 2911 | struct tevent_context *_tevent_context_wrapper_create(struct tevent_context *main_ev,
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1714|   	torture_comment(tctx, "tevent backend '%s'\n", backend);
# 1715|   
# 1716|-> 	wrap_ev = tevent_context_wrapper_create(
# 1717|   		ev, ev,	&test_wrapper_ops, &state, struct test_wrapper_state);
# 1718|   	torture_assert_not_null_goto(tctx, wrap_ev, ok, done,

Error: COMPILER_WARNING (CWE-477): [#def364]
samba-4.23.4/lib/tevent/testsuite.c:1716:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_wrapper_create’ is deprecated
# 1714|   	torture_comment(tctx, "tevent backend '%s'\n", backend);
# 1715|   
# 1716|-> 	wrap_ev = tevent_context_wrapper_create(
# 1717|   		ev, ev,	&test_wrapper_ops, &state, struct test_wrapper_state);
# 1718|   	torture_assert_not_null_goto(tctx, wrap_ev, ok, done,

Error: COMPILER_WARNING (CWE-477): [#def365]
samba-4.23.4/lib/tevent/testsuite.c:1760:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_push_use’ is deprecated
# 1760 |         ret2 = tevent_context_push_use(wrap_ev);
#      |         ^~~~
samba-4.23.4/lib/tevent/tevent.h:2990:6: note: declared here
# 2990 | bool _tevent_context_push_use(struct tevent_context *ev,
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~
# 1758|   				  state);
# 1759|   
# 1760|-> 	ret2 = tevent_context_push_use(wrap_ev);
# 1761|   	torture_assert_goto(tctx, ret2, ok, done, "tevent_context_push_use(wrap_ev) failed\n");
# 1762|   	ret2 = tevent_context_push_use(ev);

Error: COMPILER_WARNING (CWE-477): [#def366]
samba-4.23.4/lib/tevent/testsuite.c:1760:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_push_use’ is deprecated
# 1758|   				  state);
# 1759|   
# 1760|-> 	ret2 = tevent_context_push_use(wrap_ev);
# 1761|   	torture_assert_goto(tctx, ret2, ok, done, "tevent_context_push_use(wrap_ev) failed\n");
# 1762|   	ret2 = tevent_context_push_use(ev);

Error: COMPILER_WARNING (CWE-477): [#def367]
samba-4.23.4/lib/tevent/testsuite.c:1762:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_push_use’ is deprecated
# 1762 |         ret2 = tevent_context_push_use(ev);
#      |         ^~~~
samba-4.23.4/lib/tevent/tevent.h:2990:6: note: declared here
# 2990 | bool _tevent_context_push_use(struct tevent_context *ev,
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~
# 1760|   	ret2 = tevent_context_push_use(wrap_ev);
# 1761|   	torture_assert_goto(tctx, ret2, ok, done, "tevent_context_push_use(wrap_ev) failed\n");
# 1762|-> 	ret2 = tevent_context_push_use(ev);
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|   	tevent_context_pop_use(ev);

Error: COMPILER_WARNING (CWE-477): [#def368]
samba-4.23.4/lib/tevent/testsuite.c:1762:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_push_use’ is deprecated
# 1760|   	ret2 = tevent_context_push_use(wrap_ev);
# 1761|   	torture_assert_goto(tctx, ret2, ok, done, "tevent_context_push_use(wrap_ev) failed\n");
# 1762|-> 	ret2 = tevent_context_push_use(ev);
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|   	tevent_context_pop_use(ev);

Error: COMPILER_WARNING (CWE-477): [#def369]
samba-4.23.4/lib/tevent/testsuite.c:1764:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1764 |         tevent_context_pop_use(ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/lib/tevent/tevent.h:3019:6: note: declared here
# 3019 | void _tevent_context_pop_use(struct tevent_context *ev,
#      |      ^~~~~~~~~~~~~~~~~~~~~~~
# 1762|   	ret2 = tevent_context_push_use(ev);
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|-> 	tevent_context_pop_use(ev);
# 1765|   	tevent_context_pop_use(wrap_ev);
# 1766|   

Error: COMPILER_WARNING (CWE-477): [#def370]
samba-4.23.4/lib/tevent/testsuite.c:1764:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1762|   	ret2 = tevent_context_push_use(ev);
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|-> 	tevent_context_pop_use(ev);
# 1765|   	tevent_context_pop_use(wrap_ev);
# 1766|   

Error: COMPILER_WARNING (CWE-477): [#def371]
samba-4.23.4/lib/tevent/testsuite.c:1765:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1765 |         tevent_context_pop_use(wrap_ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/lib/tevent/tevent.h:3019:6: note: declared here
# 3019 | void _tevent_context_pop_use(struct tevent_context *ev,
#      |      ^~~~~~~~~~~~~~~~~~~~~~~
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|   	tevent_context_pop_use(ev);
# 1765|-> 	tevent_context_pop_use(wrap_ev);
# 1766|   
# 1767|   	ret = tevent_loop_wait(ev);

Error: COMPILER_WARNING (CWE-477): [#def372]
samba-4.23.4/lib/tevent/testsuite.c:1765:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1763|   	torture_assert_goto(tctx, ret2, ok, pop_use, "tevent_context_push_use(ev) failed\n");
# 1764|   	tevent_context_pop_use(ev);
# 1765|-> 	tevent_context_pop_use(wrap_ev);
# 1766|   
# 1767|   	ret = tevent_loop_wait(ev);

Error: COMPILER_WARNING (CWE-477): [#def373]
samba-4.23.4/lib/tevent/testsuite.c:1794:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1794 |         tevent_context_pop_use(wrap_ev);
#      |         ^~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/lib/tevent/tevent.h:3019:6: note: declared here
# 3019 | void _tevent_context_pop_use(struct tevent_context *ev,
#      |      ^~~~~~~~~~~~~~~~~~~~~~~
# 1792|   	return ok;
# 1793|   pop_use:
# 1794|-> 	tevent_context_pop_use(wrap_ev);
# 1795|   	goto done;
# 1796|   }

Error: COMPILER_WARNING (CWE-477): [#def374]
samba-4.23.4/lib/tevent/testsuite.c:1794:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_pop_use’ is deprecated
# 1792|   	return ok;
# 1793|   pop_use:
# 1794|-> 	tevent_context_pop_use(wrap_ev);
# 1795|   	goto done;
# 1796|   }

Error: COMPILER_WARNING (CWE-477): [#def375]
samba-4.23.4/lib/tevent/testsuite.c: scope_hint: In function ‘test_free_wrapper’
samba-4.23.4/lib/tevent/testsuite.c:1889:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_wrapper_create’ is deprecated
# 1889 |         wrap_ev = tevent_context_wrapper_create(
#      |         ^~~~~~~
samba-4.23.4/lib/tevent/tevent.h:2911:24: note: declared here
# 2911 | struct tevent_context *_tevent_context_wrapper_create(struct tevent_context *main_ev,
#      |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 1887|   	torture_comment(tctx, "tevent backend '%s'\n", backend);
# 1888|   
# 1889|-> 	wrap_ev = tevent_context_wrapper_create(
# 1890|   		ev, ev,	&test_wrapper_ops, &state, struct test_wrapper_state);
# 1891|   	torture_assert_not_null_goto(tctx, wrap_ev, ok, done,

Error: COMPILER_WARNING (CWE-477): [#def376]
samba-4.23.4/lib/tevent/testsuite.c:1889:9: warning[-Wdeprecated-declarations]: ‘_tevent_context_wrapper_create’ is deprecated
# 1887|   	torture_comment(tctx, "tevent backend '%s'\n", backend);
# 1888|   
# 1889|-> 	wrap_ev = tevent_context_wrapper_create(
# 1890|   		ev, ev,	&test_wrapper_ops, &state, struct test_wrapper_state);
# 1891|   	torture_assert_not_null_goto(tctx, wrap_ev, ok, done,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def377]
samba-4.23.4/lib/torture/torture.c:147:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
samba-4.23.4/lib/torture/torture.c:140:20: acquire_memory: allocated here
samba-4.23.4/lib/torture/torture.c:141:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/torture/torture.c:141:12: branch_false: ...to here
samba-4.23.4/lib/torture/torture.c:147:26: throw: if ‘readdir’ throws an exception...
samba-4.23.4/lib/torture/torture.c:147:26: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  145|   		return -1;
#  146|   	}
#  147|-> 	while ((dirent = readdir(dir))) {
#  148|   		char *name;
#  149|   		if ((strcmp(dirent->d_name, ".") == 0) || (strcmp(dirent->d_name, "..") == 0)) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def378]
samba-4.23.4/lib/torture/torture.c:215:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/torture/torture.c:211:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/torture/torture.c:214:9: branch_false: ...to here
samba-4.23.4/lib/torture/torture.c:214:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/torture/torture.c:215:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/torture/torture.c:215:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  213|   
#  214|   	va_start(ap, comment);
#  215|-> 	tmp = talloc_vasprintf(context, comment, ap);
#  216|   	va_end(ap);
#  217|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def379]
samba-4.23.4/lib/torture/torture.c:235:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/torture/torture.c:231:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/torture/torture.c:234:9: branch_false: ...to here
samba-4.23.4/lib/torture/torture.c:234:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/torture/torture.c:235:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/torture/torture.c:235:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  233|   
#  234|   	va_start(ap, comment);
#  235|-> 	tmp = talloc_vasprintf(context, comment, ap);
#  236|   	va_end(ap);
#  237|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def380]
samba-4.23.4/lib/torture/torture.c:238:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/torture/torture.c:246:6: enter_function: entry to ‘torture_result’
samba-4.23.4/lib/torture/torture.c:250:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/torture/torture.c:253:17: branch_true: ...to here
samba-4.23.4/lib/torture/torture.c:253:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/torture/torture.c:255:20: branch_true: following ‘true’ branch...
samba-4.23.4/lib/torture/torture.c:256:25: branch_true: ...to here
samba-4.23.4/lib/torture/torture.c:256:25: call_function: calling ‘torture_warning’ from ‘torture_result’
#  236|   	va_end(ap);
#  237|   
#  238|-> 	context->results->ui_ops->warning(context, tmp);
#  239|   
#  240|   	talloc_free(tmp);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def381]
samba-4.23.4/lib/torture/torture.c:261:40: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/torture/torture.c:250:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/torture/torture.c:253:17: branch_true: ...to here
samba-4.23.4/lib/torture/torture.c:253:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/torture/torture.c:261:40: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/torture/torture.c:261:40: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  259|   
#  260|   		context->last_result = result;
#  261|-> 		context->last_reason = talloc_vasprintf(context, fmt, ap);
#  262|   
#  263|   		va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def382]
samba-4.23.4/lib/tsocket/tsocket_bsd.c:109:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/tsocket/tsocket_bsd.c:94:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_false: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_true: following ‘true’ branch (when ‘high_fd != 0’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_true: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:100:24: branch_true: following ‘true’ branch (when ‘fd <= 2’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:101:29: branch_true: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:102:30: acquire_resource: opened here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:103:28: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:103:28: branch_false: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:108:27: branch_true: following ‘true’ branch (when ‘i < num_fds’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:109:25: branch_true: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:109:25: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:109:25: danger: ‘fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  107|   		}
#  108|   		for (i=0; i<num_fds; i++) {
#  109|-> 			close(fds[i]);
#  110|   		}
#  111|   		if (fd == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def383]
samba-4.23.4/lib/tsocket/tsocket_bsd.c:117:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/tsocket/tsocket_bsd.c:94:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_false: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_true: following ‘true’ branch (when ‘high_fd != 0’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:99:12: branch_true: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:100:24: branch_true: following ‘true’ branch (when ‘fd <= 2’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:101:29: branch_true: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:102:30: acquire_resource: opened here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:103:28: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:103:28: branch_false: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:111:20: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:117:18: branch_false: ...to here
samba-4.23.4/lib/tsocket/tsocket_bsd.c:117:18: throw: if ‘set_blocking’ throws an exception...
samba-4.23.4/lib/tsocket/tsocket_bsd.c:117:18: danger: ‘fd’ leaks here; was opened at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  115|   	}
#  116|   
#  117|-> 	result = set_blocking(fd, false);
#  118|   	if (result == -1) {
#  119|   		goto fail;

Error: COMPILER_WARNING (CWE-704): [#def384]
samba-4.23.4/lib/util/base64.c: scope_hint: In function ‘base64_decode_data_blob_talloc’
samba-4.23.4/lib/util/base64.c:51:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   51 |         while (*s && (p=strchr(b64,*s))) {
#      |                        ^
#   49|   	n=i=0;
#   50|   
#   51|-> 	while (*s && (p=strchr(b64,*s))) {
#   52|   		idx = (int)(p - b64);
#   53|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def385]
samba-4.23.4/lib/util/base64.c:51:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   49|   	n=i=0;
#   50|   
#   51|-> 	while (*s && (p=strchr(b64,*s))) {
#   52|   		idx = (int)(p - b64);
#   53|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def386]
samba-4.23.4/lib/util/charset/util_str.c: scope_hint: In function ‘strchr_m’
samba-4.23.4/lib/util/charset/util_str.c:370:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  370 |                 return strchr(src, c);
#      |                        ^~~~~~
#  368|   	   non-initial position in multi-byte charsets */
#  369|   	if ((c & 0xC0) == 0) {
#  370|-> 		return strchr(src, c);
#  371|   	}
#  372|   

Error: COMPILER_WARNING (CWE-704): [#def387]
samba-4.23.4/lib/util/charset/util_str.c:370:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  368|   	   non-initial position in multi-byte charsets */
#  369|   	if ((c & 0xC0) == 0) {
#  370|-> 		return strchr(src, c);
#  371|   	}
#  372|   

Error: COMPILER_WARNING (CWE-704): [#def388]
samba-4.23.4/lib/util/charset/util_str.c: scope_hint: In function ‘strrchr_m’
samba-4.23.4/lib/util/charset/util_str.c:418:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  418 |                 return strrchr(s, c);
#      |                        ^~~~~~~
#  416|   	   non-initial position in multi-byte charsets */
#  417|   	if ((c & 0xC0) == 0) {
#  418|-> 		return strrchr(s, c);
#  419|   	}
#  420|   

Error: COMPILER_WARNING (CWE-704): [#def389]
samba-4.23.4/lib/util/charset/util_str.c:418:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  416|   	   non-initial position in multi-byte charsets */
#  417|   	if ((c & 0xC0) == 0) {
#  418|-> 		return strrchr(s, c);
#  419|   	}
#  420|   

Error: CPPCHECK_WARNING (CWE-457): [#def390]
samba-4.23.4/lib/util/charset/util_unistr_w.c:47: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&c))[0]=((const unsigned char*)(src))[0],((unsigned char*)(&c))[1]=((const unsigned char*)(src))[1],&c))
#   45|   	smb_ucs2_t c;
#   46|   
#   47|-> 	for(len = 0; *(COPY_UCS2_CHAR(&c,src)); src++, len++) {
#   48|   		;
#   49|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def391]
samba-4.23.4/lib/util/charset/util_unistr_w.c:63: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&c))[0]=((const unsigned char*)(src))[0],((unsigned char*)(&c))[1]=((const unsigned char*)(src))[1],&c))
#   61|   	smb_ucs2_t c;
#   62|   
#   63|-> 	for(len = 0; (len < max) && *(COPY_UCS2_CHAR(&c,src)); src++, len++) {
#   64|   		;
#   65|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def392]
samba-4.23.4/lib/util/charset/util_unistr_w.c:77: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cp))[0]=((const unsigned char*)(s))[0],((unsigned char*)(&cp))[1]=((const unsigned char*)(s))[1],&cp))
#   75|   {
#   76|   	smb_ucs2_t cp;
#   77|-> 	while (*(COPY_UCS2_CHAR(&cp,s))) {
#   78|   		if (c == cp) {
#   79|   			return discard_const_p(smb_ucs2_t, s);

Error: CPPCHECK_WARNING (CWE-457): [#def393]
samba-4.23.4/lib/util/charset/util_unistr_w.c:110: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cp))[0]=((const unsigned char*)(p))[0],((unsigned char*)(&cp))[1]=((const unsigned char*)(p))[1],&cp))
#  108|   	p += (len - 1);
#  109|   	do {
#  110|-> 		if (c == *(COPY_UCS2_CHAR(&cp,p))) {
#  111|   			return discard_const_p(smb_ucs2_t, p);
#  112|   		}

Error: CPPCHECK_WARNING (CWE-457): [#def394]
samba-4.23.4/lib/util/charset/util_unistr_w.c:155: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cp))[0]=((const unsigned char*)(s))[0],((unsigned char*)(&cp))[1]=((const unsigned char*)(s))[1],&cp))
#  153|   	bool ret = false;
#  154|   
#  155|-> 	while (*(COPY_UCS2_CHAR(&cp,s))) {
#  156|   		smb_ucs2_t v = tolower_m(cp);
#  157|   		if (v != cp) {

Error: CPPCHECK_WARNING (CWE-457): [#def395]
samba-4.23.4/lib/util/charset/util_unistr_w.c:177: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cp))[0]=((const unsigned char*)(s))[0],((unsigned char*)(&cp))[1]=((const unsigned char*)(s))[1],&cp))
#  175|   	smb_ucs2_t cp;
#  176|   	bool ret = false;
#  177|-> 	while (*(COPY_UCS2_CHAR(&cp,s))) {
#  178|   		smb_ucs2_t v = toupper_m(cp);
#  179|   		if (v != cp) {

Error: CPPCHECK_WARNING (CWE-457): [#def396]
samba-4.23.4/lib/util/charset/util_unistr_w.c:193: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cpa))[0]=((const unsigned char*)(a))[0],((unsigned char*)(&cpa))[1]=((const unsigned char*)(a))[1],&cpa))
#  191|   	size_t n = 0;
#  192|   
#  193|-> 	while ((n < len) && (*(COPY_UCS2_CHAR(&cpb,b))) && (*(COPY_UCS2_CHAR(&cpa,a)) == cpb)) {
#  194|   		a++;
#  195|   		b++;

Error: CPPCHECK_WARNING (CWE-457): [#def397]
samba-4.23.4/lib/util/charset/util_unistr_w.c:193: error[uninitvar]: Uninitialized variable: *((((unsigned char*)(&cpb))[0]=((const unsigned char*)(b))[0],((unsigned char*)(&cpb))[1]=((const unsigned char*)(b))[1],&cpb))
#  191|   	size_t n = 0;
#  192|   
#  193|-> 	while ((n < len) && (*(COPY_UCS2_CHAR(&cpb,b))) && (*(COPY_UCS2_CHAR(&cpa,a)) == cpb)) {
#  194|   		a++;
#  195|   		b++;

Error: CPPCHECK_WARNING (CWE-457): [#def398]
samba-4.23.4/lib/util/charset/util_unistr_w.c:228: error[uninitvar]: Uninitialized variable: ret
#  226|   	/* native to LE. */
#  227|   	SSVAL(&ret,0,cp);
#  228|-> 	return ret;
#  229|   }

Error: GCC_ANALYZER_WARNING: [#def399]
samba-4.23.4/lib/util/close_low_fd.c:68:15: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
samba-4.23.4/lib/util/close_low_fd.c:42:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/close_low_fd.c:46:23: release_resource: closed here
samba-4.23.4/lib/util/close_low_fd.c:47:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/close_low_fd.c:51:28: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:61:12: branch_false: following ‘false’ branch (when ‘fd != dev_null’)...
samba-4.23.4/lib/util/close_low_fd.c:68:15: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:68:15: danger: ‘fd’ could be invalid
#   66|   	}
#   67|   
#   68|-> 	ret = dup2(dev_null, fd);
#   69|   	if (ret == -1) {
#   70|   		int err = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def400]
samba-4.23.4/lib/util/close_low_fd.c:74:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
samba-4.23.4/lib/util/close_low_fd.c:57:12: branch_false: following ‘false’ branch (when ‘dev_null != -1’)...
samba-4.23.4/lib/util/close_low_fd.c:61:12: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:61:12: branch_false: following ‘false’ branch (when ‘fd != dev_null’)...
samba-4.23.4/lib/util/close_low_fd.c:68:15: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:68:15: acquire_resource: opened here
samba-4.23.4/lib/util/close_low_fd.c:69:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/lib/util/close_low_fd.c:74:9: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:74:9: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/close_low_fd.c:74:9: danger: ‘ret’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   72|   		return err;
#   73|   	}
#   74|-> 	close(dev_null);
#   75|   	return 0;
#   76|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def401]
samba-4.23.4/lib/util/close_low_fd.c:76:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ret’
samba-4.23.4/lib/util/close_low_fd.c:57:12: branch_false: following ‘false’ branch (when ‘dev_null != -1’)...
samba-4.23.4/lib/util/close_low_fd.c:61:12: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:61:12: branch_false: following ‘false’ branch (when ‘fd != dev_null’)...
samba-4.23.4/lib/util/close_low_fd.c:68:15: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:68:15: acquire_resource: opened here
samba-4.23.4/lib/util/close_low_fd.c:69:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/lib/util/close_low_fd.c:74:9: branch_false: ...to here
samba-4.23.4/lib/util/close_low_fd.c:76:1: danger: ‘ret’ leaks here; was opened at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#   74|   	close(dev_null);
#   75|   	return 0;
#   76|-> }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def402]
samba-4.23.4/lib/util/getpass.c:66:17: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
samba-4.23.4/lib/util/getpass.c:53:15: acquire_memory: allocated here
samba-4.23.4/lib/util/getpass.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
samba-4.23.4/lib/util/getpass.c:57:9: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:61:20: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/getpass.c:62:25: branch_true: ...to here
samba-4.23.4/lib/util/getpass.c:66:17: throw: if ‘fflush’ throws an exception...
samba-4.23.4/lib/util/getpass.c:66:17: danger: ‘tmp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   64|   			fprintf(stdout, "%s", prompt);
#   65|   		}
#   66|-> 		fflush(stdout);
#   67|   		if (fgets(tmp, len, stdin) == NULL) {
#   68|   			free(tmp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def403]
samba-4.23.4/lib/util/getpass.c:91:25: warning[-Wanalyzer-malloc-leak]: leak of ‘key_string’
samba-4.23.4/lib/util/getpass.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
samba-4.23.4/lib/util/getpass.c:57:9: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:67:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/getpass.c:72:28: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:72:20: branch_false: following ‘false’ branch (when ‘ptr’ is NULL)...
samba-4.23.4/lib/util/getpass.c:75:17: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:77:20: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/getpass.c:78:25: branch_true: ...to here
samba-4.23.4/lib/util/getpass.c:81:20: branch_true: following ‘true’ branch (when ‘verify != 0’)...
samba-4.23.4/lib/util/getpass.c:84:38: branch_true: ...to here
samba-4.23.4/lib/util/getpass.c:84:38: acquire_memory: allocated here
samba-4.23.4/lib/util/getpass.c:85:28: branch_false: following ‘false’ branch (when ‘key_string’ is non-NULL)...
samba-4.23.4/lib/util/getpass.c:88:25: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:91:25: throw: if ‘fflush’ throws an exception...
samba-4.23.4/lib/util/getpass.c:91:25: danger: ‘key_string’ leaks here; was allocated at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#   89|   
#   90|   			fprintf(stdout, "\nVerifying, please re-enter. %s", prompt);
#   91|-> 			fflush(stdout);
#   92|   			if (! fgets(key_string, len, stdin)) {
#   93|   				memset(key_string, '\0', len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def404]
samba-4.23.4/lib/util/getpass.c:91:25: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
samba-4.23.4/lib/util/getpass.c:53:15: acquire_memory: allocated here
samba-4.23.4/lib/util/getpass.c:54:12: branch_false: following ‘false’ branch (when ‘tmp’ is non-NULL)...
samba-4.23.4/lib/util/getpass.c:57:9: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:67:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/getpass.c:72:28: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:72:20: branch_false: following ‘false’ branch (when ‘ptr’ is NULL)...
samba-4.23.4/lib/util/getpass.c:75:17: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:77:20: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/getpass.c:78:25: branch_true: ...to here
samba-4.23.4/lib/util/getpass.c:81:20: branch_true: following ‘true’ branch (when ‘verify != 0’)...
samba-4.23.4/lib/util/getpass.c:84:38: branch_true: ...to here
samba-4.23.4/lib/util/getpass.c:85:28: branch_false: following ‘false’ branch (when ‘key_string’ is non-NULL)...
samba-4.23.4/lib/util/getpass.c:88:25: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:91:25: throw: if ‘fflush’ throws an exception...
samba-4.23.4/lib/util/getpass.c:91:25: danger: ‘tmp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   89|   
#   90|   			fprintf(stdout, "\nVerifying, please re-enter. %s", prompt);
#   91|-> 			fflush(stdout);
#   92|   			if (! fgets(key_string, len, stdin)) {
#   93|   				memset(key_string, '\0', len);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def405]
samba-4.23.4/lib/util/getpass.c:106:33: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp’
samba-4.23.4/lib/util/getpass.c:157:5: enter_function: entry to ‘samba_getpass’
samba-4.23.4/lib/util/getpass.c:169:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/getpass.c:173:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/getpass.c:205:17: branch_false: ...to here
samba-4.23.4/lib/util/getpass.c:208:14: call_function: calling ‘samba_gets’ from ‘samba_getpass’
#  104|   				memset(key_string, '\0', len);
#  105|   				SAFE_FREE(key_string);
#  106|-> 				fflush(stdout);
#  107|   				continue;
#  108|   			}

Error: GCC_ANALYZER_WARNING (CWE-121): [#def406]
samba-4.23.4/lib/util/idtree.c:261:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
samba-4.23.4/lib/util/idtree.c:366:14: enter_function: entry to ‘idr_get_new_above’
samba-4.23.4/lib/util/idtree.c:368:19: call_function: calling ‘idr_get_new_above_int’ from ‘idr_get_new_above’
samba-4.23.4/lib/util/idtree.c:368:19: return_function: returning to ‘idr_get_new_above’ from ‘idr_get_new_above_int’
samba-4.23.4/lib/util/idtree.c:369:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/idtree.c:370:17: branch_true: ...to here
samba-4.23.4/lib/util/idtree.c:370:17: call_function: calling ‘idr_remove’ from ‘idr_get_new_above’
#  259|   		n = (id >> shift) & IDR_MASK;
#  260|   		clear_bit(n, p->bitmap);
#  261|-> 		*++paa = &p->ary[n];
#  262|   		p = p->ary[n];
#  263|   		shift -= IDR_BITS;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def407]
samba-4.23.4/lib/util/modules.c:94:24: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
samba-4.23.4/lib/util/modules.c:88:15: acquire_memory: allocated here
samba-4.23.4/lib/util/modules.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/modules.c:89:12: branch_false: ...to here
samba-4.23.4/lib/util/modules.c:94:24: throw: if ‘readdir’ throws an exception...
samba-4.23.4/lib/util/modules.c:94:24: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   92|   	}
#   93|   
#   94|-> 	while((entry = readdir(dir))) {
#   95|   		if (ISDOT(entry->d_name) || ISDOTDOT(entry->d_name))
#   96|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def408]
samba-4.23.4/lib/util/params.c:111:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
samba-4.23.4/lib/util/params.c:106:13: acquire_resource: opened here
samba-4.23.4/lib/util/params.c:107:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/params.c:111:15: branch_false: ...to here
samba-4.23.4/lib/util/params.c:111:15: throw: if ‘tini_parse’ throws an exception...
samba-4.23.4/lib/util/params.c:111:15: danger: ‘fopen(filename, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  109|   	}
#  110|   
#  111|-> 	ret = tini_parse(f, allow_empty_values, sfunc, pfunc, private_data);
#  112|   
#  113|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def409]
samba-4.23.4/lib/util/params.c:111:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
samba-4.23.4/lib/util/params.c:106:13: acquire_memory: allocated here
samba-4.23.4/lib/util/params.c:107:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/params.c:111:15: branch_false: ...to here
samba-4.23.4/lib/util/params.c:111:15: throw: if ‘tini_parse’ throws an exception...
samba-4.23.4/lib/util/params.c:111:15: danger: ‘fopen(filename, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  109|   	}
#  110|   
#  111|-> 	ret = tini_parse(f, allow_empty_values, sfunc, pfunc, private_data);
#  112|   
#  113|   	fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def410]
samba-4.23.4/lib/util/pidfile.c:146:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fd’
samba-4.23.4/lib/util/pidfile.c:146:23: release_resource: first ‘close’ here
samba-4.23.4/lib/util/pidfile.c:147:18: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/pidfile.c:146:23: danger: second ‘close’ here; first ‘close’ was at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  144|   
#  145|   	do {
#  146|-> 		ret = close(fd);
#  147|   	} while ((ret == -1) && (errno == EINTR));
#  148|   }

Error: COMPILER_WARNING (CWE-704): [#def411]
samba-4.23.4/lib/util/smb_strtox.c: scope_hint: In function ‘smb_strtoul’
samba-4.23.4/lib/util/smb_strtox.c:83:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   83 |                 needle = strchr(nptr, '-');
#      |                        ^
#   81|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#   82|   		/* did we convert a negative "number" ? */
#   83|-> 		needle = strchr(nptr, '-');
#   84|   		if (needle != NULL && needle < tmp_endptr) {
#   85|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def412]
samba-4.23.4/lib/util/smb_strtox.c:83:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   81|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#   82|   		/* did we convert a negative "number" ? */
#   83|-> 		needle = strchr(nptr, '-');
#   84|   		if (needle != NULL && needle < tmp_endptr) {
#   85|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def413]
samba-4.23.4/lib/util/smb_strtox.c: scope_hint: In function ‘smb_strtoull’
samba-4.23.4/lib/util/smb_strtox.c:159:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  159 |                 needle = strchr(nptr, '-');
#      |                        ^
#  157|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#  158|   		/* did we convert a negative "number" ? */
#  159|-> 		needle = strchr(nptr, '-');
#  160|   		if (needle != NULL && needle < tmp_endptr) {
#  161|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def414]
samba-4.23.4/lib/util/smb_strtox.c:159:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  157|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#  158|   		/* did we convert a negative "number" ? */
#  159|-> 		needle = strchr(nptr, '-');
#  160|   		if (needle != NULL && needle < tmp_endptr) {
#  161|   			*err = EINVAL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def415]
samba-4.23.4/lib/util/sys_popen.c:73:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘child_end’
samba-4.23.4/lib/util/sys_popen.c:50:12: branch_false: following ‘false’ branch (when ‘argl’ is non-NULL)...
samba-4.23.4/lib/util/sys_popen.c:54:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:61:15: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:62:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/lib/util/sys_popen.c:68:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:72:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/sys_popen.c:73:17: branch_true: ...to here
samba-4.23.4/lib/util/sys_popen.c:73:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/lib/util/sys_popen.c:73:17: danger: ‘child_end’ leaks here
#   71|   	entry = talloc_zero(NULL, popen_list);
#   72|   	if (entry == NULL) {
#   73|-> 		DBG_ERR("talloc failed\n");
#   74|   		goto err_exit;
#   75|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def416]
samba-4.23.4/lib/util/sys_popen.c:73:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘parent_end’
samba-4.23.4/lib/util/sys_popen.c:50:12: branch_false: following ‘false’ branch (when ‘argl’ is non-NULL)...
samba-4.23.4/lib/util/sys_popen.c:54:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:61:15: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:62:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/lib/util/sys_popen.c:68:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:72:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/sys_popen.c:73:17: branch_true: ...to here
samba-4.23.4/lib/util/sys_popen.c:73:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/lib/util/sys_popen.c:73:17: danger: ‘parent_end’ leaks here
#   71|   	entry = talloc_zero(NULL, popen_list);
#   72|   	if (entry == NULL) {
#   73|-> 		DBG_ERR("talloc failed\n");
#   74|   		goto err_exit;
#   75|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def417]
samba-4.23.4/lib/util/sys_popen.c:132:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘child_end’
samba-4.23.4/lib/util/sys_popen.c:50:12: branch_false: following ‘false’ branch (when ‘argl’ is non-NULL)...
samba-4.23.4/lib/util/sys_popen.c:54:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:61:15: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:62:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/lib/util/sys_popen.c:68:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:72:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/sys_popen.c:73:17: branch_true: ...to here
samba-4.23.4/lib/util/sys_popen.c:131:9: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:132:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:132:9: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/sys_popen.c:132:9: danger: ‘child_end’ leaks here
#  130|   
#  131|   	TALLOC_FREE(entry);
#  132|-> 	close(pipe_fds[0]);
#  133|   	close(pipe_fds[1]);
#  134|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def418]
samba-4.23.4/lib/util/sys_popen.c:132:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘parent_end’
samba-4.23.4/lib/util/sys_popen.c:50:12: branch_false: following ‘false’ branch (when ‘argl’ is non-NULL)...
samba-4.23.4/lib/util/sys_popen.c:54:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:61:15: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:62:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/lib/util/sys_popen.c:68:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:72:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/sys_popen.c:73:17: branch_true: ...to here
samba-4.23.4/lib/util/sys_popen.c:131:9: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:132:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:132:9: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/sys_popen.c:132:9: danger: ‘parent_end’ leaks here
#  130|   
#  131|   	TALLOC_FREE(entry);
#  132|-> 	close(pipe_fds[0]);
#  133|   	close(pipe_fds[1]);
#  134|   	return -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def419]
samba-4.23.4/lib/util/sys_popen.c:133:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘child_end’
samba-4.23.4/lib/util/sys_popen.c:50:12: branch_false: following ‘false’ branch (when ‘argl’ is non-NULL)...
samba-4.23.4/lib/util/sys_popen.c:54:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:61:15: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:62:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/lib/util/sys_popen.c:68:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:72:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/sys_popen.c:73:17: branch_true: ...to here
samba-4.23.4/lib/util/sys_popen.c:131:9: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/sys_popen.c:132:9: branch_false: ...to here
samba-4.23.4/lib/util/sys_popen.c:133:9: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/sys_popen.c:133:9: danger: ‘child_end’ leaks here
#  131|   	TALLOC_FREE(entry);
#  132|   	close(pipe_fds[0]);
#  133|-> 	close(pipe_fds[1]);
#  134|   	return -1;
#  135|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def420]
samba-4.23.4/lib/util/talloc_report.c:50:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/talloc_report.c:97:14: enter_function: entry to ‘talloc_asprintf_append_largebuf’
samba-4.23.4/lib/util/talloc_report.c:102:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/talloc_report.c:103:15: call_function: calling ‘talloc_vasprintf_append_largebuf’ from ‘talloc_asprintf_append_largebuf’
#   48|   		return NULL;
#   49|   	}
#   50|-> 	buflen = talloc_get_size(buf);
#   51|   
#   52|   	if (buflen > (size_t)str_len) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def421]
samba-4.23.4/lib/util/talloc_stack.c:116:42: warning[-Wanalyzer-malloc-leak]: leak of ‘talloc_stackframe_get()’
samba-4.23.4/lib/util/talloc_stack.c:223:20: enter_function: entry to ‘talloc_stackframe_internal’
samba-4.23.4/lib/util/talloc_stack.c:227:40: call_function: calling ‘talloc_stackframe_get’ from ‘talloc_stackframe_internal’
samba-4.23.4/lib/util/talloc_stack.c:227:40: return_function: returning to ‘talloc_stackframe_internal’ from ‘talloc_stackframe_get’
samba-4.23.4/lib/util/talloc_stack.c:229:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/talloc_stack.c:230:23: branch_true: ...to here
samba-4.23.4/lib/util/talloc_stack.c:232:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/talloc_stack.c:235:17: branch_false: ...to here
samba-4.23.4/lib/util/talloc_stack.c:239:12: branch_true: following ‘true’ branch (when ‘poolsize != 0’)...
samba-4.23.4/lib/util/talloc_stack.c:240:35: branch_true: ...to here
samba-4.23.4/lib/util/talloc_stack.c:240:23: throw: if ‘talloc_pool’ throws an exception...
samba-4.23.4/lib/util/talloc_stack.c:116:42: danger: ‘talloc_stackframe_get()’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#  114|   
#  115|   #ifdef HAVE_PTHREAD
#  116|-> 	ts = (struct talloc_stackframe *)pthread_getspecific(ts_key);
#  117|   #else /* ! HAVE_PTHREAD */
#  118|   	ts = global_ts;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def422]
samba-4.23.4/lib/util/talloc_stack.c:151:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ts’
samba-4.23.4/lib/util/talloc_stack.c:131:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/talloc_stack.c:140:42: branch_false: ...to here
samba-4.23.4/lib/util/talloc_stack.c:140:42: acquire_memory: allocated here
samba-4.23.4/lib/util/talloc_stack.c:145:12: branch_false: following ‘false’ branch (when ‘ts’ is non-NULL)...
samba-4.23.4/lib/util/talloc_stack.c:150:15: branch_false: ...to here
samba-4.23.4/lib/util/talloc_stack.c:151:9: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/talloc_stack.c:151:9: branch_true: ...to here
samba-4.23.4/lib/util/talloc_stack.c:151:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/lib/util/talloc_stack.c:151:9: danger: ‘ts’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  149|   #ifdef HAVE_PTHREAD
#  150|   	ret = pthread_setspecific(ts_key, ts);
#  151|-> 	SMB_ASSERT(ret == 0);
#  152|   #else /* ! HAVE_PTHREAD */
#  153|   	global_ts = ts;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def423]
samba-4.23.4/lib/util/tfork.c:160:23: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
samba-4.23.4/lib/util/tfork.c:737:15: enter_function: entry to ‘tfork_create’
samba-4.23.4/lib/util/tfork.c:749:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:756:17: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:757:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:760:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:766:13: acquire_memory: allocated here
samba-4.23.4/lib/util/tfork.c:767:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:772:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:779:15: call_function: calling ‘tfork_install_sigchld_handler’ from ‘tfork_create’
#  158|   
#  159|   	while (!signal_state.available) {
#  160|-> 		ret = pthread_cond_wait(&signal_state.cond,
#  161|   					&signal_state.mutex);
#  162|   		if (ret != 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def424]
samba-4.23.4/lib/util/tfork.c:495:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
samba-4.23.4/lib/util/tfork.c:476:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:480:15: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:481:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:484:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:490:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:495:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:495:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/lib/util/tfork.c:495:9: danger: ‘p[0]’ leaks here
#  493|   		return -1;
#  494|   	}
#  495|-> 	set_close_on_exec(p[0]);
#  496|   	set_close_on_exec(p[1]);
#  497|   	event_pipe_caller_fd = p[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def425]
samba-4.23.4/lib/util/tfork.c:495:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[1]’
samba-4.23.4/lib/util/tfork.c:476:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:480:15: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:481:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:484:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:490:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:495:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:495:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/lib/util/tfork.c:495:9: danger: ‘p[1]’ leaks here
#  493|   		return -1;
#  494|   	}
#  495|-> 	set_close_on_exec(p[0]);
#  496|   	set_close_on_exec(p[1]);
#  497|   	event_pipe_caller_fd = p[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def426]
samba-4.23.4/lib/util/tfork.c:509:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[0]’
samba-4.23.4/lib/util/tfork.c:476:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:480:15: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:481:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:484:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:490:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:495:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:502:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:509:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:509:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/lib/util/tfork.c:509:9: danger: ‘p[0]’ leaks here
#  507|   		return -1;
#  508|   	}
#  509|-> 	set_close_on_exec(p[0]);
#  510|   	set_close_on_exec(p[1]);
#  511|   	ready_pipe_worker_fd = p[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def427]
samba-4.23.4/lib/util/tfork.c:509:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p[1]’
samba-4.23.4/lib/util/tfork.c:476:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:480:15: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:481:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:484:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:490:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:495:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:502:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:509:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:509:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/lib/util/tfork.c:509:9: danger: ‘p[1]’ leaks here
#  507|   		return -1;
#  508|   	}
#  509|-> 	set_close_on_exec(p[0]);
#  510|   	set_close_on_exec(p[1]);
#  511|   	ready_pipe_worker_fd = p[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def428]
samba-4.23.4/lib/util/tfork.c:654:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/lib/util/tfork.c:476:12: branch_false: following ‘false’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:480:15: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:481:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:484:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:490:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:495:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:502:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/lib/util/tfork.c:509:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:515:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/lib/util/tfork.c:524:12: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:524:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/lib/util/tfork.c:575:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:584:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/lib/util/tfork.c:588:12: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:588:12: branch_false: following ‘false’ branch (when ‘pid != 0’)...
samba-4.23.4/lib/util/tfork.c:607:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:619:12: branch_false: following ‘false’ branch (when ‘event_pipe_waiter_fd <= 0’)...
samba-4.23.4/lib/util/tfork.c:638:12: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:638:12: branch_true: following ‘true’ branch (when ‘status_sp_waiter_fd > 1’)...
samba-4.23.4/lib/util/tfork.c:638:12: branch_true: ...to here
samba-4.23.4/lib/util/tfork.c:640:30: acquire_resource: opened here
samba-4.23.4/lib/util/tfork.c:642:20: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/lib/util/tfork.c:651:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:654:20: throw: if ‘sys_write’ throws an exception...
samba-4.23.4/lib/util/tfork.c:654:20: danger: ‘fd’ leaks here; was opened at [(23)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/22)
#  652|   
#  653|   	/* Tell the caller we're ready */
#  654|-> 	nwritten = sys_write(status_sp_waiter_fd, &(char){0}, sizeof(char));
#  655|   	if (nwritten != sizeof(char)) {
#  656|   		_exit(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def429]
samba-4.23.4/lib/util/tfork.c:730:23: warning[-Wanalyzer-malloc-leak]: leak of ‘t’
samba-4.23.4/lib/util/tfork.c:737:15: enter_function: entry to ‘tfork_create’
samba-4.23.4/lib/util/tfork.c:749:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:756:17: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:757:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:760:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:766:13: acquire_memory: allocated here
samba-4.23.4/lib/util/tfork.c:767:12: branch_false: following ‘false’ branch (when ‘t’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:772:9: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:780:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/tfork.c:781:17: branch_true: ...to here
samba-4.23.4/lib/util/tfork.c:809:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/tfork.c:810:31: branch_true: ...to here
samba-4.23.4/lib/util/tfork.c:812:20: branch_true: following ‘true’ branch (when ‘t’ is non-NULL)...
samba-4.23.4/lib/util/tfork.c:813:29: branch_true: ...to here
samba-4.23.4/lib/util/tfork.c:813:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:816:29: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:816:28: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tfork.c:820:32: branch_false: ...to here
samba-4.23.4/lib/util/tfork.c:820:32: call_function: calling ‘tfork_create_reap_waiter’ from ‘tfork_create’
#  728|   
#  729|   	do {
#  730|-> 		pid = waitpid(waiter_pid, &waiter_status, 0);
#  731|   	} while ((pid == -1) && (errno == EINTR));
#  732|   	assert(pid == waiter_pid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def430]
samba-4.23.4/lib/util/tftw.c:52:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(fpath)’
samba-4.23.4/lib/util/tftw.c:37:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tftw.c:42:19: branch_false: ...to here
samba-4.23.4/lib/util/tftw.c:42:19: acquire_memory: allocated here
samba-4.23.4/lib/util/tftw.c:42:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tftw.c:42:12: branch_false: ...to here
samba-4.23.4/lib/util/tftw.c:52:26: throw: if ‘readdir’ throws an exception...
samba-4.23.4/lib/util/tftw.c:52:26: danger: ‘opendir(fpath)’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   50|   	}
#   51|   
#   52|-> 	while ((dirent = readdir(dh))) {
#   53|   		int flag;
#   54|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def431]
samba-4.23.4/lib/util/tini.c:59:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/lib/util/tini.c:267:6: enter_function: entry to ‘tini_parse’
samba-4.23.4/lib/util/tini.c:279:15: acquire_memory: allocated here
samba-4.23.4/lib/util/tini.c:280:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tini.c:280:12: branch_false: ...to here
samba-4.23.4/lib/util/tini.c:288:23: call_function: calling ‘get_line’ from ‘tini_parse’
#   57|   	int c;
#   58|   
#   59|-> 	for (c = fgetc(f); c != EOF; c = fgetc(f)) {
#   60|   		if (!c_isspace(c)) {
#   61|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def432]
samba-4.23.4/lib/util/tini.c:59:42: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/lib/util/tini.c:267:6: enter_function: entry to ‘tini_parse’
samba-4.23.4/lib/util/tini.c:279:15: acquire_memory: allocated here
samba-4.23.4/lib/util/tini.c:280:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tini.c:280:12: branch_false: ...to here
samba-4.23.4/lib/util/tini.c:288:23: call_function: calling ‘get_line’ from ‘tini_parse’
#   57|   	int c;
#   58|   
#   59|-> 	for (c = fgetc(f); c != EOF; c = fgetc(f)) {
#   60|   		if (!c_isspace(c)) {
#   61|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def433]
samba-4.23.4/lib/util/tini.c:75:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/lib/util/tini.c:267:6: enter_function: entry to ‘tini_parse’
samba-4.23.4/lib/util/tini.c:279:15: acquire_memory: allocated here
samba-4.23.4/lib/util/tini.c:280:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tini.c:280:12: branch_false: ...to here
samba-4.23.4/lib/util/tini.c:288:23: call_function: calling ‘get_line’ from ‘tini_parse’
#   73|   	int c;
#   74|   
#   75|-> 	for (c = fgetc(f); c != EOF; c = fgetc(f)) {
#   76|   		if (c == '\n') {
#   77|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def434]
samba-4.23.4/lib/util/tini.c:75:42: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/lib/util/tini.c:267:6: enter_function: entry to ‘tini_parse’
samba-4.23.4/lib/util/tini.c:279:15: acquire_memory: allocated here
samba-4.23.4/lib/util/tini.c:280:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tini.c:280:12: branch_false: ...to here
samba-4.23.4/lib/util/tini.c:288:23: call_function: calling ‘get_line’ from ‘tini_parse’
#   73|   	int c;
#   74|   
#   75|-> 	for (c = fgetc(f); c != EOF; c = fgetc(f)) {
#   76|   		if (c == '\n') {
#   77|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def435]
samba-4.23.4/lib/util/tini.c:144:32: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/lib/util/tini.c:267:6: enter_function: entry to ‘tini_parse’
samba-4.23.4/lib/util/tini.c:279:15: acquire_memory: allocated here
samba-4.23.4/lib/util/tini.c:280:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tini.c:280:12: branch_false: ...to here
samba-4.23.4/lib/util/tini.c:288:23: call_function: calling ‘get_line’ from ‘tini_parse’
#  142|   	}
#  143|   
#  144|-> 	for ( ; c != EOF ; c = fgetc(f)) {
#  145|   
#  146|   		if (c == '\n') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def436]
samba-4.23.4/lib/util/tiniparser.c:257:1: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/lib/util/tiniparser.c:208:12: branch_false: following ‘false’ branch (when ‘section’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:211:12: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:211:12: branch_false: following ‘false’ branch (when ‘key’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:214:12: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:214:12: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:218:19: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:222:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:235:17: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:236:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:239:22: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:239:22: acquire_memory: allocated here
samba-4.23.4/lib/util/tiniparser.c:240:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:244:9: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:247:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:252:9: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:257:1: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  255|   	section->entry_list = entry;
#  256|   	return true;
#  257|-> }
#  258|   
#  259|   static bool section_parser(const char *section_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def437]
samba-4.23.4/lib/util/tiniparser.c:257:1: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
samba-4.23.4/lib/util/tiniparser.c:208:12: branch_false: following ‘false’ branch (when ‘section’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:211:12: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:211:12: branch_false: following ‘false’ branch (when ‘key’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:214:12: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:214:12: branch_false: following ‘false’ branch (when ‘value’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:218:19: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:222:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:235:17: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:235:17: acquire_memory: allocated here
samba-4.23.4/lib/util/tiniparser.c:236:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:239:22: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:240:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:244:9: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:247:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:252:9: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:257:1: danger: ‘entry’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#  255|   	section->entry_list = entry;
#  256|   	return true;
#  257|-> }
#  258|   
#  259|   static bool section_parser(const char *section_name,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def438]
samba-4.23.4/lib/util/tiniparser.c:335:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
samba-4.23.4/lib/util/tiniparser.c:347:31: enter_function: entry to ‘tiniparser_load’
samba-4.23.4/lib/util/tiniparser.c:350:20: acquire_resource: opened here
samba-4.23.4/lib/util/tiniparser.c:352:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:356:13: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:356:13: call_function: calling ‘tiniparser_load_stream’ from ‘tiniparser_load’
#  333|   	d->section_list = NULL;
#  334|   
#  335|-> 	ret = tini_parse(fp,
#  336|   			false,
#  337|   			section_parser,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def439]
samba-4.23.4/lib/util/tiniparser.c:335:15: warning[-Wanalyzer-malloc-leak]: leak of ‘d’
samba-4.23.4/lib/util/tiniparser.c:329:13: acquire_memory: allocated here
samba-4.23.4/lib/util/tiniparser.c:330:12: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
samba-4.23.4/lib/util/tiniparser.c:333:9: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:335:15: throw: if ‘tini_parse’ throws an exception...
samba-4.23.4/lib/util/tiniparser.c:335:15: danger: ‘d’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  333|   	d->section_list = NULL;
#  334|   
#  335|-> 	ret = tini_parse(fp,
#  336|   			false,
#  337|   			section_parser,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def440]
samba-4.23.4/lib/util/tiniparser.c:335:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
samba-4.23.4/lib/util/tiniparser.c:347:31: enter_function: entry to ‘tiniparser_load’
samba-4.23.4/lib/util/tiniparser.c:350:20: acquire_memory: allocated here
samba-4.23.4/lib/util/tiniparser.c:352:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/tiniparser.c:356:13: branch_false: ...to here
samba-4.23.4/lib/util/tiniparser.c:356:13: call_function: calling ‘tiniparser_load_stream’ from ‘tiniparser_load’
#  333|   	d->section_list = NULL;
#  334|   
#  335|-> 	ret = tini_parse(fp,
#  336|   			false,
#  337|   			section_parser,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def441]
samba-4.23.4/lib/util/util.c:677:22: warning[-Wanalyzer-null-argument]: use of NULL ‘this_buf1’ where non-null expected
samba-4.23.4/lib/util/util.c:641:19: branch_true: following ‘true’ branch (when ‘i < len’)...
samba-4.23.4/lib/util/util.c:642:24: branch_true: ...to here
samba-4.23.4/lib/util/util.c:650:20: branch_false: following ‘false’ branch (when ‘i >= len1’)...
samba-4.23.4/lib/util/util.c:655:20: branch_false: ...to here
samba-4.23.4/lib/util/util.c:655:20: branch_false: following ‘false’ branch (when ‘i >= len2’)...
samba-4.23.4/lib/util/util.c:662:21: branch_false: ...to here
samba-4.23.4/lib/util/util.c:661:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util.c:676:20: branch_false: ...to here
samba-4.23.4/lib/util/util.c:676:20: branch_true: following ‘true’ branch (when ‘this_len1 == this_len2’)...
samba-4.23.4/lib/util/util.c:677:22: branch_true: ...to here
samba-4.23.4/lib/util/util.c:677:22: danger: argument 1 (‘this_buf1’) NULL where non-null expected
#  675|   
#  676|   		if ((this_len1 == this_len2) &&
#  677|-> 		    (memcmp(this_buf1, this_buf2, this_len1) == 0))
#  678|   		{
#  679|   			dump_data_block16(" ", i, this_buf1, this_len1,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def442]
samba-4.23.4/lib/util/util.c:677:22: warning[-Wanalyzer-null-argument]: use of NULL ‘this_buf2’ where non-null expected
samba-4.23.4/lib/util/util.c:641:19: branch_true: following ‘true’ branch (when ‘i < len’)...
samba-4.23.4/lib/util/util.c:642:24: branch_true: ...to here
samba-4.23.4/lib/util/util.c:650:20: branch_false: following ‘false’ branch (when ‘i >= len1’)...
samba-4.23.4/lib/util/util.c:655:20: branch_false: ...to here
samba-4.23.4/lib/util/util.c:655:20: branch_false: following ‘false’ branch (when ‘i >= len2’)...
samba-4.23.4/lib/util/util.c:662:21: branch_false: ...to here
samba-4.23.4/lib/util/util.c:661:20: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util.c:676:20: branch_false: ...to here
samba-4.23.4/lib/util/util.c:676:20: branch_true: following ‘true’ branch (when ‘this_len1 == this_len2’)...
samba-4.23.4/lib/util/util.c:677:22: branch_true: ...to here
samba-4.23.4/lib/util/util.c:677:22: danger: argument 2 (‘this_buf2’) NULL where non-null expected
#  675|   
#  676|   		if ((this_len1 == this_len2) &&
#  677|-> 		    (memcmp(this_buf1, this_buf2, this_len1) == 0))
#  678|   		{
#  679|   			dump_data_block16(" ", i, this_buf1, this_len1,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def443]
samba-4.23.4/lib/util/util_file.c:193:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/lib/util/util_file.c:236:16: enter_function: entry to ‘file_load’
samba-4.23.4/lib/util/util_file.c:243:14: acquire_resource: opened here
samba-4.23.4/lib/util/util_file.c:244:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_file.c:246:13: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:246:13: call_function: calling ‘fd_load’ from ‘file_load’
samba-4.23.4/lib/util/util_file.c:246:13: return_function: returning to ‘file_load’ from ‘fd_load’
samba-4.23.4/lib/util/util_file.c:193:25: danger: ‘open(fname, 0)’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  191|   		size_t nread;
#  192|   
#  193|-> 		chunk = MIN(chunk, (maxsize - size));
#  194|   
#  195|   		newbufsize = size + (chunk+1); /* chunk+1 can't overflow */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def444]
samba-4.23.4/lib/util/util_file.c:218:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
samba-4.23.4/lib/util/util_file.c:172:16: enter_function: entry to ‘fd_load’
samba-4.23.4/lib/util/util_file.c:184:16: call_function: calling ‘fdopen_keepfd’ from ‘fd_load’
samba-4.23.4/lib/util/util_file.c:184:16: return_function: returning to ‘fd_load’ from ‘fdopen_keepfd’
samba-4.23.4/lib/util/util_file.c:185:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_file.c:185:12: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:189:16: branch_false: following ‘false’ branch (when ‘maxsize <= size’)...
samba-4.23.4/lib/util/util_file.c:213:15: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:214:12: branch_false: following ‘false’ branch (when ‘err == 0’)...
samba-4.23.4/lib/util/util_file.c:218:10: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:218:10: release_memory: ‘p’ is NULL
samba-4.23.4/lib/util/util_file.c:218:9: danger: dereference of NULL ‘p + size’
#  216|   	}
#  217|   
#  218|-> 	p[size] = '\0';
#  219|   
#  220|   	if (psize != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def445]
samba-4.23.4/lib/util/util_file.c:248:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/lib/util/util_file.c:236:16: enter_function: entry to ‘file_load’
samba-4.23.4/lib/util/util_file.c:243:14: acquire_resource: opened here
samba-4.23.4/lib/util/util_file.c:244:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_file.c:246:13: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:246:13: call_function: calling ‘fd_load’ from ‘file_load’
samba-4.23.4/lib/util/util_file.c:246:13: return_function: returning to ‘file_load’ from ‘fd_load’
samba-4.23.4/lib/util/util_file.c:248:9: danger: ‘open(fname, 0)’ leaks here; was opened at [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1)
#  246|   	p = fd_load(fd, size, maxsize, mem_ctx);
#  247|   
#  248|-> 	close(fd);
#  249|   
#  250|   	return p;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def446]
samba-4.23.4/lib/util/util_file.c:513:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/lib/util/util_file.c:236:16: enter_function: entry to ‘file_load’
samba-4.23.4/lib/util/util_file.c:243:14: acquire_resource: opened here
samba-4.23.4/lib/util/util_file.c:244:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_file.c:246:13: branch_false: ...to here
samba-4.23.4/lib/util/util_file.c:246:13: call_function: calling ‘fd_load’ from ‘file_load’
#  511|   	if (f == NULL) {
#  512|   		int err = errno;
#  513|-> 		close(dup_fd);
#  514|   		errno = err;
#  515|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def447]
samba-4.23.4/lib/util/util_ldb.c:45:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/util_ldb.c:86:5: enter_function: entry to ‘gendb_search’
samba-4.23.4/lib/util/util_ldb.c:96:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/util_ldb.c:97:17: call_function: calling ‘gendb_search_v’ from ‘gendb_search’
#   43|   
#   44|   	if (format) {
#   45|-> 		expr = talloc_vasprintf(mem_ctx, format, ap);
#   46|   		if (expr == NULL) {
#   47|   			return -1;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def448]
samba-4.23.4/lib/util/util_ldb.c:55:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/util_ldb.c:86:5: enter_function: entry to ‘gendb_search’
samba-4.23.4/lib/util/util_ldb.c:96:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/util_ldb.c:97:17: call_function: calling ‘gendb_search_v’ from ‘gendb_search’
#   53|   	res = NULL;
#   54|   
#   55|-> 	ret = ldb_search(ldb, mem_ctx, &res, basedn, scope, attrs,
#   56|   			 expr?"%s":NULL, expr);
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def449]
samba-4.23.4/lib/util/util_ldb.c:59:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/util_ldb.c:86:5: enter_function: entry to ‘gendb_search’
samba-4.23.4/lib/util/util_ldb.c:96:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/util_ldb.c:97:17: call_function: calling ‘gendb_search_v’ from ‘gendb_search’
#   57|   
#   58|   	if (ret == LDB_SUCCESS) {
#   59|-> 		DBG_DEBUG("%s %s -> %d\n",
#   60|   			 basedn?ldb_dn_get_linearized(basedn):"NULL",
#   61|   			 expr?expr:"NULL", res->count);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def450]
samba-4.23.4/lib/util/util_runcmd.c:128:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:128:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:128:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:128:17: danger: ‘p1[0]’ leaks here
#  126|   	}
#  127|   	if (pipe(p2) != 0) {
#  128|-> 		close(p1[0]);
#  129|   		close(p1[1]);
#  130|   		tevent_req_error(req, errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def451]
samba-4.23.4/lib/util/util_runcmd.c:128:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:128:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:128:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:128:17: danger: ‘p1[1]’ leaks here
#  126|   	}
#  127|   	if (pipe(p2) != 0) {
#  128|-> 		close(p1[0]);
#  129|   		close(p1[1]);
#  130|   		tevent_req_error(req, errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def452]
samba-4.23.4/lib/util/util_runcmd.c:129:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:128:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:129:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:129:17: danger: ‘p1[1]’ leaks here
#  127|   	if (pipe(p2) != 0) {
#  128|   		close(p1[0]);
#  129|-> 		close(p1[1]);
#  130|   		tevent_req_error(req, errno);
#  131|   		return tevent_req_post(req, ev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def453]
samba-4.23.4/lib/util/util_runcmd.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:134:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:134:17: danger: ‘p1[0]’ leaks here
#  132|   	}
#  133|   	if (pipe(p3) != 0) {
#  134|-> 		close(p1[0]);
#  135|   		close(p1[1]);
#  136|   		close(p2[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def454]
samba-4.23.4/lib/util/util_runcmd.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:134:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:134:17: danger: ‘p1[1]’ leaks here
#  132|   	}
#  133|   	if (pipe(p3) != 0) {
#  134|-> 		close(p1[0]);
#  135|   		close(p1[1]);
#  136|   		close(p2[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def455]
samba-4.23.4/lib/util/util_runcmd.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:134:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:134:17: danger: ‘p2[0]’ leaks here
#  132|   	}
#  133|   	if (pipe(p3) != 0) {
#  134|-> 		close(p1[0]);
#  135|   		close(p1[1]);
#  136|   		close(p2[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def456]
samba-4.23.4/lib/util/util_runcmd.c:134:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:134:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:134:17: danger: ‘p2[1]’ leaks here
#  132|   	}
#  133|   	if (pipe(p3) != 0) {
#  134|-> 		close(p1[0]);
#  135|   		close(p1[1]);
#  136|   		close(p2[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def457]
samba-4.23.4/lib/util/util_runcmd.c:135:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:135:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:135:17: danger: ‘p1[1]’ leaks here
#  133|   	if (pipe(p3) != 0) {
#  134|   		close(p1[0]);
#  135|-> 		close(p1[1]);
#  136|   		close(p2[0]);
#  137|   		close(p2[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def458]
samba-4.23.4/lib/util/util_runcmd.c:135:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:135:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:135:17: danger: ‘p2[0]’ leaks here
#  133|   	if (pipe(p3) != 0) {
#  134|   		close(p1[0]);
#  135|-> 		close(p1[1]);
#  136|   		close(p2[0]);
#  137|   		close(p2[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def459]
samba-4.23.4/lib/util/util_runcmd.c:135:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:135:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:135:17: danger: ‘p2[1]’ leaks here
#  133|   	if (pipe(p3) != 0) {
#  134|   		close(p1[0]);
#  135|-> 		close(p1[1]);
#  136|   		close(p2[0]);
#  137|   		close(p2[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def460]
samba-4.23.4/lib/util/util_runcmd.c:136:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:136:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:136:17: danger: ‘p2[0]’ leaks here
#  134|   		close(p1[0]);
#  135|   		close(p1[1]);
#  136|-> 		close(p2[0]);
#  137|   		close(p2[1]);
#  138|   		tevent_req_error(req, errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def461]
samba-4.23.4/lib/util/util_runcmd.c:136:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:136:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:136:17: danger: ‘p2[1]’ leaks here
#  134|   		close(p1[0]);
#  135|   		close(p1[1]);
#  136|-> 		close(p2[0]);
#  137|   		close(p2[1]);
#  138|   		tevent_req_error(req, errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def462]
samba-4.23.4/lib/util/util_runcmd.c:137:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_true: following ‘true’ branch...
samba-4.23.4/lib/util/util_runcmd.c:134:17: branch_true: ...to here
samba-4.23.4/lib/util/util_runcmd.c:137:17: throw: if ‘close’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:137:17: danger: ‘p2[1]’ leaks here
#  135|   		close(p1[1]);
#  136|   		close(p2[0]);
#  137|-> 		close(p2[1]);
#  138|   		tevent_req_error(req, errno);
#  139|   		return tevent_req_post(req, ev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def463]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p1[0]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def464]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p1[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p1[1]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def465]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p2[0]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def466]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p2[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p2[1]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def467]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p3[0]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p3[0]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def468]
samba-4.23.4/lib/util/util_runcmd.c:142:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘p3[1]’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:142:24: throw: if ‘tfork_create’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:142:24: danger: ‘p3[1]’ leaks here
#  140|   	}
#  141|   
#  142|-> 	state->tfork = tfork_create();
#  143|   	if (state->tfork == NULL) {
#  144|   		close(p1[0]);

Error: GCC_ANALYZER_WARNING: [#def469]
samba-4.23.4/lib/util/util_runcmd.c:235:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘0’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:153:22: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:223:9: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:226:9: release_resource: closed here
samba-4.23.4/lib/util/util_runcmd.c:235:9: danger: ‘0’ could be invalid
#  233|   
#  234|   	/* setup for logging to go to the parents debug log */
#  235|-> 	dup2(p3[0], 0);
#  236|   	dup2(p1[1], 1);
#  237|   	dup2(p2[1], 2);

Error: GCC_ANALYZER_WARNING: [#def470]
samba-4.23.4/lib/util/util_runcmd.c:236:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:153:22: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:223:9: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:227:9: release_resource: closed here
samba-4.23.4/lib/util/util_runcmd.c:236:9: danger: ‘1’ could be invalid
#  234|   	/* setup for logging to go to the parents debug log */
#  235|   	dup2(p3[0], 0);
#  236|-> 	dup2(p1[1], 1);
#  237|   	dup2(p2[1], 2);
#  238|   

Error: GCC_ANALYZER_WARNING: [#def471]
samba-4.23.4/lib/util/util_runcmd.c:237:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:153:22: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:223:9: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:228:9: release_resource: closed here
samba-4.23.4/lib/util/util_runcmd.c:237:9: danger: ‘2’ could be invalid
#  235|   	dup2(p3[0], 0);
#  236|   	dup2(p1[1], 1);
#  237|-> 	dup2(p2[1], 2);
#  238|   
#  239|   	close(p1[1]);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def472]
samba-4.23.4/lib/util/util_runcmd.c:255:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/util_runcmd.c:104:12: branch_false: following ‘false’ branch (when ‘argv0’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:108:15: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:110:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:114:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:123:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:127:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:133:13: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:133:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:142:14: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:143:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:153:22: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:154:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:223:9: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:244:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_runcmd.c:249:9: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:249:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/util_runcmd.c:253:20: branch_false: following ‘false’ branch (when ‘arg’ is non-NULL)...
samba-4.23.4/lib/util/util_runcmd.c:255:21: branch_false: ...to here
samba-4.23.4/lib/util/util_runcmd.c:255:21: throw: if ‘str_list_add’ throws an exception...
samba-4.23.4/lib/util/util_runcmd.c:255:21: danger: missing call to ‘va_end’ to match ‘va_start’ at [(22)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/21)
#  253|   		if (arg == NULL) break;
#  254|   		l = discard_const_p(const char *, argv);
#  255|-> 		l = str_list_add(l, arg);
#  256|   		if (l == NULL) {
#  257|   			fprintf(stderr, "Out of memory in child\n");

Error: GCC_ANALYZER_WARNING (CWE-404): [#def473]
samba-4.23.4/lib/util/util_strlist.c:340:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/lib/util/util_strlist.c:320:6: enter_function: entry to ‘str_list_add_printf’
samba-4.23.4/lib/util/util_strlist.c:327:12: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)...
samba-4.23.4/lib/util/util_strlist.c:330:15: branch_false: ...to here
samba-4.23.4/lib/util/util_strlist.c:330:15: call_function: calling ‘str_list_length’ from ‘str_list_add_printf’
samba-4.23.4/lib/util/util_strlist.c:330:15: return_function: returning to ‘str_list_add_printf’ from ‘str_list_length’
samba-4.23.4/lib/util/util_strlist.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/lib/util/util_strlist.c:337:14: branch_false: ...to here
samba-4.23.4/lib/util/util_strlist.c:339:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/lib/util/util_strlist.c:340:21: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/lib/util/util_strlist.c:340:21: danger: missing call to ‘va_end’ to match ‘va_start’ at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  338|   
#  339|   	va_start(ap, fmt);
#  340|-> 	list[len] = talloc_vasprintf(list, fmt, ap);
#  341|   	va_end(ap);
#  342|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def474]
samba-4.23.4/libcli/auth/msrpc_parse.c:75:31: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:60:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:63:19: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:64:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:69:9: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:69:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:70:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:71:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:75:31: throw: if ‘push_ucs2_talloc’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:75:31: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   73|   			s = va_arg(ap, char *);
#   74|   			head_size += 8;
#   75|-> 			ret = push_ucs2_talloc(
#   76|   				pointers,
#   77|   				(smb_ucs2_t **)(void *)&pointers[i].data,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def475]
samba-4.23.4/libcli/auth/msrpc_parse.c:90:31: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:60:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:63:19: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:64:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:69:9: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:69:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:70:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:71:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:90:31: throw: if ‘push_ascii_talloc’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:90:31: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   88|   			s = va_arg(ap, char *);
#   89|   			head_size += 8;
#   90|-> 			ret = push_ascii_talloc(
#   91|   				pointers, (char **)(void *)&pointers[i].data,
#   92|   				s, &n);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def476]
samba-4.23.4/libcli/auth/msrpc_parse.c:259:39: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:252:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:253:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:258:28: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:259:39: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:259:39: throw: if ‘talloc_strdup’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:259:39: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  257|   			ps = va_arg(ap, char **);
#  258|   			if (len1 == 0 && len2 == 0) {
#  259|-> 				*ps = talloc_strdup(mem_ctx, "");
#  260|   				if (*ps == NULL) {
#  261|   					ret = false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def477]
samba-4.23.4/libcli/auth/msrpc_parse.c:283:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:252:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:253:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:258:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:268:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:268:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:272:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:277:37: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:277:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:283:38: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:283:38: throw: if ‘convert_string_talloc’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:283:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  281|   				}
#  282|   
#  283|-> 				if (!convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX,
#  284|   							   blob->data + ptr, len1,
#  285|   							   ps, &pull_len)) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def478]
samba-4.23.4/libcli/auth/msrpc_parse.c:300:39: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:292:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:293:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:299:28: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:300:39: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:300:39: throw: if ‘talloc_strdup’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:300:39: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  298|   			/* make sure its in the right format - be strict */
#  299|   			if (len1 == 0 && len2 == 0) {
#  300|-> 				*ps = talloc_strdup(mem_ctx, "");
#  301|   				if (*ps == NULL) {
#  302|   					ret = false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def479]
samba-4.23.4/libcli/auth/msrpc_parse.c:320:46: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:292:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:293:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:299:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:306:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:306:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:311:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:317:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:317:36: branch_true: following ‘true’ branch (when ‘len1 != 0’)...
samba-4.23.4/libcli/auth/msrpc_parse.c:320:46: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:320:46: throw: if ‘convert_string_talloc’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:320:46: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  318|   					size_t pull_len;
#  319|   
#  320|-> 					if (!convert_string_talloc(mem_ctx, CH_DOS, CH_UNIX, 
#  321|   								   blob->data + ptr, len1, 
#  322|   								   ps, &pull_len)) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def480]
samba-4.23.4/libcli/auth/msrpc_parse.c:327:47: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:292:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:293:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:299:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:306:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:306:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:311:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:317:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:317:36: branch_false: following ‘false’ branch (when ‘len1 == 0’)...
samba-4.23.4/libcli/auth/msrpc_parse.c:327:47: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:327:47: throw: if ‘talloc_strdup’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:327:47: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  325|   					}
#  326|   				} else {
#  327|-> 					*ps = talloc_strdup(mem_ctx, "");
#  328|   					if (*ps == NULL) {
#  329|   						ret = false;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def481]
samba-4.23.4/libcli/auth/msrpc_parse.c:343:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:336:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:337:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:342:28: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:343:38: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:343:38: throw: if ‘data_blob_talloc_named’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:343:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  341|   			b = (DATA_BLOB *)va_arg(ap, void *);
#  342|   			if (len1 == 0 && len2 == 0) {
#  343|-> 				*b = data_blob_talloc(mem_ctx, NULL, 0);
#  344|   			} else {
#  345|   				/* make sure its in the right format - be strict */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def482]
samba-4.23.4/libcli/auth/msrpc_parse.c:357:38: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:336:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:337:32: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:342:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:346:36: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:346:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:351:36: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:357:38: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:357:38: throw: if ‘data_blob_talloc_named’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:357:38: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  355|   				}
#  356|   
#  357|-> 				*b = data_blob_talloc(mem_ctx, blob->data + ptr, len1);
#  358|   			}
#  359|   			break;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def483]
samba-4.23.4/libcli/auth/msrpc_parse.c:371:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/auth/msrpc_parse.c:248:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/libcli/auth/msrpc_parse.c:249:19: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:250:17: branch_true: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:364:25: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:365:29: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:365:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:366:41: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:365:29: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/auth/msrpc_parse.c:371:30: branch_false: ...to here
samba-4.23.4/libcli/auth/msrpc_parse.c:371:30: throw: if ‘data_blob_talloc_named’ throws an exception...
samba-4.23.4/libcli/auth/msrpc_parse.c:371:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  369|   			}
#  370|   
#  371|-> 			*b = data_blob_talloc(mem_ctx, blob->data + head_ofs, len1);
#  372|   			head_ofs += len1;
#  373|   			break;

Error: COMPILER_WARNING (CWE-704): [#def484]
samba-4.23.4/libcli/auth/netlogon_creds_cli.c: scope_hint: In function ‘netlogon_creds_cli_context_common’
samba-4.23.4/libcli/auth/netlogon_creds_cli.c:172:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  172 |         p = strchr(server_computer, '.');
#      |           ^
#  170|   	 */
#  171|   
#  172|-> 	p = strchr(server_computer, '.');
#  173|   	if (p != NULL) {
#  174|   		server_netbios_name_len = p-server_computer;

Error: COMPILER_WARNING (CWE-704): [#def485]
samba-4.23.4/libcli/auth/netlogon_creds_cli.c:172:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  170|   	 */
#  171|   
#  172|-> 	p = strchr(server_computer, '.');
#  173|   	if (p != NULL) {
#  174|   		server_netbios_name_len = p-server_computer;

Error: COMPILER_WARNING (CWE-563): [#def486]
samba-4.23.4/libcli/auth/smbencrypt.c: scope_hint: In function ‘decode_pw_buffer’
samba-4.23.4/libcli/auth/smbencrypt.c:1449:13: warning[-Wunused-variable]: unused variable ‘byte_len’
# 1449 |         int byte_len=0;
#      |             ^~~~~~~~
# 1447|   {
# 1448|   	DATA_BLOB new_password;
# 1449|-> 	int byte_len=0;
# 1450|   	bool ok;
# 1451|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def487]
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/libcli/dns/dns_lookup.c:62:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/dns/dns_lookup.c:65:14: branch_false: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:70:12: branch_true: following ‘true’ branch (when ‘resolv_conf_fp’ is NULL)...
samba-4.23.4/libcli/dns/dns_lookup.c:82:22: branch_true: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:82:22: acquire_resource: opened here
samba-4.23.4/libcli/dns/dns_lookup.c:83:20: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/dns/dns_lookup.c:93:23: branch_false: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: throw: if ‘parse_resolvconf_fp’ throws an exception...
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: danger: ‘fp’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   87|   	}
#   88|   
#   89|-> 	ret = parse_resolvconf_fp(
#   90|   		fp,
#   91|   		state,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def488]
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/libcli/dns/dns_lookup.c:62:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/dns/dns_lookup.c:65:14: branch_false: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:70:12: branch_true: following ‘true’ branch (when ‘resolv_conf_fp’ is NULL)...
samba-4.23.4/libcli/dns/dns_lookup.c:82:22: branch_true: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:82:22: acquire_memory: allocated here
samba-4.23.4/libcli/dns/dns_lookup.c:83:20: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/dns/dns_lookup.c:93:23: branch_false: ...to here
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: throw: if ‘parse_resolvconf_fp’ throws an exception...
samba-4.23.4/libcli/dns/dns_lookup.c:89:15: danger: ‘fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   87|   	}
#   88|   
#   89|-> 	ret = parse_resolvconf_fp(
#   90|   		fp,
#   91|   		state,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def489]
samba-4.23.4/libcli/nbt/lmhosts.c:69:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘startlmhosts(lmhosts_file)’
samba-4.23.4/libcli/nbt/lmhosts.c:163:10: enter_function: entry to ‘resolve_lmhosts_file_as_sockaddr’
samba-4.23.4/libcli/nbt/lmhosts.c:187:14: call_function: calling ‘startlmhosts’ from ‘resolve_lmhosts_file_as_sockaddr’
samba-4.23.4/libcli/nbt/lmhosts.c:187:14: return_function: returning to ‘resolve_lmhosts_file_as_sockaddr’ from ‘startlmhosts’
samba-4.23.4/libcli/nbt/lmhosts.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/nbt/lmhosts.c:192:15: branch_false: ...to here
samba-4.23.4/libcli/nbt/lmhosts.c:193:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/nbt/lmhosts.c:193:12: branch_false: ...to here
samba-4.23.4/libcli/nbt/lmhosts.c:198:16: call_function: calling ‘getlmhostsent’ from ‘resolve_lmhosts_file_as_sockaddr’
#   67|   		*name_type = -1;
#   68|   
#   69|-> 		if (!fgets_slash(NULL,line,sizeof(line),fp)) {
#   70|   			continue;
#   71|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def490]
samba-4.23.4/libcli/nbt/lmhosts.c:69:22: warning[-Wanalyzer-malloc-leak]: leak of ‘startlmhosts(lmhosts_file)’
samba-4.23.4/libcli/nbt/lmhosts.c:163:10: enter_function: entry to ‘resolve_lmhosts_file_as_sockaddr’
samba-4.23.4/libcli/nbt/lmhosts.c:187:14: call_function: calling ‘startlmhosts’ from ‘resolve_lmhosts_file_as_sockaddr’
samba-4.23.4/libcli/nbt/lmhosts.c:187:14: return_function: returning to ‘resolve_lmhosts_file_as_sockaddr’ from ‘startlmhosts’
samba-4.23.4/libcli/nbt/lmhosts.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/nbt/lmhosts.c:192:15: branch_false: ...to here
samba-4.23.4/libcli/nbt/lmhosts.c:193:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/nbt/lmhosts.c:193:12: branch_false: ...to here
samba-4.23.4/libcli/nbt/lmhosts.c:198:16: call_function: calling ‘getlmhostsent’ from ‘resolve_lmhosts_file_as_sockaddr’
#   67|   		*name_type = -1;
#   68|   
#   69|-> 		if (!fgets_slash(NULL,line,sizeof(line),fp)) {
#   70|   			continue;
#   71|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def491]
samba-4.23.4/libcli/nbt/namequery.c:83:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘req’
samba-4.23.4/libcli/nbt/namequery.c:129:19: enter_function: entry to ‘nbt_name_query’
samba-4.23.4/libcli/nbt/namequery.c:133:16: call_function: calling ‘nbt_name_query_recv’ from ‘nbt_name_query’
#   81|   	status = nbt_name_request_recv(req);
#   82|   	if (!NT_STATUS_IS_OK(status) ||
#   83|-> 	    req->num_replies == 0) {
#   84|   		talloc_free(req);
#   85|   		return status;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def492]
samba-4.23.4/libcli/nbt/namequery.c:187:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘req’
samba-4.23.4/libcli/nbt/namequery.c:227:19: enter_function: entry to ‘nbt_name_status’
samba-4.23.4/libcli/nbt/namequery.c:231:16: call_function: calling ‘nbt_name_status_recv’ from ‘nbt_name_status’
#  185|   	status = nbt_name_request_recv(req);
#  186|   	if (!NT_STATUS_IS_OK(status) ||
#  187|-> 	    req->num_replies == 0) {
#  188|   		talloc_free(req);
#  189|   		return status;

Error: COMPILER_WARNING (CWE-704): [#def493]
samba-4.23.4/libcli/nbt/tools/nmblookup.c: scope_hint: In function ‘process_one’
samba-4.23.4/libcli/nbt/tools/nmblookup.c:212:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  212 |         p = strchr(name, '#');
#      |           ^
#  210|   	}
#  211|   
#  212|-> 	p = strchr(name, '#');
#  213|   	if (p) {
#  214|   		node_name = talloc_strndup(tmp_ctx, name, PTR_DIFF(p,name));

Error: COMPILER_WARNING (CWE-704): [#def494]
samba-4.23.4/libcli/nbt/tools/nmblookup.c:212:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  210|   	}
#  211|   
#  212|-> 	p = strchr(name, '#');
#  213|   	if (p) {
#  214|   		node_name = talloc_strndup(tmp_ctx, name, PTR_DIFF(p,name));

Error: GCC_ANALYZER_WARNING (CWE-404): [#def495]
samba-4.23.4/libcli/security/sddl_conditional_ace.c:1285:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/libcli/security/sddl_conditional_ace.c:2704:13: enter_function: entry to ‘parse_paren_literal’
samba-4.23.4/libcli/security/sddl_conditional_ace.c:2707:12: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/security/sddl_conditional_ace.c:2708:17: branch_true: ...to here
samba-4.23.4/libcli/security/sddl_conditional_ace.c:2708:17: call_function: calling ‘comp_error’ from ‘parse_paren_literal’
# 1283|   	va_list ap;
# 1284|   	va_start(ap, fmt);
# 1285|-> 	msg = talloc_vasprintf(comp->mem_ctx, fmt, ap);
# 1286|   	va_end(ap);
# 1287|   	if (msg == NULL) {

Error: CPPCHECK_WARNING (CWE-562): [#def496]
samba-4.23.4/libcli/security/sddl_conditional_ace.c:2642: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 2640|   
# 2641|   	comp->target = token.data.composite.tokens;
# 2642|-> 	comp->target_len = &token.data.composite.n_members;
# 2643|   
# 2644|   	/*

Error: CPPCHECK_WARNING (CWE-562): [#def497]
samba-4.23.4/libcli/security/sddl_conditional_ace.c:3014: error[autoVariables]: Address of local auto-variable assigned to a function parameter.
# 3012|   
# 3013|   	comp->target = composite.data.composite.tokens;
# 3014|-> 	comp->target_len = &composite.data.composite.n_members;
# 3015|   
# 3016|   	/*

Error: GCC_ANALYZER_WARNING (CWE-401): [#def498]
samba-4.23.4/libcli/smb/py_reparse_symlink.c:183:26: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/libcli/smb/py_reparse_symlink.c:173:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/py_reparse_symlink.c:176:9: branch_false: ...to here
samba-4.23.4/libcli/smb/py_reparse_symlink.c:181:12: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/smb/py_reparse_symlink.c:182:23: branch_true: ...to here
samba-4.23.4/libcli/smb/py_reparse_symlink.c:182:23: acquire_memory: allocated here
samba-4.23.4/libcli/smb/py_reparse_symlink.c:183:26: throw: if ‘reparse_data_buffer_marshall’ throws an exception...
samba-4.23.4/libcli/smb/py_reparse_symlink.c:183:26: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  181|   	if ((buflen > 0) && ((size_t)buflen > sizeof(stackbuf))) {
#  182|   		buf = malloc(buflen);
#  183|-> 		buflen = reparse_data_buffer_marshall(&reparse, buf, buflen);
#  184|   	}
#  185|   

Error: CPPCHECK_WARNING (CWE-457): [#def499]
samba-4.23.4/libcli/smb/smbXcli_base.c:5356: error[uninitvar]: Uninitialized variable: val
# 5354|   		SSVAL(val, 0, smb2cli_prots[i].smb2_dialect);
# 5355|   
# 5356|-> 		ok = data_blob_append(state, &dyn, val, sizeof(val));
# 5357|   		if (!ok) {
# 5358|   			return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def500]
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(wireshark_keyfile, 1025)’
samba-4.23.4/libcli/smb/smbXcli_base.c:7683:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7686:9: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7690:12: branch_false: following ‘false’ branch (when ‘wireshark_keyfile’ is non-NULL)...
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: acquire_resource: opened here
samba-4.23.4/libcli/smb/smbXcli_base.c:7694:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: throw: if ‘write’ throws an exception...
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: danger: ‘open(wireshark_keyfile, 1025)’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
# 7698|   	}
# 7699|   
# 7700|-> 	written = write(fd, line, strlen(line));
# 7701|   	if (written != strlen(line)) {
# 7702|   		DBG_ERR("Failed to write '%s' to '%s', only wrote: %zd\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def501]
samba-4.23.4/libcli/smb/smbXcli_base.c:7701:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(wireshark_keyfile, 1025)’
samba-4.23.4/libcli/smb/smbXcli_base.c:7683:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7686:9: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7690:12: branch_false: following ‘false’ branch (when ‘wireshark_keyfile’ is non-NULL)...
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: acquire_resource: opened here
samba-4.23.4/libcli/smb/smbXcli_base.c:7694:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7701:12: branch_true: following ‘true’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7702:17: branch_true: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7702:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/libcli/smb/smbXcli_base.c:7701:13: danger: ‘open(wireshark_keyfile, 1025)’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 7699|   
# 7700|   	written = write(fd, line, strlen(line));
# 7701|-> 	if (written != strlen(line)) {
# 7702|   		DBG_ERR("Failed to write '%s' to '%s', only wrote: %zd\n",
# 7703|   			line, wireshark_keyfile, written);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def502]
samba-4.23.4/libcli/smb/smbXcli_base.c:7711:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/libcli/smb/smbXcli_base.c:7683:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7686:9: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7690:12: branch_false: following ‘false’ branch (when ‘wireshark_keyfile’ is non-NULL)...
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7693:14: acquire_resource: opened here
samba-4.23.4/libcli/smb/smbXcli_base.c:7694:12: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7700:19: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7709:9: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smb/smbXcli_base.c:7710:12: branch_false: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7710:12: branch_true: following ‘true’ branch (when ‘fd != -1’)...
samba-4.23.4/libcli/smb/smbXcli_base.c:7711:17: branch_true: ...to here
samba-4.23.4/libcli/smb/smbXcli_base.c:7711:17: throw: if ‘close’ throws an exception...
samba-4.23.4/libcli/smb/smbXcli_base.c:7711:17: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 7709|   	TALLOC_FREE(state.s);
# 7710|   	if (fd != -1) {
# 7711|-> 		close(fd);
# 7712|   	}
# 7713|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def503]
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/libcli/smbreadline/smbreadline.c:83:24: acquire_memory: allocated here
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:88:16: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: danger: ‘line’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   89|   		struct pollfd pfd;
#   90|   
#   91|-> 		ZERO_STRUCT(pfd);
#   92|   		pfd.fd = fd;
#   93|   		pfd.events = POLLIN|POLLHUP;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def504]
samba-4.23.4/libcli/smbreadline/smbreadline.c:95:21: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/libcli/smbreadline/smbreadline.c:83:24: acquire_memory: allocated here
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:88:16: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:95:21: throw: if ‘sys_poll_intr’ throws an exception...
samba-4.23.4/libcli/smbreadline/smbreadline.c:95:21: danger: ‘line’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   93|   		pfd.events = POLLIN|POLLHUP;
#   94|   
#   95|-> 		if (sys_poll_intr(&pfd, 1, 5000) == 1) {
#   96|   			ret = fgets(line, BUFSIZ, stdin);
#   97|   			if (ret == 0) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def505]
samba-4.23.4/libcli/smbreadline/smbreadline.c:96:31: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/libcli/smbreadline/smbreadline.c:83:24: acquire_memory: allocated here
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:88:16: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:97:28: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:100:32: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:96:31: danger: ‘line’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   94|   
#   95|   		if (sys_poll_intr(&pfd, 1, 5000) == 1) {
#   96|-> 			ret = fgets(line, BUFSIZ, stdin);
#   97|   			if (ret == 0) {
#   98|   				SAFE_FREE(line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def506]
samba-4.23.4/libcli/smbreadline/smbreadline.c:103:25: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/libcli/smbreadline/smbreadline.c:83:24: acquire_memory: allocated here
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/libcli/smbreadline/smbreadline.c:84:12: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:88:16: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:91:17: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:95:20: branch_false: following ‘false’ branch...
samba-4.23.4/libcli/smbreadline/smbreadline.c:102:20: branch_false: ...to here
samba-4.23.4/libcli/smbreadline/smbreadline.c:103:25: throw: if the called function throws an exception...
samba-4.23.4/libcli/smbreadline/smbreadline.c:103:25: danger: ‘line’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  101|   		}
#  102|   		if (callback) {
#  103|-> 			callback();
#  104|   		}
#  105|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def507]
samba-4.23.4/libgpo/gpext/gpext.c:549:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(modules_path(_talloc_tos("../../libgpo/gpext/gpext.c:543"), "gpext"))’
samba-4.23.4/libgpo/gpext/gpext.c:543:15: acquire_memory: allocated here
samba-4.23.4/libgpo/gpext/gpext.c:545:12: branch_false: following ‘false’ branch...
samba-4.23.4/libgpo/gpext/gpext.c:545:12: branch_false: ...to here
samba-4.23.4/libgpo/gpext/gpext.c:549:26: throw: if ‘readdir’ throws an exception...
samba-4.23.4/libgpo/gpext/gpext.c:549:26: danger: ‘opendir(modules_path(_talloc_tos("../../libgpo/gpext/gpext.c:543"), "gpext"))’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  547|   	}
#  548|   
#  549|-> 	while ((dirent = readdir(dir))) {
#  550|   
#  551|   		fstring name; /* forgive me... */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def508]
samba-4.23.4/libgpo/gpo_filesync.c:72:26: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
samba-4.23.4/libgpo/gpo_filesync.c:55:12: branch_false: following ‘false’ branch...
samba-4.23.4/libgpo/gpo_filesync.c:59:19: branch_false: ...to here
samba-4.23.4/libgpo/gpo_filesync.c:59:12: branch_false: following ‘false’ branch...
samba-4.23.4/libgpo/gpo_filesync.c:64:29: branch_false: ...to here
samba-4.23.4/libgpo/gpo_filesync.c:64:29: acquire_memory: allocated here
samba-4.23.4/libgpo/gpo_filesync.c:64:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
samba-4.23.4/libgpo/gpo_filesync.c:64:12: branch_false: ...to here
samba-4.23.4/libgpo/gpo_filesync.c:72:26: throw: if ‘cli_read’ throws an exception...
samba-4.23.4/libgpo/gpo_filesync.c:72:26: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   70|   		size_t n = 0;
#   71|   
#   72|-> 		result = cli_read(cli, fnum, data, nread, read_size, &n);
#   73|   		if (!NT_STATUS_IS_OK(result)) {
#   74|   			goto out;

Error: COMPILER_WARNING (CWE-477): [#def509]
samba-4.23.4/libgpo/pygpo.c: scope_hint: In function ‘GPO_set_ds_path’
samba-4.23.4/libgpo/pygpo.c:58:16: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   58 |         struct GROUP_POLICY_OBJECT *gpo_ptr \
#      |                ^~~~~~~~~~~~~~~~~~~
samba-4.23.4/libgpo/pygpo.c:74:1: note: in expansion of macro ‘GPO_setter’
#   74 | GPO_setter(ds_path)
#      | ^~~~~~~~~~
/usr/include/python3.14/unicodeobject.h:1022: included_from: Included from here.
/usr/include/python3.14/Python.h:90: included_from: Included from here.
samba-4.23.4/lib/replace/system/python.h:27: included_from: Included from here.
samba-4.23.4/libgpo/pygpo.c:19: included_from: Included from here.
/usr/include/python3.14/cpython/unicodeobject.h:648:1: note: declared here
#  648 | _PyUnicode_AsString(PyObject *unicode)
#      | ^~~~~~~~~~~~~~~~~~~
#   56|   static int GPO_set_##ATTR(PyObject *self, PyObject *val, void *closure) \
#   57|   { \
#   58|-> 	struct GROUP_POLICY_OBJECT *gpo_ptr \
#   59|   		= pytalloc_get_ptr(self); \
#   60|   	\

Error: COMPILER_WARNING (CWE-477): [#def510]
samba-4.23.4/libgpo/pygpo.c:74:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   72|   	return 0; \
#   73|   }
#   74|-> GPO_setter(ds_path)
#   75|   GPO_setter(file_sys_path)
#   76|   GPO_setter(display_name)

Error: COMPILER_WARNING (CWE-477): [#def511]
samba-4.23.4/libgpo/pygpo.c:75:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   73|   }
#   74|   GPO_setter(ds_path)
#   75|-> GPO_setter(file_sys_path)
#   76|   GPO_setter(display_name)
#   77|   GPO_setter(name)

Error: COMPILER_WARNING (CWE-477): [#def512]
samba-4.23.4/libgpo/pygpo.c:76:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   74|   GPO_setter(ds_path)
#   75|   GPO_setter(file_sys_path)
#   76|-> GPO_setter(display_name)
#   77|   GPO_setter(name)
#   78|   GPO_setter(link)

Error: COMPILER_WARNING (CWE-477): [#def513]
samba-4.23.4/libgpo/pygpo.c:77:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   75|   GPO_setter(file_sys_path)
#   76|   GPO_setter(display_name)
#   77|-> GPO_setter(name)
#   78|   GPO_setter(link)
#   79|   GPO_setter(user_extensions)

Error: COMPILER_WARNING (CWE-477): [#def514]
samba-4.23.4/libgpo/pygpo.c:78:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   76|   GPO_setter(display_name)
#   77|   GPO_setter(name)
#   78|-> GPO_setter(link)
#   79|   GPO_setter(user_extensions)
#   80|   GPO_setter(machine_extensions)

Error: COMPILER_WARNING (CWE-477): [#def515]
samba-4.23.4/libgpo/pygpo.c:79:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   77|   GPO_setter(name)
#   78|   GPO_setter(link)
#   79|-> GPO_setter(user_extensions)
#   80|   GPO_setter(machine_extensions)
#   81|   #define GPO_int_getter(ATTR) \

Error: COMPILER_WARNING (CWE-477): [#def516]
samba-4.23.4/libgpo/pygpo.c:80:1: warning[-Wdeprecated-declarations]: ‘_PyUnicode_AsString’ is deprecated
#   78|   GPO_setter(link)
#   79|   GPO_setter(user_extensions)
#   80|-> GPO_setter(machine_extensions)
#   81|   #define GPO_int_getter(ATTR) \
#   82|   static PyObject* GPO_get_##ATTR(PyObject *self, void *closure) \

Error: GCC_ANALYZER_WARNING (CWE-404): [#def517]
samba-4.23.4/librpc/ndr/ndr.c:388:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/librpc/ndr/ndr.c:387:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/librpc/ndr/ndr.c:388:29: throw: if ‘talloc_vasprintf_append_buffer’ throws an exception...
samba-4.23.4/librpc/ndr/ndr.c:388:29: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  386|   
#  387|   	va_start(ap, format);
#  388|-> 	ndr->private_data = talloc_vasprintf_append_buffer((char *)ndr->private_data,
#  389|   						    format, ap);
#  390|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def518]
samba-4.23.4/librpc/ndr/ndr.c:544:17: warning[-Wanalyzer-jump-through-null]: jump through null pointer
samba-4.23.4/librpc/ndr/ndr.c:654:16: enter_function: entry to ‘ndr_print_function_secret_string’
samba-4.23.4/librpc/ndr/ndr.c:660:16: call_function: calling ‘ndr_print_generic_string’ from ‘ndr_print_function_secret_string’
#  542|   		inout_fn(ndr, name, inout_flags, ptr);
#  543|   	} else {
#  544|-> 		single_fn(ndr, name, ptr);
#  545|   	}
#  546|   	ret = talloc_steal(mem_ctx, (char *)ndr->private_data);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def519]
samba-4.23.4/librpc/ndr/ndr_basic.c:1060:69: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘addr[i]’
samba-4.23.4/librpc/ndr/ndr_basic.c:1057:9: branch_false: following ‘false’ branch...
samba-4.23.4/librpc/ndr/ndr_basic.c:1058:9: branch_false: ...to here
samba-4.23.4/librpc/ndr/ndr_basic.c:1058:9: branch_false: following ‘false’ branch...
samba-4.23.4/librpc/ndr/ndr_basic.c:1058:9: branch_false: ...to here
samba-4.23.4/librpc/ndr/ndr_basic.c:1059:21: branch_true: following ‘true’ branch (when ‘i != 16’)...
samba-4.23.4/librpc/ndr/ndr_basic.c:1060:69: branch_true: ...to here
samba-4.23.4/librpc/ndr/ndr_basic.c:1060:69: danger: use of uninitialized value ‘addr[i]’ here
# 1058|   	NDR_CHECK(ndr_pull_array_uint8(ndr, ndr_flags, addr, IPV6_BYTES));
# 1059|   	for (i = 0; i < IPV6_BYTES; ++i) {
# 1060|-> 		addr_str = talloc_asprintf_append(addr_str, "%02x", addr[i]);
# 1061|   		NDR_ERR_HAVE_NO_MEMORY(addr_str);
# 1062|   		/* We need a ':' every second byte but the last one */

Error: COMPILER_WARNING (CWE-704): [#def520]
samba-4.23.4/librpc/rpc/binding.c: scope_hint: In function ‘dcerpc_parse_binding’
samba-4.23.4/librpc/rpc/binding.c:398:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  398 |                 p = strchr(name, '=');
#      |                   ^
#  396|   		}
#  397|   
#  398|-> 		p = strchr(name, '=');
#  399|   		if (p != NULL) {
#  400|   			*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def521]
samba-4.23.4/librpc/rpc/binding.c:398:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  396|   		}
#  397|   
#  398|-> 		p = strchr(name, '=');
#  399|   		if (p != NULL) {
#  400|   			*p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def522]
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:49:22: warning[-Wanalyzer-malloc-leak]: leak of ‘d’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:44:13: acquire_memory: allocated here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:45:12: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:49:22: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:49:22: throw: if ‘wbcCtxCreate’ throws an exception...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:49:22: danger: ‘d’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   47|   	}
#   48|   
#   49|-> 	d->wbc_ctx = wbcCtxCreate();
#   50|   	if (d->wbc_ctx == NULL) {
#   51|   		free(d);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def523]
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘d’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:44:13: acquire_memory: allocated here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:45:12: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:49:22: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:50:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:55:9: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:55:9: throw: if ‘wbcSetClientProcessName’ throws an exception...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:55:9: danger: ‘d’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   53|   	}
#   54|   
#   55|-> 	wbcSetClientProcessName("krb5_localauth_plugin");
#   56|   
#   57|   	*data = d;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def524]
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:231:9: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:207:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:211:22: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:217:24: acquire_memory: allocated here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:231:9: throw: if ‘wbcFreeMemory’ throws an exception...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_localauth.c:231:9: danger: ‘name’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  229|   		break;
#  230|   	}
#  231|-> 	wbcFreeMemory(pwd);
#  232|   	if (code != 0) {
#  233|   		return code;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def525]
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:190:23: warning[-Wanalyzer-malloc-leak]: leak of ‘kdc_name’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:316:24: enter_function: entry to ‘smb_krb5_locator_lookup’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:342:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:351:14: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:363:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:367:23: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:368:20: branch_false: following ‘false’ branch (when ‘env’ is non-NULL)...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:377:17: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:379:28: acquire_memory: allocated here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:380:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:403:1: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:393:15: call_function: calling ‘smb_krb5_locator_call_cbfunc’ from ‘smb_krb5_locator_lookup’
#  188|   	while (count) {
#  189|   
#  190|-> 		ret = getaddrinfo(name, service, in, &out);
#  191|   		if (ret == 0) {
#  192|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def526]
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:214:23: warning[-Wanalyzer-malloc-leak]: leak of ‘kdc_name’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:316:24: enter_function: entry to ‘smb_krb5_locator_lookup’
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:342:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:351:14: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:363:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:367:23: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:368:20: branch_false: following ‘false’ branch (when ‘env’ is non-NULL)...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:377:17: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:379:28: acquire_memory: allocated here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:380:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:403:1: branch_false: ...to here
samba-4.23.4/nsswitch/krb5_plugin/winbind_krb5_locator.c:393:15: call_function: calling ‘smb_krb5_locator_call_cbfunc’ from ‘smb_krb5_locator_lookup’
#  212|   		}
#  213|   
#  214|-> 		ret = cbfunc(cbdata, res->ai_socktype, res->ai_addr);
#  215|   		if (ret) {
#  216|   #ifdef DEBUG_KRB5

Error: GCC_ANALYZER_WARNING (CWE-401): [#def527]
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:365:23: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:352:27: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:353:12: branch_false: following ‘false’ branch (when ‘sidlist’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:353:12: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:359:19: branch_true: following ‘true’ branch (when ‘i < num_sids’)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:363:38: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:365:23: throw: if ‘wbcSidToStringBuf’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:365:23: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  363|   		remaining = buflen - (p - sidlist);
#  364|   
#  365|-> 		len = wbcSidToStringBuf(&sids[i], p, remaining);
#  366|   		if (len > remaining) {
#  367|   			free(sidlist);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def528]
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:374:10: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:352:27: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:353:12: branch_false: following ‘false’ branch (when ‘sidlist’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:353:12: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:359:19: branch_false: following ‘false’ branch (when ‘i >= num_sids’)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:374:10: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:376:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:374:10: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  372|   		*p++ = '\n';
#  373|   	}
#  374|-> 	*p++ = '\0';
#  375|   
#  376|   	ZERO_STRUCT(request);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def529]
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:516:22: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:479:15: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:480:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:480:12: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:486:19: branch_false: following ‘false’ branch (when ‘i >= num_ids’)...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:512:54: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:516:22: throw: if ‘wbcRequestResponse’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_idmap.c:516:22: danger: ‘buf’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  514|   	response = (struct winbindd_response) {0};
#  515|   
#  516|-> 	wbc_status = wbcRequestResponse(ctx, WINBINDD_XIDS_TO_SIDS,
#  517|   					&request, &response);
#  518|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def530]
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1431:18: warning[-Wanalyzer-malloc-leak]: leak of ‘request.extra_data.data’
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1344:12: branch_false: following ‘false’ branch (when ‘params’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1345:17: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1344:13: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1346:17: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1344:13: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1344:13: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1351:19: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1362:32: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1362:20: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1363:28: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1363:28: branch_false: following ‘false’ branch (when ‘initial_blob’ is NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1362:20: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1380:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1392:17: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1407:12: branch_false: following ‘false’ branch (when ‘challenge_blob’ is NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1413:13: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1413:12: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1414:51: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1414:51: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1415:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1420:12: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1424:12: branch_false: following ‘false’ branch (when ‘challenge_blob’ is NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1431:18: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1431:18: throw: if ‘wbcRequestResponse’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_pam.c:1431:18: danger: ‘request.extra_data.data’ leaks here; was allocated at [(20)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/19)
# 1429|   	}
# 1430|   
# 1431|-> 	status = wbcRequestResponse(ctx, WINBINDD_CCACHE_NTLMAUTH,
# 1432|   				    &request, &response);
# 1433|   	if (!WBC_ERROR_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def531]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:580:22: warning[-Wanalyzer-malloc-leak]: leak of ‘ridlist’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:528:8: enter_function: entry to ‘wbcCtxLookupRids’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:552:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:557:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:557:9: call_function: calling ‘wbcSidToStringBuf’ from ‘wbcCtxLookupRids’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:557:9: return_function: returning to ‘wbcCtxLookupRids’ from ‘wbcSidToStringBuf’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:566:27: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:567:9: branch_false: following ‘false’ branch (when ‘ridlist’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:567:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:570:19: branch_false: following ‘false’ branch (when ‘i >= num_rids’)...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:574:16: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:580:22: throw: if ‘wbcRequestResponse’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:580:22: danger: ‘ridlist’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8)
#  578|   	request.extra_len = len;
#  579|   
#  580|-> 	wbc_status = wbcRequestResponse(ctx, WINBINDD_LOOKUPRIDS,
#  581|   					&request,
#  582|   					&response);

Error: COMPILER_WARNING (CWE-704): [#def532]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxLookupUserSids’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:720:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  720 |                 char *n = strchr(s, '\n');
#      |                           ^~~~~~
#  718|   	s = (const char *)response.extra_data.data;
#  719|   	for (i = 0; i < response.data.num_entries; i++) {
#  720|-> 		char *n = strchr(s, '\n');
#  721|   		if (n) {
#  722|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def533]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:720:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  718|   	s = (const char *)response.extra_data.data;
#  719|   	for (i = 0; i < response.data.num_entries; i++) {
#  720|-> 		char *n = strchr(s, '\n');
#  721|   		if (n) {
#  722|   			*n = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def534]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:834:22: warning[-Wanalyzer-malloc-leak]: leak of ‘extra_data’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:766:8: enter_function: entry to ‘wbcCtxGetSidAliases’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:789:12: branch_false: following ‘false’ branch (when ‘dom_sid’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:794:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:794:9: call_function: calling ‘wbcSidToStringBuf’ from ‘wbcCtxGetSidAliases’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:794:9: return_function: returning to ‘wbcCtxGetSidAliases’ from ‘wbcSidToStringBuf’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:799:30: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:800:12: branch_false: following ‘false’ branch (when ‘extra_data’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:800:12: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:806:19: branch_false: following ‘false’ branch (when ‘i >= num_sids’)...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:829:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:834:22: throw: if ‘wbcRequestResponse’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:834:22: danger: ‘extra_data’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  832|   	request.extra_len = extra_data_len;
#  833|   
#  834|-> 	wbc_status = wbcRequestResponse(ctx, WINBINDD_GETSIDALIASES,
#  835|   					&request,
#  836|   					&response);

Error: COMPILER_WARNING (CWE-704): [#def535]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxGetSidAliases’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:851:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  851 |                 char *n = strchr(s, '\n');
#      |                           ^~~~~~
#  849|   	s = (const char *)response.extra_data.data;
#  850|   	for (i = 0; i < response.data.num_entries; i++) {
#  851|-> 		char *n = strchr(s, '\n');
#  852|   		if (n) {
#  853|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def536]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:851:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  849|   	s = (const char *)response.extra_data.data;
#  850|   	for (i = 0; i < response.data.num_entries; i++) {
#  851|-> 		char *n = strchr(s, '\n');
#  852|   		if (n) {
#  853|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def537]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxListUsers’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:933:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  933 |                 k = strchr(next, ',');
#      |                   ^
#  931|   
#  932|   		current = next;
#  933|-> 		k = strchr(next, ',');
#  934|   
#  935|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def538]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:933:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  931|   
#  932|   		current = next;
#  933|-> 		k = strchr(next, ',');
#  934|   
#  935|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def539]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxListGroups’
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:1017:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1017 |                 k = strchr(next, ',');
#      |                   ^
# 1015|   
# 1016|   		current = next;
# 1017|-> 		k = strchr(next, ',');
# 1018|   
# 1019|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def540]
samba-4.23.4/nsswitch/libwbclient/wbc_sid.c:1017:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1015|   
# 1016|   		current = next;
# 1017|-> 		k = strchr(next, ',');
# 1018|   
# 1019|   		if (k) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def541]
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:456:22: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:558:8: enter_function: entry to ‘wbcCtxListTrusts’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:578:9: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:582:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:584:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:595:9: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:597:36: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:597:22: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:598:9: branch_false: following ‘false’ branch (when ‘extra_data’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:598:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:604:19: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:607:20: branch_true: following ‘true’ branch (when ‘next’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:608:25: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:612:30: call_function: calling ‘process_domain_info_string’ from ‘wbcCtxListTrusts’
#  454|   	s++;
#  455|   
#  456|-> 	wbc_status = wbcStringToSid(r, &info->sid);
#  457|   	BAIL_ON_WBC_ERROR(wbc_status);
#  458|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def542]
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:624:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:558:8: enter_function: entry to ‘wbcCtxListTrusts’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:578:9: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:582:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:584:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:595:9: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:597:36: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:597:22: acquire_memory: allocated here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:598:9: branch_false: following ‘false’ branch (when ‘extra_data’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:598:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:604:19: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:607:20: branch_true: following ‘true’ branch (when ‘next’ is non-NULL)...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:608:25: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:612:30: call_function: calling ‘process_domain_info_string’ from ‘wbcCtxListTrusts’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:612:30: return_function: returning to ‘wbcCtxListTrusts’ from ‘process_domain_info_string’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:613:17: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:613:17: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:623:9: call_function: inlined call to ‘winbindd_free_response’ from ‘wbcCtxListTrusts’
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:624:9: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:624:9: throw: if ‘wbcFreeMemory’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbc_util.c:624:9: danger: ‘p’ leaks here; was allocated at [(8)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/7)
#  622|    done:
#  623|   	winbindd_free_response(&response);
#  624|-> 	wbcFreeMemory(d_list);
#  625|   	free(extra_data);
#  626|   	return wbc_status;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def543]
samba-4.23.4/nsswitch/libwbclient/wbclient.c:244:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:312:20: enter_function: entry to ‘wbcCtxCreate’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:317:36: call_function: calling ‘wbcAllocateMemory’ from ‘wbcCtxCreate’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:317:36: return_function: returning to ‘wbcCtxCreate’ from ‘wbcAllocateMemory’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:320:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbclient.c:324:17: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbclient.c:326:12: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/libwbclient/wbclient.c:327:17: branch_true: ...to here
samba-4.23.4/nsswitch/libwbclient/wbclient.c:327:17: call_function: calling ‘wbcFreeMemory’ from ‘wbcCtxCreate’
#  242|   
#  243|   	if (wbcMem->destructor != NULL) {
#  244|-> 		wbcMem->destructor(p);
#  245|   	}
#  246|   	free(wbcMem);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def544]
samba-4.23.4/nsswitch/libwbclient/wbclient.c:324:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:312:20: enter_function: entry to ‘wbcCtxCreate’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:317:36: call_function: calling ‘wbcAllocateMemory’ from ‘wbcCtxCreate’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:317:36: return_function: returning to ‘wbcCtxCreate’ from ‘wbcAllocateMemory’
samba-4.23.4/nsswitch/libwbclient/wbclient.c:320:12: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/libwbclient/wbclient.c:324:17: branch_false: ...to here
samba-4.23.4/nsswitch/libwbclient/wbclient.c:324:17: throw: if ‘winbindd_ctx_create’ throws an exception...
samba-4.23.4/nsswitch/libwbclient/wbclient.c:324:17: danger: ‘<unknown>’ leaks here; was allocated at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5)
#  322|   	}
#  323|   
#  324|-> 	wbctx = winbindd_ctx_create();
#  325|   
#  326|   	if (!wbctx) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def545]
samba-4.23.4/nsswitch/pam_winbind.c:189:9: warning[-Wanalyzer-malloc-leak]: leak of ‘current_name’
samba-4.23.4/nsswitch/pam_winbind.c:1171:13: enter_function: entry to ‘winbind_name_list_to_sid_string_list’
samba-4.23.4/nsswitch/pam_winbind.c:1188:16: branch_true: following ‘true’ branch (when ‘comma’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1190:40: branch_true: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1189:32: acquire_memory: allocated here
samba-4.23.4/nsswitch/pam_winbind.c:1191:20: branch_false: following ‘false’ branch (when ‘current_name’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: call_function: calling ‘winbind_name_to_sid_string’ from ‘winbind_name_list_to_sid_string_list’
#  187|   			 va_list args)
#  188|   {
#  189|-> 	pam_vsyslog(pamh, err, format, args);
#  190|   }
#  191|   #else

Error: GCC_ANALYZER_WARNING (CWE-404): [#def546]
samba-4.23.4/nsswitch/pam_winbind.c:189:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/nsswitch/pam_winbind.c:2168:12: enter_function: entry to ‘_winbind_read_password’
samba-4.23.4/nsswitch/pam_winbind.c:2180:9: call_function: calling ‘_pam_log’ from ‘_winbind_read_password’
#  187|   			 va_list args)
#  188|   {
#  189|-> 	pam_vsyslog(pamh, err, format, args);
#  190|   }
#  191|   #else

Error: COMPILER_WARNING (CWE-477): [#def547]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘_make_remark’
samba-4.23.4/nsswitch/pam_winbind.c:735:17: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
#  735 |                 _pam_drop_reply(resp, 1);
#      |                 ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.h:104: included_from: Included from here.
samba-4.23.4/nsswitch/pam_winbind.c:13: included_from: Included from here.
samba-4.23.4/nsswitch/pam_winbind.c:735:17: note: declared here
#  735 |                 _pam_drop_reply(resp, 1);
#      |                 ^~~~~~~~~~~~~~~
#  733|   
#  734|   	if (resp) {
#  735|-> 		_pam_drop_reply(resp, 1);
#  736|   	}
#  737|   	return retval;

Error: COMPILER_WARNING (CWE-477): [#def548]
samba-4.23.4/nsswitch/pam_winbind.c:735:17: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
#  733|   
#  734|   	if (resp) {
#  735|-> 		_pam_drop_reply(resp, 1);
#  736|   	}
#  737|   	return retval;

Error: COMPILER_WARNING (CWE-477): [#def549]
samba-4.23.4/nsswitch/pam_winbind.c:735:17: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
#  735 |                 _pam_drop_reply(resp, 1);
#      |                 ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:735:17: note: declared here
#  735 |                 _pam_drop_reply(resp, 1);
#      |                 ^~~~~~~~~~~~~~~
#  733|   
#  734|   	if (resp) {
#  735|-> 		_pam_drop_reply(resp, 1);
#  736|   	}
#  737|   	return retval;

Error: COMPILER_WARNING (CWE-477): [#def550]
samba-4.23.4/nsswitch/pam_winbind.c:735:17: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
#  733|   
#  734|   	if (resp) {
#  735|-> 		_pam_drop_reply(resp, 1);
#  736|   	}
#  737|   	return retval;

Error: COMPILER_WARNING (CWE-477): [#def551]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘_pam_winbind_change_pwd’
samba-4.23.4/nsswitch/pam_winbind.c:906:9: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
#  906 |         _pam_drop_reply(resp, 1);
#      |         ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:906:9: note: declared here
#  906 |         _pam_drop_reply(resp, 1);
#      |         ^~~~~~~~~~~~~~~
#  904|   	}
#  905|   
#  906|-> 	_pam_drop_reply(resp, 1);
#  907|   	return retval;
#  908|   }

Error: COMPILER_WARNING (CWE-477): [#def552]
samba-4.23.4/nsswitch/pam_winbind.c:906:9: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
#  904|   	}
#  905|   
#  906|-> 	_pam_drop_reply(resp, 1);
#  907|   	return retval;
#  908|   }

Error: COMPILER_WARNING (CWE-477): [#def553]
samba-4.23.4/nsswitch/pam_winbind.c:906:9: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
#  906 |         _pam_drop_reply(resp, 1);
#      |         ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:906:9: note: declared here
#  906 |         _pam_drop_reply(resp, 1);
#      |         ^~~~~~~~~~~~~~~
#  904|   	}
#  905|   
#  906|-> 	_pam_drop_reply(resp, 1);
#  907|   	return retval;
#  908|   }

Error: COMPILER_WARNING (CWE-477): [#def554]
samba-4.23.4/nsswitch/pam_winbind.c:906:9: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
#  904|   	}
#  905|   
#  906|-> 	_pam_drop_reply(resp, 1);
#  907|   	return retval;
#  908|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def555]
samba-4.23.4/nsswitch/pam_winbind.c:1139:30: warning[-Wanalyzer-malloc-leak]: leak of ‘current_name’
samba-4.23.4/nsswitch/pam_winbind.c:1171:13: enter_function: entry to ‘winbind_name_list_to_sid_string_list’
samba-4.23.4/nsswitch/pam_winbind.c:1188:16: branch_true: following ‘true’ branch (when ‘comma’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1190:40: branch_true: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1189:32: acquire_memory: allocated here
samba-4.23.4/nsswitch/pam_winbind.c:1191:20: branch_false: following ‘false’ branch (when ‘current_name’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: call_function: calling ‘winbind_name_to_sid_string’ from ‘winbind_name_list_to_sid_string_list’
# 1137|   			       "no sid given, looking up: %s\n", name);
# 1138|   
# 1139|-> 		wbc_status = wbcCtxLookupName(ctx->wbc_ctx,
# 1140|   					      "",
# 1141|   					      name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def556]
samba-4.23.4/nsswitch/pam_winbind.c:1150:17: warning[-Wanalyzer-malloc-leak]: leak of ‘current_name’
samba-4.23.4/nsswitch/pam_winbind.c:1171:13: enter_function: entry to ‘winbind_name_list_to_sid_string_list’
samba-4.23.4/nsswitch/pam_winbind.c:1188:16: branch_true: following ‘true’ branch (when ‘comma’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1190:40: branch_true: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1189:32: acquire_memory: allocated here
samba-4.23.4/nsswitch/pam_winbind.c:1191:20: branch_false: following ‘false’ branch (when ‘current_name’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:1195:22: call_function: calling ‘winbind_name_to_sid_string’ from ‘winbind_name_list_to_sid_string_list’
# 1148|   		}
# 1149|   
# 1150|-> 		wbcSidToStringBuf(&sid, sid_string, sizeof(sid_string));
# 1151|   	}
# 1152|   

Error: COMPILER_WARNING (CWE-477): [#def557]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘_pam_delete’
samba-4.23.4/nsswitch/pam_winbind.c:2159:9: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2159 |         _pam_overwrite(xx);
#      |         ^~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:2159:9: note: declared here
# 2159 |         _pam_overwrite(xx);
#      |         ^~~~~~~~~~~~~~
# 2157|   static char *_pam_delete(register char *xx)
# 2158|   {
# 2159|-> 	_pam_overwrite(xx);
# 2160|   	_pam_drop(xx);
# 2161|   	return NULL;

Error: COMPILER_WARNING (CWE-477): [#def558]
samba-4.23.4/nsswitch/pam_winbind.c:2159:9: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2157|   static char *_pam_delete(register char *xx)
# 2158|   {
# 2159|-> 	_pam_overwrite(xx);
# 2160|   	_pam_drop(xx);
# 2161|   	return NULL;

Error: COMPILER_WARNING (CWE-477): [#def559]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘_winbind_read_password’
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
# 2269 |                         _pam_drop_reply(resp, i);
#      |                         ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: note: declared here
# 2269 |                         _pam_drop_reply(resp, i);
#      |                         ^~~~~~~~~~~~~~~
# 2267|   		}
# 2268|   		if (retval != PAM_SUCCESS) {
# 2269|-> 			_pam_drop_reply(resp, i);
# 2270|   			goto done;
# 2271|   		}

Error: COMPILER_WARNING (CWE-477): [#def560]
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
# 2267|   		}
# 2268|   		if (retval != PAM_SUCCESS) {
# 2269|-> 			_pam_drop_reply(resp, i);
# 2270|   			goto done;
# 2271|   		}

Error: COMPILER_WARNING (CWE-477): [#def561]
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2269 |                         _pam_drop_reply(resp, i);
#      |                         ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: note: declared here
# 2269 |                         _pam_drop_reply(resp, i);
#      |                         ^~~~~~~~~~~~~~~
# 2267|   		}
# 2268|   		if (retval != PAM_SUCCESS) {
# 2269|-> 			_pam_drop_reply(resp, i);
# 2270|   			goto done;
# 2271|   		}

Error: COMPILER_WARNING (CWE-477): [#def562]
samba-4.23.4/nsswitch/pam_winbind.c:2269:25: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2267|   		}
# 2268|   		if (retval != PAM_SUCCESS) {
# 2269|-> 			_pam_drop_reply(resp, i);
# 2270|   			goto done;
# 2271|   		}

Error: COMPILER_WARNING (CWE-477): [#def563]
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
# 2299 |                 _pam_drop_reply(resp, i);
#      |                 ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: note: declared here
# 2299 |                 _pam_drop_reply(resp, i);
#      |                 ^~~~~~~~~~~~~~~
# 2297|   		 * -- what is it for anyway? AGM
# 2298|   		 */
# 2299|-> 		_pam_drop_reply(resp, i);
# 2300|   	}
# 2301|   

Error: COMPILER_WARNING (CWE-477): [#def564]
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: warning[-Wdeprecated-declarations]: ‘reply_i’ is deprecated
# 2297|   		 * -- what is it for anyway? AGM
# 2298|   		 */
# 2299|-> 		_pam_drop_reply(resp, i);
# 2300|   	}
# 2301|   

Error: COMPILER_WARNING (CWE-477): [#def565]
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2299 |                 _pam_drop_reply(resp, i);
#      |                 ^~~~~~~~~~~~~~~
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: note: declared here
# 2299 |                 _pam_drop_reply(resp, i);
#      |                 ^~~~~~~~~~~~~~~
# 2297|   		 * -- what is it for anyway? AGM
# 2298|   		 */
# 2299|-> 		_pam_drop_reply(resp, i);
# 2300|   	}
# 2301|   

Error: COMPILER_WARNING (CWE-477): [#def566]
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: warning[-Wdeprecated-declarations]: ‘xx_’ is deprecated
# 2297|   		 * -- what is it for anyway? AGM
# 2298|   		 */
# 2299|-> 		_pam_drop_reply(resp, i);
# 2300|   	}
# 2301|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def567]
samba-4.23.4/nsswitch/pam_winbind.c:2312:18: warning[-Wanalyzer-malloc-leak]: leak of ‘token’
samba-4.23.4/nsswitch/pam_winbind.c:2168:12: enter_function: entry to ‘_winbind_read_password’
samba-4.23.4/nsswitch/pam_winbind.c:2261:26: call_function: calling ‘converse’ from ‘_winbind_read_password’
samba-4.23.4/nsswitch/pam_winbind.c:2261:26: return_function: returning to ‘_winbind_read_password’ from ‘converse’
samba-4.23.4/nsswitch/pam_winbind.c:2262:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/pam_winbind.c:2268:20: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:2268:20: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/pam_winbind.c:2275:25: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:2275:25: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/pam_winbind.c:2275:25: branch_true: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:2275:25: acquire_memory: allocated here
samba-4.23.4/nsswitch/pam_winbind.c:2276:20: branch_false: following ‘false’ branch (when ‘token’ is non-NULL)...
samba-4.23.4/nsswitch/pam_winbind.c:2284:20: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: branch_true: following ‘true’ branch...
samba-4.23.4/nsswitch/pam_winbind.c:2299:17: branch_false: following ‘false’ branch...
samba-4.23.4/nsswitch/pam_winbind.c:2303:12: branch_false: following ‘false’ branch (when ‘retval == 0’)...
samba-4.23.4/nsswitch/pam_winbind.c:2312:18: branch_false: ...to here
samba-4.23.4/nsswitch/pam_winbind.c:2312:18: throw: if ‘pam_set_item’ throws an exception...
samba-4.23.4/nsswitch/pam_winbind.c:2312:18: danger: ‘token’ leaks here; was allocated at [(13)](sarif:/runs/0/results/48/codeFlows/0/threadFlows/0/locations/12)
# 2310|   	/* we store this password as an item */
# 2311|   
# 2312|-> 	retval = pam_set_item(ctx->pamh, authtok_flag, token);
# 2313|   	_pam_delete(token);	/* clean it up */
# 2314|   	if (retval != PAM_SUCCESS ||

Error: COMPILER_WARNING (CWE-704): [#def568]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘get_conf_item_string’
samba-4.23.4/nsswitch/pam_winbind.c:2345:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2345 |                         if ((p = strchr(ctx->argv[i], '=')) == NULL) {
#      |                                ^
# 2343|   			char *p;
# 2344|   
# 2345|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2346|   				_pam_log(ctx, LOG_INFO,
# 2347|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def569]
samba-4.23.4/nsswitch/pam_winbind.c:2345:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2343|   			char *p;
# 2344|   
# 2345|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2346|   				_pam_log(ctx, LOG_INFO,
# 2347|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def570]
samba-4.23.4/nsswitch/pam_winbind.c: scope_hint: In function ‘get_config_item_int’
samba-4.23.4/nsswitch/pam_winbind.c:2391:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2391 |                         if ((p = strchr(ctx->argv[i], '=')) == NULL) {
#      |                                ^
# 2389|   			char *p;
# 2390|   
# 2391|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2392|   				_pam_log(ctx, LOG_INFO,
# 2393|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def571]
samba-4.23.4/nsswitch/pam_winbind.c:2391:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2389|   			char *p;
# 2390|   
# 2391|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2392|   				_pam_log(ctx, LOG_INFO,
# 2393|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def572]
samba-4.23.4/nsswitch/wb_common.c:340:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/nsswitch/wb_common.c:745:12: enter_function: entry to ‘winbind_read_sock’
samba-4.23.4/nsswitch/wb_common.c:752:14: call_function: calling ‘winbind_open_pipe_sock’ from ‘winbind_read_sock’
#  338|   	if (fd >= 0 && fd <= 2) {
#  339|   #ifdef F_DUPFD
#  340|-> 		if ((new_fd = fcntl(fd, F_DUPFD, 3)) == -1) {
#  341|   			return -1;
#  342|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def573]
samba-4.23.4/nsswitch/wb_common.c:395:22: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/nsswitch/wb_common.c:814:12: enter_function: entry to ‘winbindd_read_reply’
samba-4.23.4/nsswitch/wb_common.c:819:12: branch_false: following ‘false’ branch (when ‘response’ is non-NULL)...
samba-4.23.4/nsswitch/wb_common.c:825:19: branch_false: ...to here
samba-4.23.4/nsswitch/wb_common.c:825:19: call_function: calling ‘winbind_read_sock’ from ‘winbindd_read_reply’
#  393|   #endif
#  394|   
#  395|-> 	if ((flags = fcntl(new_fd, F_GETFL)) == -1) {
#  396|   		close(new_fd);
#  397|   		return -1;

Error: COMPILER_WARNING (CWE-704): [#def574]
samba-4.23.4/nsswitch/wbinfo.c: scope_hint: In function ‘parse_wbinfo_domain_user’
samba-4.23.4/nsswitch/wbinfo.c:119:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  119 |         char *p = strchr(domuser,winbind_separator());
#      |                   ^~~~~~
#  117|   {
#  118|   
#  119|-> 	char *p = strchr(domuser,winbind_separator());
#  120|   
#  121|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def575]
samba-4.23.4/nsswitch/wbinfo.c:119:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  117|   {
#  118|   
#  119|-> 	char *p = strchr(domuser,winbind_separator());
#  120|   
#  121|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def576]
samba-4.23.4/nsswitch/wbinfo.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  123 |                 p = strchr(domuser, '@');
#      |                   ^
#  121|   	if (!p) {
#  122|   		/* Maybe it was a UPN? */
#  123|-> 		p = strchr(domuser, '@');
#  124|   		if (p != NULL) {
#  125|   			fstrcpy(domain, "");

Error: COMPILER_WARNING (CWE-704): [#def577]
samba-4.23.4/nsswitch/wbinfo.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  121|   	if (!p) {
#  122|   		/* Maybe it was a UPN? */
#  123|-> 		p = strchr(domuser, '@');
#  124|   		if (p != NULL) {
#  125|   			fstrcpy(domain, "");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def578]
samba-4.23.4/source3/auth/pampass.c:448:13: warning[-Wanalyzer-malloc-leak]: leak of ‘smb_setup_pam_conv(&smb_pam_conv,  user,  password, 0)’
samba-4.23.4/source3/auth/pampass.c:822:10: enter_function: entry to ‘smb_pam_passcheck’
samba-4.23.4/source3/auth/pampass.c:835:22: call_function: calling ‘smb_setup_pam_conv’ from ‘smb_pam_passcheck’
samba-4.23.4/source3/auth/pampass.c:835:22: return_function: returning to ‘smb_pam_passcheck’ from ‘smb_setup_pam_conv’
samba-4.23.4/source3/auth/pampass.c:835:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/pampass.c:838:14: branch_false: ...to here
samba-4.23.4/source3/auth/pampass.c:838:14: call_function: calling ‘smb_pam_start’ from ‘smb_pam_passcheck’
#  446|   	struct smb_pam_userdata *udp = SMB_MALLOC_P(struct smb_pam_userdata);
#  447|   
#  448|-> 	if (pconv == NULL || udp == NULL) {
#  449|   		SAFE_FREE(pconv);
#  450|   		SAFE_FREE(udp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def579]
samba-4.23.4/source3/auth/pampass.c:448:13: warning[-Wanalyzer-malloc-leak]: leak of ‘smb_setup_pam_conv(&smb_pam_conv,  user, 0, 0)’
samba-4.23.4/source3/auth/pampass.c:794:10: enter_function: entry to ‘smb_pam_accountcheck’
samba-4.23.4/source3/auth/pampass.c:802:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/auth/pampass.c:805:22: branch_true: ...to here
samba-4.23.4/source3/auth/pampass.c:805:22: call_function: calling ‘smb_setup_pam_conv’ from ‘smb_pam_accountcheck’
samba-4.23.4/source3/auth/pampass.c:805:22: return_function: returning to ‘smb_pam_accountcheck’ from ‘smb_setup_pam_conv’
samba-4.23.4/source3/auth/pampass.c:805:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/pampass.c:808:14: branch_false: ...to here
samba-4.23.4/source3/auth/pampass.c:808:14: call_function: calling ‘smb_pam_start’ from ‘smb_pam_accountcheck’
#  446|   	struct smb_pam_userdata *udp = SMB_MALLOC_P(struct smb_pam_userdata);
#  447|   
#  448|-> 	if (pconv == NULL || udp == NULL) {
#  449|   		SAFE_FREE(pconv);
#  450|   		SAFE_FREE(udp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def580]
samba-4.23.4/source3/auth/pampass.c:448:13: warning[-Wanalyzer-malloc-leak]: leak of ‘smb_setup_pam_conv(&smb_pam_passchange_conv,  user,  oldpassword,  newpassword)’
samba-4.23.4/source3/auth/pampass.c:867:6: enter_function: entry to ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: call_function: calling ‘smb_setup_pam_conv’ from ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: return_function: returning to ‘smb_pam_passchange’ from ‘smb_setup_pam_conv’
samba-4.23.4/source3/auth/pampass.c:874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/pampass.c:877:13: branch_false: ...to here
samba-4.23.4/source3/auth/pampass.c:877:13: call_function: calling ‘smb_pam_start’ from ‘smb_pam_passchange’
#  446|   	struct smb_pam_userdata *udp = SMB_MALLOC_P(struct smb_pam_userdata);
#  447|   
#  448|-> 	if (pconv == NULL || udp == NULL) {
#  449|   		SAFE_FREE(pconv);
#  450|   		SAFE_FREE(udp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def581]
samba-4.23.4/source3/auth/pampass.c:498:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/auth/pampass.c:867:6: enter_function: entry to ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: call_function: calling ‘smb_setup_pam_conv’ from ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: return_function: returning to ‘smb_pam_passchange’ from ‘smb_setup_pam_conv’
samba-4.23.4/source3/auth/pampass.c:874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/pampass.c:877:13: branch_false: ...to here
samba-4.23.4/source3/auth/pampass.c:877:13: call_function: calling ‘smb_pam_start’ from ‘smb_pam_passchange’
#  496|   	*pamh = (pam_handle_t *)NULL;
#  497|   
#  498|-> 	DEBUG(4,("smb_pam_start: PAM: Init user: %s\n", user));
#  499|   
#  500|   	pam_error = pam_start("samba", user, pconv, pamh);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def582]
samba-4.23.4/source3/auth/pampass.c:500:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/auth/pampass.c:867:6: enter_function: entry to ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: call_function: calling ‘smb_setup_pam_conv’ from ‘smb_pam_passchange’
samba-4.23.4/source3/auth/pampass.c:874:22: return_function: returning to ‘smb_pam_passchange’ from ‘smb_setup_pam_conv’
samba-4.23.4/source3/auth/pampass.c:874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/pampass.c:877:13: branch_false: ...to here
samba-4.23.4/source3/auth/pampass.c:877:13: call_function: calling ‘smb_pam_start’ from ‘smb_pam_passchange’
#  498|   	DEBUG(4,("smb_pam_start: PAM: Init user: %s\n", user));
#  499|   
#  500|-> 	pam_error = pam_start("samba", user, pconv, pamh);
#  501|   	if( !smb_pam_error_handler(*pamh, pam_error, "Init Failed", 0)) {
#  502|   		*pamh = (pam_handle_t *)NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def583]
samba-4.23.4/source3/auth/user_util.c:369:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lp_username_map(_talloc_tos("../../source3/auth/user_util.c:278"), loadparm_s3_global_substitution()), "r")’
samba-4.23.4/source3/auth/user_util.c:273:6: enter_function: entry to ‘map_username’
samba-4.23.4/source3/auth/user_util.c:286:12: branch_false: following ‘false’ branch (when ‘user_in’ is non-NULL)...
samba-4.23.4/source3/auth/user_util.c:290:23: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:291:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:295:13: call_function: inlined call to ‘get_last_to’ from ‘map_username’
samba-4.23.4/source3/auth/user_util.c:295:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:298:13: call_function: inlined call to ‘get_last_from’ from ‘map_username’
samba-4.23.4/source3/auth/user_util.c:298:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:305:13: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:305:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:311:14: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:311:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:360:14: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:360:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:363:13: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:363:13: acquire_resource: opened here
samba-4.23.4/source3/auth/user_util.c:364:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:369:9: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:369:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/auth/user_util.c:369:9: branch_true: ...to here
samba-4.23.4/source3/auth/user_util.c:369:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/auth/user_util.c:369:9: danger: ‘fopen(lp_username_map(_talloc_tos("../../source3/auth/user_util.c:278"), loadparm_s3_global_substitution()), "r")’ leaks here; was opened at [(18)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/17)
#  367|   	}
#  368|   
#  369|-> 	DEBUG(4,("Scanning username map %s\n",mapfile));
#  370|   
#  371|   	while((s=fgets_slash(NULL,buf,sizeof(buf),f))!=NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def584]
samba-4.23.4/source3/auth/user_util.c:369:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lp_username_map(_talloc_tos("../../source3/auth/user_util.c:278"), loadparm_s3_global_substitution()), "r")’
samba-4.23.4/source3/auth/user_util.c:273:6: enter_function: entry to ‘map_username’
samba-4.23.4/source3/auth/user_util.c:286:12: branch_false: following ‘false’ branch (when ‘user_in’ is non-NULL)...
samba-4.23.4/source3/auth/user_util.c:290:23: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:291:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:295:13: call_function: inlined call to ‘get_last_to’ from ‘map_username’
samba-4.23.4/source3/auth/user_util.c:295:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:298:13: call_function: inlined call to ‘get_last_from’ from ‘map_username’
samba-4.23.4/source3/auth/user_util.c:298:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:305:13: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:305:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:311:14: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:311:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:360:14: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:360:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:363:13: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:363:13: acquire_memory: allocated here
samba-4.23.4/source3/auth/user_util.c:364:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/auth/user_util.c:369:9: branch_false: ...to here
samba-4.23.4/source3/auth/user_util.c:369:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/auth/user_util.c:369:9: branch_true: ...to here
samba-4.23.4/source3/auth/user_util.c:369:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/auth/user_util.c:369:9: danger: ‘fopen(lp_username_map(_talloc_tos("../../source3/auth/user_util.c:278"), loadparm_s3_global_substitution()), "r")’ leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
#  367|   	}
#  368|   
#  369|-> 	DEBUG(4,("Scanning username map %s\n",mapfile));
#  370|   
#  371|   	while((s=fgets_slash(NULL,buf,sizeof(buf),f))!=NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def585]
samba-4.23.4/source3/client/client.c:349:17: warning[-Wanalyzer-malloc-leak]: leak of ‘info.dirmask’
samba-4.23.4/source3/client/client.c:5917:15: enter_function: entry to ‘remote_completion’
samba-4.23.4/source3/client/client.c:5935:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5945:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5957:12: branch_false: following ‘false’ branch (when ‘i <= 0’)...
samba-4.23.4/source3/client/client.c:5970:32: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5970:32: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:5971:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5974:27: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5978:12: branch_false: following ‘false’ branch (when ‘dirmask’ is non-NULL)...
samba-4.23.4/source3/client/client.c:5981:19: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5981:19: call_function: calling ‘client_clean_name’ from ‘remote_completion’
#  347|   {
#  348|   	if (!(cli->requested_posix_capabilities & CIFS_UNIX_POSIX_PATHNAMES_CAP)) {
#  349|-> 		string_replace(newdir,'/','\\');
#  350|   	}
#  351|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def586]
samba-4.23.4/source3/client/client.c:366:19: warning[-Wanalyzer-malloc-leak]: leak of ‘info.dirmask’
samba-4.23.4/source3/client/client.c:5917:15: enter_function: entry to ‘remote_completion’
samba-4.23.4/source3/client/client.c:5935:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5945:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5957:12: branch_false: following ‘false’ branch (when ‘i <= 0’)...
samba-4.23.4/source3/client/client.c:5970:32: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5970:32: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:5971:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5974:27: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5978:12: branch_false: following ‘false’ branch (when ‘dirmask’ is non-NULL)...
samba-4.23.4/source3/client/client.c:5981:19: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5981:19: call_function: calling ‘client_clean_name’ from ‘remote_completion’
#  364|   
#  365|   	/* First ensure any path separators are correct. */
#  366|-> 	newname = talloc_strdup(ctx, name);
#  367|   	if (newname == NULL) {
#  368|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def587]
samba-4.23.4/source3/client/client.c:1912:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lname, "r")’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1884:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1896:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_resource: opened here
samba-4.23.4/source3/client/client.c:1912:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/client.c:1913:29: branch_true: ...to here
samba-4.23.4/source3/client/client.c:1913:29: throw: if ‘fseek’ throws an exception...
samba-4.23.4/source3/client/client.c:1912:21: danger: ‘fopen(lname, "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
# 1910|   	} else {
# 1911|   		f = fopen(lname, "r");
# 1912|-> 		if (f && reput) {
# 1913|   			if (fseek(f, start, SEEK_SET) == -1) {
# 1914|   				d_printf("Error seeking local file\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def588]
samba-4.23.4/source3/client/client.c:1912:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lname, "r")’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1884:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1896:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:1912:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/client.c:1913:29: branch_true: ...to here
samba-4.23.4/source3/client/client.c:1913:29: throw: if ‘fseek’ throws an exception...
samba-4.23.4/source3/client/client.c:1912:21: danger: ‘fopen(lname, "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
# 1910|   	} else {
# 1911|   		f = fopen(lname, "r");
# 1912|-> 		if (f && reput) {
# 1913|   			if (fseek(f, start, SEEK_SET) == -1) {
# 1914|   				d_printf("Error seeking local file\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def589]
samba-4.23.4/source3/client/client.c:1926:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_resource: opened here
samba-4.23.4/source3/client/client.c:1921:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source3/client/client.c:1926:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1926:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/client/client.c:1926:9: danger: ‘f’ leaks here; was opened at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 1924|   	}
# 1925|   
# 1926|-> 	DEBUG(1,("putting file %s as %s ",lname,
# 1927|   		 rname));
# 1928|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def590]
samba-4.23.4/source3/client/client.c:1926:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:1921:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source3/client/client.c:1926:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1926:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/client/client.c:1926:9: danger: ‘f’ leaks here; was allocated at [(7)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/6)
# 1924|   	}
# 1925|   
# 1926|-> 	DEBUG(1,("putting file %s as %s ",lname,
# 1927|   		 rname));
# 1928|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def591]
samba-4.23.4/source3/client/client.c:1934:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_resource: opened here
samba-4.23.4/source3/client/client.c:1921:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source3/client/client.c:1926:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1934:18: throw: if ‘cli_push’ throws an exception...
samba-4.23.4/source3/client/client.c:1934:18: danger: ‘f’ leaks here; was opened at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 1932|   	state.nread = 0;
# 1933|   
# 1934|-> 	status = cli_push(targetcli, fnum, 0, 0, io_bufsize, push_source,
# 1935|   			  &state);
# 1936|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def592]
samba-4.23.4/source3/client/client.c:1934:18: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source3/client/client.c:1874:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1879:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1896:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:1907:14: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1907:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/client/client.c:1911:21: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1911:21: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:1921:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source3/client/client.c:1926:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:1934:18: throw: if ‘cli_push’ throws an exception...
samba-4.23.4/source3/client/client.c:1934:18: danger: ‘f’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
# 1932|   	state.nread = 0;
# 1933|   
# 1934|-> 	status = cli_push(targetcli, fnum, 0, 0, io_bufsize, push_source,
# 1935|   			  &state);
# 1936|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def593]
samba-4.23.4/source3/client/client.c:2110:25: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
samba-4.23.4/source3/client/client.c:2106:15: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:2107:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:2107:12: branch_false: ...to here
samba-4.23.4/source3/client/client.c:2110:25: throw: if ‘readdirname’ throws an exception...
samba-4.23.4/source3/client/client.c:2110:25: danger: ‘opendir(directory)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
# 2108|   		return -1;
# 2109|   
# 2110|->         while ((dname = readdirname(dir))) {
# 2111|   		if (ISDOT(dname) || ISDOTDOT(dname)) {
# 2112|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def594]
samba-4.23.4/source3/client/client.c:5872:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*f.name)’
samba-4.23.4/source3/client/client.c:5861:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5864:42: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5864:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5867:13: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5871:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/client.c:5872:46: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:5872:17: danger: ‘strdup(*f.name)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/6)
# 5870|   
# 5871|   	if ((info->dirmask[0] == 0) && !(f->attr & FILE_ATTRIBUTE_DIRECTORY))
# 5872|-> 		info->matches[info->count] = SMB_STRDUP(f->name);
# 5873|   	else {
# 5874|   		TALLOC_CTX *ctx = talloc_stackframe();

Error: GCC_ANALYZER_WARNING (CWE-401): [#def595]
samba-4.23.4/source3/client/client.c:5974:27: warning[-Wanalyzer-malloc-leak]: leak of ‘info.dirmask’
samba-4.23.4/source3/client/client.c:5935:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5945:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5957:12: branch_false: following ‘false’ branch (when ‘i <= 0’)...
samba-4.23.4/source3/client/client.c:5970:32: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5970:32: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:5971:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5974:27: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5974:27: throw: if ‘talloc_asprintf’ throws an exception...
samba-4.23.4/source3/client/client.c:5974:27: danger: ‘info.dirmask’ leaks here; was allocated at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
# 5972|   			goto cleanup;
# 5973|   		}
# 5974|-> 		dirmask = talloc_asprintf(ctx,
# 5975|   					"%s*",
# 5976|   					client_get_cur_dir());

Error: GCC_ANALYZER_WARNING (CWE-401): [#def596]
samba-4.23.4/source3/client/client.c:6025:9: warning[-Wanalyzer-malloc-leak]: leak of ‘strndup(info.matches[1], (long unsigned int)info.samelen)’
samba-4.23.4/source3/client/client.c:5917:15: enter_function: entry to ‘remote_completion’
samba-4.23.4/source3/client/client.c:5935:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5945:9: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5957:12: branch_true: following ‘true’ branch (when ‘i > 0’)...
samba-4.23.4/source3/client/client.c:5958:32: branch_true: ...to here
samba-4.23.4/source3/client/client.c:5959:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5962:17: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5978:12: branch_false: following ‘false’ branch (when ‘dirmask’ is non-NULL)...
samba-4.23.4/source3/client/client.c:5981:19: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5981:19: call_function: calling ‘client_clean_name’ from ‘remote_completion’
samba-4.23.4/source3/client/client.c:5981:19: return_function: returning to ‘remote_completion’ from ‘client_clean_name’
samba-4.23.4/source3/client/client.c:5982:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5986:18: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5989:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5992:18: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5994:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:5998:13: branch_false: ...to here
samba-4.23.4/source3/client/client.c:5998:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:6008:12: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6008:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:6025:27: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6025:27: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:6025:9: danger: ‘strndup(info.matches[1], (long unsigned int)info.samelen)’ leaks here; was allocated at [(28)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/27)
# 6023|   	 */
# 6024|   
# 6025|-> 	info.matches[0] = SMB_STRNDUP(info.matches[1], info.samelen);
# 6026|   	info.matches[info.count] = NULL;
# 6027|   	TALLOC_FREE(ctx);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def597]
samba-4.23.4/source3/client/client.c:6111:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/client/client.c:6044:12: branch_false: following ‘false’ branch (when ‘start == 0’)...
samba-4.23.4/source3/client/client.c:6082:27: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6083:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:6086:17: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6089:26: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/client.c:6092:36: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:6094:36: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6094:36: branch_true: following ‘true’ branch (when ‘count == 1’)...
samba-4.23.4/source3/client/client.c:6095:51: branch_true: ...to here
samba-4.23.4/source3/client/client.c:6089:26: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/client.c:6091:50: acquire_memory: allocated here
samba-4.23.4/source3/client/client.c:6092:36: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/client.c:6094:36: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6094:36: branch_false: following ‘false’ branch (when ‘count != 1’)...
samba-4.23.4/source3/client/client.c:6094:36: branch_false: ...to here
samba-4.23.4/source3/client/client.c:6111:25: danger: ‘<unknown>’ leaks here; was allocated at [(13)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/12)
# 6109|   			break;
# 6110|   		default:
# 6111|-> 			matches[0] = (char *)SMB_MALLOC(samelen+1);
# 6112|   			if (!matches[0])
# 6113|   				goto cleanup;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def598]
samba-4.23.4/source3/client/smbspool.c:241:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(print_file, "rb")’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_resource: opened here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:21: danger: ‘fopen(print_file, "rb")’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  239|   
#  240|   		copies = strtol(print_copies, &endp, 10);
#  241|-> 		if (print_copies == endp) {
#  242|   			perror("ERROR: Unable to determine number of copies");
#  243|   			goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def599]
samba-4.23.4/source3/client/smbspool.c:241:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(print_file, "rb")’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_memory: allocated here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:21: danger: ‘fopen(print_file, "rb")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  239|   
#  240|   		copies = strtol(print_copies, &endp, 10);
#  241|-> 		if (print_copies == endp) {
#  242|   			perror("ERROR: Unable to determine number of copies");
#  243|   			goto done;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def600]
samba-4.23.4/source3/client/smbspool.c:290:20: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_resource: opened here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:20: throw: if ‘strrchr_m’ throws an exception...
samba-4.23.4/source3/client/smbspool.c:290:20: danger: ‘fp’ leaks here; was opened at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  288|            */
#  289|   
#  290|-> 	if ((sep = strrchr_m(uri, '@')) != NULL) {
#  291|   		tmp = uri + 6;
#  292|   		*sep++ = '\0';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def601]
samba-4.23.4/source3/client/smbspool.c:290:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_memory: allocated here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:20: throw: if ‘strrchr_m’ throws an exception...
samba-4.23.4/source3/client/smbspool.c:290:20: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
#  288|            */
#  289|   
#  290|-> 	if ((sep = strrchr_m(uri, '@')) != NULL) {
#  291|   		tmp = uri + 6;
#  292|   		*sep++ = '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def602]
samba-4.23.4/source3/client/smbspool.c:302:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_resource: opened here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:292:18: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:302:29: throw: if ‘strchr_m’ throws an exception...
samba-4.23.4/source3/client/smbspool.c:302:29: danger: ‘fp’ leaks here; was opened at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  300|   	         */
#  301|   
#  302|-> 		if ((tmp2 = strchr_m(tmp, ':')) != NULL) {
#  303|   			*tmp2++ = '\0';
#  304|   			password = uri_unescape_alloc(tmp2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def603]
samba-4.23.4/source3/client/smbspool.c:302:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_memory: allocated here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:292:18: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:302:29: throw: if ‘strchr_m’ throws an exception...
samba-4.23.4/source3/client/smbspool.c:302:29: danger: ‘fp’ leaks here; was allocated at [(7)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/6)
#  300|   	         */
#  301|   
#  302|-> 		if ((tmp2 = strchr_m(tmp, ':')) != NULL) {
#  303|   			*tmp2++ = '\0';
#  304|   			password = uri_unescape_alloc(tmp2);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def604]
samba-4.23.4/source3/client/smbspool.c:893:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/client/smbspool.c:90:1: enter_function: entry to ‘main’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_resource: opened here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:292:18: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:302:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:303:26: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:304:36: call_function: calling ‘uri_unescape_alloc’ from ‘main’
#  891|   	}
#  892|   
#  893|-> 	end = rfc1738_unescape(ret);
#  894|   	if (end == NULL) {
#  895|   		free(ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def605]
samba-4.23.4/source3/client/smbspool.c:893:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/client/smbspool.c:90:1: enter_function: entry to ‘main’
samba-4.23.4/source3/client/smbspool.c:121:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
samba-4.23.4/source3/client/smbspool.c:140:13: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:140:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:157:12: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:229:12: branch_true: following ‘true’ branch (when ‘print_file’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:232:22: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:232:22: acquire_memory: allocated here
samba-4.23.4/source3/client/smbspool.c:233:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:240:26: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:241:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:455:1: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:269:12: branch_false: following ‘false’ branch (when ‘cmp == 0’)...
samba-4.23.4/source3/client/smbspool.c:274:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/client/smbspool.c:281:30: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:290:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:292:18: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:302:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/client/smbspool.c:303:26: branch_true: ...to here
samba-4.23.4/source3/client/smbspool.c:304:36: call_function: calling ‘uri_unescape_alloc’ from ‘main’
#  891|   	}
#  892|   
#  893|-> 	end = rfc1738_unescape(ret);
#  894|   	if (end == NULL) {
#  895|   		free(ret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def606]
samba-4.23.4/source3/client/smbspool.c:893:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
samba-4.23.4/source3/client/smbspool.c:888:15: acquire_memory: allocated here
samba-4.23.4/source3/client/smbspool.c:889:12: branch_false: following ‘false’ branch (when ‘ret’ is non-NULL)...
samba-4.23.4/source3/client/smbspool.c:893:15: branch_false: ...to here
samba-4.23.4/source3/client/smbspool.c:893:15: throw: if ‘rfc1738_unescape’ throws an exception...
samba-4.23.4/source3/client/smbspool.c:893:15: danger: ‘ret’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  891|   	}
#  892|   
#  893|-> 	end = rfc1738_unescape(ret);
#  894|   	if (end == NULL) {
#  895|   		free(ret);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def607]
samba-4.23.4/source3/lib/addrchange.c:55:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
samba-4.23.4/source3/lib/addrchange.c:45:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/addrchange.c:49:16: branch_false: ...to here
samba-4.23.4/source3/lib/addrchange.c:49:16: acquire_resource: socket created here
samba-4.23.4/source3/lib/addrchange.c:50:12: branch_false: following ‘false’ branch (when ‘sock != -1’)...
samba-4.23.4/source3/lib/addrchange.c:55:14: branch_false: ...to here
samba-4.23.4/source3/lib/addrchange.c:55:14: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source3/lib/addrchange.c:55:14: danger: ‘sock’ leaks here
#   53|   	}
#   54|   
#   55|-> 	ok = smb_set_close_on_exec(sock);
#   56|   	if (!ok) {
#   57|   		status = map_nt_error_from_unix(errno);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def608]
samba-4.23.4/source3/lib/adouble.c:2145:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘smb_fname’
samba-4.23.4/source3/lib/adouble.c:2668:17: enter_function: entry to ‘ad_fget’
samba-4.23.4/source3/lib/adouble.c:2671:16: call_function: calling ‘ad_get_internal’ from ‘ad_fget’
# 2143|   	ssize_t  ealen;
# 2144|   	bool     ok;
# 2145|-> 	struct files_struct *fsp = smb_fname->fsp;
# 2146|   
# 2147|   	DEBUG(10, ("reading meta xattr for %s\n", smb_fname->base_name));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def609]
samba-4.23.4/source3/lib/adouble.c:2327:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘smb_fname’
samba-4.23.4/source3/lib/adouble.c:2668:17: enter_function: entry to ‘ad_fget’
samba-4.23.4/source3/lib/adouble.c:2671:16: call_function: calling ‘ad_get_internal’ from ‘ad_fget’
# 2325|   	NTSTATUS status;
# 2326|   
# 2327|-> 	DBG_DEBUG("Path [%s] type [%s]\n", smb_fname->base_name,
# 2328|   		  ad->ad_type == ADOUBLE_META ? "meta" : "rsrc");
# 2329|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def610]
samba-4.23.4/source3/lib/adouble.c:2630:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘smb_fname’
samba-4.23.4/source3/lib/adouble.c:2668:17: enter_function: entry to ‘ad_fget’
samba-4.23.4/source3/lib/adouble.c:2671:16: call_function: calling ‘ad_get_internal’ from ‘ad_fget’
# 2628|   
# 2629|   exit:
# 2630|-> 	DEBUG(10, ("ad_get(%s) for %s returning %d\n",
# 2631|   		  type == ADOUBLE_META ? "meta" : "rsrc",
# 2632|   		  smb_fname->base_name, rc));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def611]
samba-4.23.4/source3/lib/adouble.c:2770:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘smb_fname_in’
samba-4.23.4/source3/lib/adouble.c:2668:17: enter_function: entry to ‘ad_fget’
samba-4.23.4/source3/lib/adouble.c:2671:16: call_function: calling ‘ad_get_internal’ from ‘ad_fget’
# 2768|   	SET_STAT_INVALID(smb_fname->st);
# 2769|   
# 2770|-> 	if (!parent_dirname(smb_fname, smb_fname_in->base_name,
# 2771|   				&parent, &base)) {
# 2772|   		TALLOC_FREE(smb_fname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def612]
samba-4.23.4/source3/lib/adt_tree.c:177:17: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/adt_tree.c:214:6: enter_function: entry to ‘pathtree_add’
samba-4.23.4/source3/lib/adt_tree.c:222:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/adt_tree.c:228:12: branch_false: following ‘false’ branch (when ‘tree’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:235:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:236:17: acquire_memory: allocated here
samba-4.23.4/source3/lib/adt_tree.c:237:12: branch_false: following ‘false’ branch (when ‘path2’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:251:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:257:20: branch_true: following ‘true’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:258:25: branch_true: ...to here
samba-4.23.4/source3/lib/adt_tree.c:262:24: call_function: calling ‘pathtree_find_child’ from ‘pathtree_add’
#  175|   
#  176|   	if ( !node ) {
#  177|-> 		DEBUG(0,("pathtree_find_child: NULL node passed into function!\n"));
#  178|   		return NULL;
#  179|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def613]
samba-4.23.4/source3/lib/adt_tree.c:188:17: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/adt_tree.c:214:6: enter_function: entry to ‘pathtree_add’
samba-4.23.4/source3/lib/adt_tree.c:222:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/adt_tree.c:228:12: branch_false: following ‘false’ branch (when ‘tree’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:235:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:236:17: acquire_memory: allocated here
samba-4.23.4/source3/lib/adt_tree.c:237:12: branch_false: following ‘false’ branch (when ‘path2’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:251:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:257:20: branch_true: following ‘true’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:258:25: branch_true: ...to here
samba-4.23.4/source3/lib/adt_tree.c:262:24: call_function: calling ‘pathtree_find_child’ from ‘pathtree_add’
#  186|   	for ( i=0; i<node->num_children; i++ )
#  187|   	{
#  188|-> 		DEBUG(11,("pathtree_find_child: child key => [%s]\n",
#  189|   			node->children[i]->key));
#  190|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def614]
samba-4.23.4/source3/lib/adt_tree.c:191:26: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/adt_tree.c:214:6: enter_function: entry to ‘pathtree_add’
samba-4.23.4/source3/lib/adt_tree.c:222:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/adt_tree.c:228:12: branch_false: following ‘false’ branch (when ‘tree’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:235:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:236:17: acquire_memory: allocated here
samba-4.23.4/source3/lib/adt_tree.c:237:12: branch_false: following ‘false’ branch (when ‘path2’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:251:9: branch_false: ...to here
samba-4.23.4/source3/lib/adt_tree.c:257:20: branch_true: following ‘true’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/adt_tree.c:258:25: branch_true: ...to here
samba-4.23.4/source3/lib/adt_tree.c:262:24: call_function: calling ‘pathtree_find_child’ from ‘pathtree_add’
#  189|   			node->children[i]->key));
#  190|   
#  191|-> 		result = strcasecmp_m( node->children[i]->key, key );
#  192|   
#  193|   		if ( result == 0 )

Error: GCC_ANALYZER_WARNING (CWE-775): [#def615]
samba-4.23.4/source3/lib/background.c:165:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:164:27: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:165:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:165:17: danger: ‘fds[0]’ leaks here
#  163|   	if (res == -1) {
#  164|   		int err = errno;
#  165|-> 		close(fds[0]);
#  166|   		close(fds[1]);
#  167|   		tevent_req_nterror(req, map_nt_error_from_unix(err));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def616]
samba-4.23.4/source3/lib/background.c:165:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:164:27: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:165:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:165:17: danger: ‘fds[1]’ leaks here
#  163|   	if (res == -1) {
#  164|   		int err = errno;
#  165|-> 		close(fds[0]);
#  166|   		close(fds[1]);
#  167|   		tevent_req_nterror(req, map_nt_error_from_unix(err));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def617]
samba-4.23.4/source3/lib/background.c:166:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:164:27: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:166:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:166:17: danger: ‘fds[1]’ leaks here
#  164|   		int err = errno;
#  165|   		close(fds[0]);
#  166|-> 		close(fds[1]);
#  167|   		tevent_req_nterror(req, map_nt_error_from_unix(err));
#  168|   		return;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def618]
samba-4.23.4/source3/lib/background.c:177:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:177:17: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:177:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:177:17: danger: ‘fds[0]’ leaks here
#  175|   		ssize_t written;
#  176|   
#  177|-> 		close(fds[0]);
#  178|   
#  179|   		status = reinit_after_fork(state->msg, state->ev, true);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def619]
samba-4.23.4/source3/lib/background.c:177:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:177:17: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:177:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:177:17: danger: ‘fds[1]’ leaks here
#  175|   		ssize_t written;
#  176|   
#  177|-> 		close(fds[0]);
#  178|   
#  179|   		status = reinit_after_fork(state->msg, state->ev, true);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def620]
samba-4.23.4/source3/lib/background.c:179:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:177:17: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:179:26: throw: if ‘reinit_after_fork’ throws an exception...
samba-4.23.4/source3/lib/background.c:179:26: danger: ‘fds[1]’ leaks here
#  177|   		close(fds[0]);
#  178|   
#  179|-> 		status = reinit_after_fork(state->msg, state->ev, true);
#  180|   		if (NT_STATUS_IS_OK(status)) {
#  181|   			res = state->fn(state->private_data);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def621]
samba-4.23.4/source3/lib/background.c:181:31: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:177:17: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:180:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:181:31: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:181:31: throw: if the called function throws an exception...
samba-4.23.4/source3/lib/background.c:181:31: danger: ‘fds[1]’ leaks here
#  179|   		status = reinit_after_fork(state->msg, state->ev, true);
#  180|   		if (NT_STATUS_IS_OK(status)) {
#  181|-> 			res = state->fn(state->private_data);
#  182|   		} else {
#  183|   			res = -1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def622]
samba-4.23.4/source3/lib/background.c:185:27: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:177:17: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:185:27: throw: if ‘write’ throws an exception...
samba-4.23.4/source3/lib/background.c:185:27: danger: ‘fds[1]’ leaks here
#  183|   			res = -1;
#  184|   		}
#  185|-> 		written = write(fds[1], &res, sizeof(res));
#  186|   		if (written == -1) {
#  187|   			_exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def623]
samba-4.23.4/source3/lib/background.c:206:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:206:9: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:206:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:206:9: danger: ‘fds[0]’ leaks here
#  204|   	/* parent */
#  205|   
#  206|-> 	close(fds[1]);
#  207|   	state->pipe_fd = fds[0];
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def624]
samba-4.23.4/source3/lib/background.c:206:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/lib/background.c:151:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/background.c:156:15: branch_true: ...to here
samba-4.23.4/source3/lib/background.c:157:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:162:15: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:163:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:171:12: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:171:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/background.c:206:9: branch_false: ...to here
samba-4.23.4/source3/lib/background.c:206:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/background.c:206:9: danger: ‘fds[1]’ leaks here
#  204|   	/* parent */
#  205|   
#  206|-> 	close(fds[1]);
#  207|   	state->pipe_fd = fds[0];
#  208|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def625]
samba-4.23.4/source3/lib/charcnv.c:64:22: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpbuf’
samba-4.23.4/source3/lib/charcnv.c:55:12: branch_false: following ‘false’ branch (when ‘dest_len != 18446744073709551615’)...
samba-4.23.4/source3/lib/charcnv.c:59:13: branch_false: ...to here
samba-4.23.4/source3/lib/charcnv.c:59:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/charcnv.c:60:26: branch_true: ...to here
samba-4.23.4/source3/lib/charcnv.c:60:26: acquire_memory: allocated here
samba-4.23.4/source3/lib/charcnv.c:61:20: branch_false: following ‘false’ branch (when ‘tmpbuf’ is non-NULL)...
samba-4.23.4/source3/lib/charcnv.c:64:22: branch_false: ...to here
samba-4.23.4/source3/lib/charcnv.c:64:22: throw: if ‘strupper_m’ throws an exception...
samba-4.23.4/source3/lib/charcnv.c:64:22: danger: ‘tmpbuf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   62|   			smb_panic("malloc fail");
#   63|   		}
#   64|-> 		if (!strupper_m(tmpbuf)) {
#   65|   			if ((flags & (STR_TERMINATE|STR_TERMINATE_ASCII)) &&
#   66|   					dest &&

Error: GCC_ANALYZER_WARNING (CWE-775): [#def626]
samba-4.23.4/source3/lib/ctdbd_conn.c:398:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/source3/lib/ctdbd_conn.c:387:14: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/ctdbd_conn.c:388:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:394:19: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:397:12: branch_true: following ‘true’ branch (when ‘namelen > 107’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:398:17: branch_true: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:398:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/ctdbd_conn.c:398:17: danger: ‘fd’ leaks here
#  396|   			  sizeof(addr.u.un.sun_path));
#  397|   	if (namelen >= sizeof(addr.u.un.sun_path)) {
#  398|-> 		DEBUG(3, ("%s: Socket name too long: %s\n", __func__,
#  399|   			  sockname));
#  400|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def627]
samba-4.23.4/source3/lib/ctdbd_conn.c:400:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/source3/lib/ctdbd_conn.c:387:14: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/ctdbd_conn.c:388:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:394:19: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:397:12: branch_true: following ‘true’ branch (when ‘namelen > 107’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:398:17: branch_true: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:400:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/ctdbd_conn.c:400:17: danger: ‘fd’ leaks here
#  398|   		DEBUG(3, ("%s: Socket name too long: %s\n", __func__,
#  399|   			  sockname));
#  400|-> 		close(fd);
#  401|   		return ENAMETOOLONG;
#  402|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def628]
samba-4.23.4/source3/lib/ctdbd_conn.c:404:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/source3/lib/ctdbd_conn.c:387:14: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/ctdbd_conn.c:388:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:394:19: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:397:12: branch_false: following ‘false’ branch (when ‘namelen <= 107’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:404:15: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:404:15: throw: if ‘connect’ throws an exception...
samba-4.23.4/source3/lib/ctdbd_conn.c:404:15: danger: ‘fd’ leaks here
#  402|   	}
#  403|   
#  404|-> 	ret = connect(fd, &addr.u.sa, addr.sa_socklen);
#  405|   	if (ret == -1) {
#  406|   		int err = errno;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def629]
samba-4.23.4/source3/lib/ctdbd_conn.c:2107:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘state’
samba-4.23.4/source3/lib/ctdbd_conn.c:2080:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/ctdbd_conn.c:2081:9: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:2085:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/ctdbd_conn.c:2089:9: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:2093:19: branch_false: following ‘false’ branch (when ‘i >= num_pending’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:2101:12: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:2101:12: branch_false: following ‘false’ branch (when ‘i != num_pending’)...
samba-4.23.4/source3/lib/ctdbd_conn.c:2107:24: branch_false: ...to here
samba-4.23.4/source3/lib/ctdbd_conn.c:2107:9: danger: dereference of NULL ‘state’
# 2105|   	}
# 2106|   
# 2107|-> 	state->reply = talloc_move(state, &hdr);
# 2108|   	tevent_req_defer_callback(req, state->ev);
# 2109|   	tevent_req_done(req);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def630]
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:334:17: warning[-Wanalyzer-null-argument]: use of NULL ‘value.dptr’ where non-null expected
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:319:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:320:41: branch_false: ...to here
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:325:17: release_memory: ‘value.dptr’ is NULL
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:329:12: branch_true: following ‘true’ branch (when ‘copy_size != 0’)...
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:334:41: branch_true: ...to here
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:334:41: release_memory: ‘value.dptr’ is NULL
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:334:17: danger: argument 2 (‘value.dptr’) NULL where non-null expected
#  332|   		 * as much as we can.
#  333|   		 */
#  334|-> 		memcpy(rec->value.dptr, value.dptr, copy_size);
#  335|   		state->dbufs[state->num_dbufs++] = rec->value;
#  336|   		value.dsize -= copy_size;

Error: CPPCHECK_WARNING (CWE-457): [#def631]
samba-4.23.4/source3/lib/dbwrap/dbwrap_watch.c:564: error[uninitvar]: Uninitialized variable: instance_buf
#  562|   		watcher->pid,
#  563|   		MSG_DBWRAP_MODIFIED,
#  564|-> 		instance_buf,
#  565|   		sizeof(instance_buf));
#  566|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def632]
samba-4.23.4/source3/lib/interface.c:475:13: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr_cpy’
samba-4.23.4/source3/lib/interface.c:665:6: enter_function: entry to ‘load_interfaces’
samba-4.23.4/source3/lib/interface.c:684:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/interface.c:688:12: branch_false: ...to here
samba-4.23.4/source3/lib/interface.c:688:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/interface.c:703:24: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/interface.c:704:41: branch_true: ...to here
samba-4.23.4/source3/lib/interface.c:704:41: acquire_memory: allocated here
samba-4.23.4/source3/lib/interface.c:705:28: branch_true: following ‘true’ branch (when ‘ptr_cpy’ is non-NULL)...
samba-4.23.4/source3/lib/interface.c:706:33: branch_true: ...to here
samba-4.23.4/source3/lib/interface.c:706:33: call_function: calling ‘interpret_interface’ from ‘load_interfaces’
#  473|   	 * extract speed / capability information if present
#  474|   	 */
#  475|-> 	p = strchr_m(token, ';');
#  476|   	if (p != NULL) {
#  477|   		*p++ = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def633]
samba-4.23.4/source3/lib/interface.c:495:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr_cpy’
samba-4.23.4/source3/lib/interface.c:665:6: enter_function: entry to ‘load_interfaces’
samba-4.23.4/source3/lib/interface.c:688:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/interface.c:703:24: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/interface.c:704:41: branch_true: ...to here
samba-4.23.4/source3/lib/interface.c:704:41: acquire_memory: allocated here
samba-4.23.4/source3/lib/interface.c:705:28: branch_true: following ‘true’ branch (when ‘ptr_cpy’ is non-NULL)...
samba-4.23.4/source3/lib/interface.c:706:33: branch_true: ...to here
samba-4.23.4/source3/lib/interface.c:706:33: call_function: calling ‘interpret_interface’ from ‘load_interfaces’
#  493|   	/* first check if it is an interface name */
#  494|   	for (i=0;i<total_probed;i++) {
#  495|-> 		if (gen_fnmatch(token, probed_ifaces[i].name) == 0) {
#  496|   			if (speed_set) {
#  497|   				probed_ifaces[i].linkspeed = speed;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def634]
samba-4.23.4/source3/lib/ldap_escape.c:135:26: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/source3/lib/ldap_escape.c:100:26: acquire_memory: allocated here
samba-4.23.4/source3/lib/ldap_escape.c:102:12: branch_false: following ‘false’ branch (when ‘output’ is non-NULL)...
samba-4.23.4/source3/lib/ldap_escape.c:102:12: branch_false: ...to here
samba-4.23.4/source3/lib/ldap_escape.c:108:16: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/ldap_escape.c:132:9: branch_false: ...to here
samba-4.23.4/source3/lib/ldap_escape.c:135:26: throw: if ‘Realloc’ throws an exception...
samba-4.23.4/source3/lib/ldap_escape.c:135:26: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  133|   
#  134|   	/* resize the string to the actual final size */
#  135|-> 	output = (char *)SMB_REALLOC(output, strlen(output) + 1);
#  136|   	return output;
#  137|   }

Error: CPPCHECK_WARNING (CWE-457): [#def635]
samba-4.23.4/source3/lib/messages.c:1396: warning[uninitvar]: Uninitialized variable: fds
# 1394|   		ret = messaging_post_self(
# 1395|   			msg_ctx, rec->src, rec->dest, rec->msg_type,
# 1396|-> 			&iov, 1, fds, rec->num_fds);
# 1397|   		if (ret == 0) {
# 1398|   			return;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def636]
samba-4.23.4/source3/lib/ms_fnmatch.c:67:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘max_n’
samba-4.23.4/source3/lib/ms_fnmatch.c:148:5: enter_function: entry to ‘ms_fnmatch’
samba-4.23.4/source3/lib/ms_fnmatch.c:164:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:174:14: branch_false: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:174:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:178:14: branch_true: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:178:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:183:12: branch_true: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:207:12: branch_false: following ‘false’ branch (when ‘count == 0’)...
samba-4.23.4/source3/lib/ms_fnmatch.c:226:44: branch_false: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:226:15: call_function: calling ‘ms_fnmatch_core’ from ‘ms_fnmatch’
#   65|   			/* a '*' matches zero or more characters of any type */
#   66|   		case UCS2_CHAR('*'):
#   67|-> 			if (max_n->predot && max_n->predot <= n) {
#   68|   				return null_match(p);
#   69|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def637]
samba-4.23.4/source3/lib/ms_fnmatch.c:82:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘max_n’
samba-4.23.4/source3/lib/ms_fnmatch.c:148:5: enter_function: entry to ‘ms_fnmatch’
samba-4.23.4/source3/lib/ms_fnmatch.c:164:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:174:14: branch_false: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:174:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:178:14: branch_true: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:178:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/ms_fnmatch.c:183:12: branch_true: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:207:12: branch_false: following ‘false’ branch (when ‘count == 0’)...
samba-4.23.4/source3/lib/ms_fnmatch.c:226:44: branch_false: ...to here
samba-4.23.4/source3/lib/ms_fnmatch.c:226:15: call_function: calling ‘ms_fnmatch_core’ from ‘ms_fnmatch’
#   80|   			   '.' in the string. */
#   81|   		case UCS2_CHAR('<'):
#   82|-> 			if (max_n->predot && max_n->predot <= n) {
#   83|   				return null_match(p);
#   84|   			}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def638]
samba-4.23.4/source3/lib/netapi/group.c:101:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info0’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:101:25: danger: dereference of NULL ‘info0’
#   99|   	switch (r->in.level) {
#  100|   		case 0:
#  101|-> 			init_lsa_String(&lsa_group_name, info0->grpi0_name);
#  102|   			break;
#  103|   		case 1:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def639]
samba-4.23.4/source3/lib/netapi/group.c:104:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info1’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:104:25: danger: dereference of NULL ‘info1’
#  102|   			break;
#  103|   		case 1:
#  104|-> 			init_lsa_String(&lsa_group_name, info1->grpi1_name);
#  105|   			break;
#  106|   		case 2:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def640]
samba-4.23.4/source3/lib/netapi/group.c:107:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info2’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:107:25: danger: dereference of NULL ‘info2’
#  105|   			break;
#  106|   		case 2:
#  107|-> 			init_lsa_String(&lsa_group_name, info2->grpi2_name);
#  108|   			break;
#  109|   		case 3:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def641]
samba-4.23.4/source3/lib/netapi/group.c:110:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info3’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:110:25: danger: dereference of NULL ‘info3’
#  108|   			break;
#  109|   		case 3:
#  110|-> 			init_lsa_String(&lsa_group_name, info3->grpi3_name);
#  111|   			break;
#  112|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def642]
samba-4.23.4/source3/lib/netapi/group.c:130:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info1’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:128:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:130:29: danger: dereference of NULL ‘info1’
#  128|   	switch (r->in.level) {
#  129|   		case 1:
#  130|-> 			if (info1->grpi1_comment) {
#  131|   				init_lsa_String(&info.description,
#  132|   						info1->grpi1_comment);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def643]
samba-4.23.4/source3/lib/netapi/group.c:142:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info2’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:128:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:142:29: danger: dereference of NULL ‘info2’
#  140|   			break;
#  141|   		case 2:
#  142|-> 			if (info2->grpi2_comment) {
#  143|   				init_lsa_String(&info.description,
#  144|   						info2->grpi2_comment);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def644]
samba-4.23.4/source3/lib/netapi/group.c:169:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info3’
samba-4.23.4/source3/lib/netapi/group.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:60:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:81:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:85:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:95:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:99:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:128:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:169:29: danger: dereference of NULL ‘info3’
#  167|   			break;
#  168|   		case 3:
#  169|-> 			if (info3->grpi3_comment) {
#  170|   				init_lsa_String(&info.description,
#  171|   						info3->grpi3_comment);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def645]
samba-4.23.4/source3/lib/netapi/group.c:1717:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘i0’
samba-4.23.4/source3/lib/netapi/group.c:1620:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1624:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1624:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1632:16: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1635:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:1639:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1648:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:1652:9: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1661:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1665:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1665:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1669:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1669:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1680:40: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1688:18: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1693:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1698:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1708:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1708:12: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1713:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1715:25: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1717:33: danger: dereference of NULL ‘i0’
# 1715|   		switch (r->in.level) {
# 1716|   			case 0:
# 1717|-> 				init_lsa_String(&lsa_names[i], i0->grui0_name);
# 1718|   				i0++;
# 1719|   				break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def646]
samba-4.23.4/source3/lib/netapi/group.c:1721:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘i1’
samba-4.23.4/source3/lib/netapi/group.c:1620:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1624:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1624:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1632:16: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1635:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:1639:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1648:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/group.c:1652:9: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1661:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1665:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1665:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1669:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1669:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1680:40: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1688:18: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1693:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1698:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1708:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1708:12: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1713:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/group.c:1715:25: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/group.c:1721:33: danger: dereference of NULL ‘i1’
# 1719|   				break;
# 1720|   			case 1:
# 1721|-> 				init_lsa_String(&lsa_names[i], i1->grui1_name);
# 1722|   				i1++;
# 1723|   				break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def647]
samba-4.23.4/source3/lib/netapi/localgroup.c:1117:34: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘info3’
samba-4.23.4/source3/lib/netapi/localgroup.c:1377:8: enter_function: entry to ‘NetLocalGroupSetMembers_r’
samba-4.23.4/source3/lib/netapi/localgroup.c:1380:16: call_function: calling ‘NetLocalGroupModifyMembers_r’ from ‘NetLocalGroupSetMembers_r’
# 1115|   
# 1116|   		for (i=0; i < r->in.total_entries; i++) {
# 1117|-> 			status = libnetapi_lsa_lookup_names3(ctx, lsa_pipe,
# 1118|   							     info3[i].lgrmi3_domainandname,
# 1119|   							     &member_sids[i]);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def648]
samba-4.23.4/source3/lib/netapi/netapi.c:469:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/netapi/netapi.c:466:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/netapi.c:468:9: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/netapi.c:468:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/netapi/netapi.c:469:29: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/lib/netapi/netapi.c:469:29: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  467|   
#  468|   	va_start(args, format);
#  469|-> 	ctx->error_string = talloc_vasprintf(ctx, format, args);
#  470|   	va_end(args);
#  471|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def649]
samba-4.23.4/source3/lib/netapi/user.c:3209:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘i0’
samba-4.23.4/source3/lib/netapi/user.c:3125:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3129:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3129:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3137:16: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3140:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/user.c:3144:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3153:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/user.c:3157:9: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3166:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3170:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3170:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3174:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3182:39: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3185:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3190:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3200:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3200:12: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3205:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3207:25: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3209:33: danger: dereference of NULL ‘i0’
# 3207|   		switch (r->in.level) {
# 3208|   			case 0:
# 3209|-> 				init_lsa_String(&lsa_names[i], i0->grui0_name);
# 3210|   				i0++;
# 3211|   				break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def650]
samba-4.23.4/source3/lib/netapi/user.c:3213:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘i1’
samba-4.23.4/source3/lib/netapi/user.c:3125:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3129:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3129:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3137:16: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3140:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/user.c:3144:21: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3153:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/lib/netapi/user.c:3157:9: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3166:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3170:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3170:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3174:13: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3182:39: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3185:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3190:17: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3200:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3200:12: branch_false: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3205:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/netapi/user.c:3207:25: branch_true: ...to here
samba-4.23.4/source3/lib/netapi/user.c:3213:33: danger: dereference of NULL ‘i1’
# 3211|   				break;
# 3212|   			case 1:
# 3213|-> 				init_lsa_String(&lsa_names[i], i1->grui1_name);
# 3214|   				i1++;
# 3215|   				break;

Error: CPPCHECK_WARNING (CWE-476): [#def651]
samba-4.23.4/source3/lib/smbldap.c:363: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mods
#  361|   			/* notreached. */
#  362|   		}
#  363|-> 		mods[0] = NULL;
#  364|   	}
#  365|   

Error: CPPCHECK_WARNING (CWE-476): [#def652]
samba-4.23.4/source3/lib/smbldap.c:366: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: mods
#  364|   	}
#  365|   
#  366|-> 	for (i = 0; mods[i] != NULL; ++i) {
#  367|   		if (mods[i]->mod_op == modop && strequal(mods[i]->mod_type, attribute))
#  368|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def653]
samba-4.23.4/source3/lib/smbldap.c:372:24: warning[-Wanalyzer-malloc-leak]: leak of ‘mods’
samba-4.23.4/source3/lib/smbldap.c:347:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbldap.c:357:12: branch_true: following ‘true’ branch (when ‘mods’ is NULL)...
samba-4.23.4/source3/lib/smbldap.c:358:24: branch_true: ...to here
samba-4.23.4/source3/lib/smbldap.c:358:24: acquire_memory: allocated here
samba-4.23.4/source3/lib/smbldap.c:359:20: branch_false: following ‘false’ branch (when ‘mods’ is non-NULL)...
samba-4.23.4/source3/lib/smbldap.c:363:17: branch_false: ...to here
samba-4.23.4/source3/lib/smbldap.c:366:21: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbldap.c:371:13: branch_false: ...to here
samba-4.23.4/source3/lib/smbldap.c:371:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/smbldap.c:372:24: branch_true: ...to here
samba-4.23.4/source3/lib/smbldap.c:372:24: throw: if ‘realloc_array’ throws an exception...
samba-4.23.4/source3/lib/smbldap.c:372:24: danger: ‘mods’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  370|   
#  371|   	if (mods[i] == NULL) {
#  372|-> 		mods = SMB_REALLOC_ARRAY (mods, LDAPMod *, i + 2);
#  373|   		if (mods == NULL) {
#  374|   			smb_panic("smbldap_set_mod: out of memory!");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def654]
samba-4.23.4/source3/lib/smbrun.c:253:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:253:24: danger: ‘ifd[0]’ leaks here
#  251|   	/* build up an input pipe */
#  252|   	if(pipe(ifd)) {
#  253|-> 		return -1;
#  254|   	}
#  255|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def655]
samba-4.23.4/source3/lib/smbrun.c:253:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:253:24: danger: ‘ifd[1]’ leaks here
#  251|   	/* build up an input pipe */
#  252|   	if(pipe(ifd)) {
#  253|-> 		return -1;
#  254|   	}
#  255|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def656]
samba-4.23.4/source3/lib/smbrun.c:264:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:264:25: throw: if ‘CatchChildLeaveStatus’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:264:25: danger: ‘ifd[0]’ leaks here
#  262|   	 */
#  263|   
#  264|-> 	saved_handler = CatchChildLeaveStatus();
#  265|                                      	
#  266|   	if ((pid=fork()) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def657]
samba-4.23.4/source3/lib/smbrun.c:264:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:264:25: throw: if ‘CatchChildLeaveStatus’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:264:25: danger: ‘ifd[1]’ leaks here
#  262|   	 */
#  263|   
#  264|-> 	saved_handler = CatchChildLeaveStatus();
#  265|                                      	
#  266|   	if ((pid=fork()) < 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def658]
samba-4.23.4/source3/lib/smbrun.c:267:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:267:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:267:17: danger: ‘ifd[0]’ leaks here
#  265|                                      	
#  266|   	if ((pid=fork()) < 0) {
#  267|-> 		DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
#  268|   		(void)CatchSignal(SIGCLD, saved_handler);
#  269|   		return errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def659]
samba-4.23.4/source3/lib/smbrun.c:267:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:267:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:267:17: danger: ‘ifd[1]’ leaks here
#  265|                                      	
#  266|   	if ((pid=fork()) < 0) {
#  267|-> 		DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
#  268|   		(void)CatchSignal(SIGCLD, saved_handler);
#  269|   		return errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def660]
samba-4.23.4/source3/lib/smbrun.c:268:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:268:23: throw: if ‘CatchSignal’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:268:23: danger: ‘ifd[0]’ leaks here
#  266|   	if ((pid=fork()) < 0) {
#  267|   		DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
#  268|-> 		(void)CatchSignal(SIGCLD, saved_handler);
#  269|   		return errno;
#  270|       	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def661]
samba-4.23.4/source3/lib/smbrun.c:268:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_true: following ‘true’ branch (when ‘pid < 0’)...
samba-4.23.4/source3/lib/smbrun.c:267:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:268:23: throw: if ‘CatchSignal’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:268:23: danger: ‘ifd[1]’ leaks here
#  266|   	if ((pid=fork()) < 0) {
#  267|   		DEBUG(0, ("smbrunsecret: fork failed with error %s\n", strerror(errno)));
#  268|-> 		(void)CatchSignal(SIGCLD, saved_handler);
#  269|   		return errno;
#  270|       	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def662]
samba-4.23.4/source3/lib/smbrun.c:281:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/lib/smbrun.c:276:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:281:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:281:17: danger: ‘ifd[1]’ leaks here
#  279|   		ssize_t wrote;
#  280|   		
#  281|-> 		close(ifd[0]);
#  282|   		/* send the secret */
#  283|   		towrite = strlen(secret);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def663]
samba-4.23.4/source3/lib/smbrun.c:281:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[status]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/lib/smbrun.c:276:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:281:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:281:17: danger: ‘ifd[status]’ leaks here
#  279|   		ssize_t wrote;
#  280|   		
#  281|-> 		close(ifd[0]);
#  282|   		/* send the secret */
#  283|   		towrite = strlen(secret);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def664]
samba-4.23.4/source3/lib/smbrun.c:284:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/lib/smbrun.c:276:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:284:25: throw: if ‘write’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:284:25: danger: ‘ifd[1]’ leaks here
#  282|   		/* send the secret */
#  283|   		towrite = strlen(secret);
#  284|-> 		wrote = write(ifd[1], secret, towrite);
#  285|   		if ( wrote != towrite ) {
#  286|   		    DEBUG(0,("smbrunsecret: wrote %ld of %lu bytes\n",(long)wrote,(unsigned long)towrite));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def665]
samba-4.23.4/source3/lib/smbrun.c:286:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/lib/smbrun.c:276:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:285:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/smbrun.c:286:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:286:21: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:286:21: danger: ‘ifd[1]’ leaks here
#  284|   		wrote = write(ifd[1], secret, towrite);
#  285|   		if ( wrote != towrite ) {
#  286|-> 		    DEBUG(0,("smbrunsecret: wrote %ld of %lu bytes\n",(long)wrote,(unsigned long)towrite));
#  287|   		}
#  288|   		fsync(ifd[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def666]
samba-4.23.4/source3/lib/smbrun.c:288:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/lib/smbrun.c:276:21: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:288:17: throw: if ‘fsync’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:288:17: danger: ‘ifd[1]’ leaks here
#  286|   		    DEBUG(0,("smbrunsecret: wrote %ld of %lu bytes\n",(long)wrote,(unsigned long)towrite));
#  287|   		}
#  288|-> 		fsync(ifd[1]);
#  289|   		close(ifd[1]);
#  290|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def667]
samba-4.23.4/source3/lib/smbrun.c:316:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:316:15: throw: if ‘CatchChild’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:316:15: danger: ‘ifd[0]’ leaks here
#  314|   	}
#  315|   	
#  316|-> 	(void)CatchChild();
#  317|   	
#  318|   	/* we are in the child. we exec /bin/sh to do the work for us. we

Error: GCC_ANALYZER_WARNING (CWE-775): [#def668]
samba-4.23.4/source3/lib/smbrun.c:316:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:316:15: throw: if ‘CatchChild’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:316:15: danger: ‘ifd[1]’ leaks here
#  314|   	}
#  315|   	
#  316|-> 	(void)CatchChild();
#  317|   	
#  318|   	/* we are in the child. we exec /bin/sh to do the work for us. we

Error: GCC_ANALYZER_WARNING (CWE-775): [#def669]
samba-4.23.4/source3/lib/smbrun.c:322:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:322:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:322:9: danger: ‘ifd[0]’ leaks here
#  320|   	   pipeline or anything else the config file specifies */
#  321|   	
#  322|-> 	close(ifd[1]);
#  323|   	close(0);
#  324|   	if (dup2(ifd[0], 0) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def670]
samba-4.23.4/source3/lib/smbrun.c:322:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[1]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:322:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:322:9: danger: ‘ifd[1]’ leaks here
#  320|   	   pipeline or anything else the config file specifies */
#  321|   	
#  322|-> 	close(ifd[1]);
#  323|   	close(0);
#  324|   	if (dup2(ifd[0], 0) != 0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def671]
samba-4.23.4/source3/lib/smbrun.c:323:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:323:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:323:9: danger: ‘ifd[0]’ leaks here
#  321|   	
#  322|   	close(ifd[1]);
#  323|-> 	close(0);
#  324|   	if (dup2(ifd[0], 0) != 0) {
#  325|   		DEBUG(2,("Failed to create stdin file descriptor\n"));

Error: GCC_ANALYZER_WARNING: [#def672]
samba-4.23.4/source3/lib/smbrun.c:324:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘0’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:323:9: release_resource: closed here
samba-4.23.4/source3/lib/smbrun.c:324:13: danger: ‘0’ could be invalid
#  322|   	close(ifd[1]);
#  323|   	close(0);
#  324|-> 	if (dup2(ifd[0], 0) != 0) {
#  325|   		DEBUG(2,("Failed to create stdin file descriptor\n"));
#  326|   		close(ifd[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def673]
samba-4.23.4/source3/lib/smbrun.c:325:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:324:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/smbrun.c:325:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:325:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:325:17: danger: ‘ifd[0]’ leaks here
#  323|   	close(0);
#  324|   	if (dup2(ifd[0], 0) != 0) {
#  325|-> 		DEBUG(2,("Failed to create stdin file descriptor\n"));
#  326|   		close(ifd[0]);
#  327|   		exit(80);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def674]
samba-4.23.4/source3/lib/smbrun.c:326:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:324:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/smbrun.c:325:17: branch_true: ...to here
samba-4.23.4/source3/lib/smbrun.c:325:17: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:326:17: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:326:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:326:17: danger: ‘ifd[0]’ leaks here
#  324|   	if (dup2(ifd[0], 0) != 0) {
#  325|   		DEBUG(2,("Failed to create stdin file descriptor\n"));
#  326|-> 		close(ifd[0]);
#  327|   		exit(80);
#  328|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def675]
samba-4.23.4/source3/lib/smbrun.c:333:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:324:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:333:9: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:333:9: throw: if ‘become_user_permanently’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:333:9: danger: ‘ifd[0]’ leaks here
#  331|   	   way of doing it, but it does work on all systems that I know of */
#  332|   
#  333|-> 	become_user_permanently(uid, gid);
#  334|   
#  335|   	if (!non_root_mode()) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def676]
samba-4.23.4/source3/lib/smbrun.c:335:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ifd[0]’
samba-4.23.4/source3/lib/smbrun.c:252:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:264:25: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:266:12: branch_false: following ‘false’ branch (when ‘pid >= 0’)...
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:272:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/lib/smbrun.c:316:15: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:324:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/smbrun.c:333:9: branch_false: ...to here
samba-4.23.4/source3/lib/smbrun.c:335:14: throw: if ‘non_root_mode’ throws an exception...
samba-4.23.4/source3/lib/smbrun.c:335:14: danger: ‘ifd[0]’ leaks here
#  333|   	become_user_permanently(uid, gid);
#  334|   
#  335|-> 	if (!non_root_mode()) {
#  336|   		if (getuid() != uid || geteuid() != uid ||
#  337|   		    getgid() != gid || getegid() != gid) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def677]
samba-4.23.4/source3/lib/sysacls.c:187:38: warning[-Wanalyzer-malloc-leak]: leak of ‘text’
samba-4.23.4/source3/lib/sysacls.c:159:29: acquire_memory: allocated here
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: following ‘false’ branch (when ‘text’ is non-NULL)...
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: ...to here
samba-4.23.4/source3/lib/sysacls.c:164:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:165:45: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:187:38: throw: if ‘uidtoname’ throws an exception...
samba-4.23.4/source3/lib/sysacls.c:187:38: danger: ‘text’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  185|   
#  186|   			case SMB_ACL_USER:
#  187|-> 				id = uidtoname(ap->info.user.uid);
#  188|   
#  189|   				FALL_THROUGH;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def678]
samba-4.23.4/source3/lib/sysacls.c:195:43: warning[-Wanalyzer-malloc-leak]: leak of ‘text’
samba-4.23.4/source3/lib/sysacls.c:159:29: acquire_memory: allocated here
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: following ‘false’ branch (when ‘text’ is non-NULL)...
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: ...to here
samba-4.23.4/source3/lib/sysacls.c:164:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:165:45: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:195:43: throw: if ‘getgrgid’ throws an exception...
samba-4.23.4/source3/lib/sysacls.c:195:43: danger: ‘text’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  193|   
#  194|   			case SMB_ACL_GROUP:
#  195|-> 				if ((gr = getgrgid(ap->info.group.gid)) == NULL) {
#  196|   					slprintf(idbuf, sizeof(idbuf)-1, "%ld",
#  197|   						(long)ap->info.group.gid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def679]
samba-4.23.4/source3/lib/sysacls.c:234:45: warning[-Wanalyzer-malloc-leak]: leak of ‘text’
samba-4.23.4/source3/lib/sysacls.c:159:29: acquire_memory: allocated here
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: following ‘false’ branch (when ‘text’ is non-NULL)...
samba-4.23.4/source3/lib/sysacls.c:159:12: branch_false: ...to here
samba-4.23.4/source3/lib/sysacls.c:164:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:165:45: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:218:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:218:17: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:219:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:219:17: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:220:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:220:17: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:232:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/sysacls.c:233:50: branch_true: ...to here
samba-4.23.4/source3/lib/sysacls.c:234:45: throw: if ‘Realloc’ throws an exception...
samba-4.23.4/source3/lib/sysacls.c:234:45: danger: ‘text’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  232|   		if ((len + nbytes) > maxlen) {
#  233|   			maxlen += nbytes + 20 * (acl_d->count - i);
#  234|-> 			if ((text = (char *)SMB_REALLOC(text, maxlen)) == NULL) {
#  235|   				errno = ENOMEM;
#  236|   				return NULL;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def680]
samba-4.23.4/source3/lib/tldap.c:162:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/tldap.c:2530:20: enter_function: entry to ‘tldap_delete_send’
samba-4.23.4/source3/lib/tldap.c:2542:15: call_function: calling ‘tldap_req_create’ from ‘tldap_delete_send’
samba-4.23.4/source3/lib/tldap.c:2542:15: return_function: returning to ‘tldap_delete_send’ from ‘tldap_req_create’
samba-4.23.4/source3/lib/tldap.c:2543:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/tldap.c:2547:33: branch_false: ...to here
samba-4.23.4/source3/lib/tldap.c:2547:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/tldap.c:2548:41: branch_true: ...to here
samba-4.23.4/source3/lib/tldap.c:2548:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/tldap.c:2549:14: branch_true: ...to here
samba-4.23.4/source3/lib/tldap.c:2549:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/tldap.c:2551:18: branch_true: ...to here
samba-4.23.4/source3/lib/tldap.c:2551:18: call_function: calling ‘tldap_msg_send’ from ‘tldap_delete_send’
#  160|   	}
#  161|   	va_start(ap, fmt);
#  162|-> 	ld->log_fn(ld->log_private, level, fmt, ap);
#  163|   	va_end(ap);
#  164|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def681]
samba-4.23.4/source3/lib/tldap_util.c:325:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/tldap_util.c:324:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/tldap_util.c:325:18: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/lib/tldap_util.c:325:18: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  323|   
#  324|   	va_start(ap, fmt);
#  325|-> 	newval = talloc_vasprintf(frame, fmt, ap);
#  326|   	va_end(ap);
#  327|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def682]
samba-4.23.4/source3/lib/tldap_util.c:363:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/tldap_util.c:382:9: enter_function: entry to ‘tldap_search_fmt’
samba-4.23.4/source3/lib/tldap_util.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/tldap_util.c:391:14: call_function: calling ‘tldap_search_va’ from ‘tldap_search_fmt’
#  361|   			const char *fmt, va_list ap)
#  362|   {
#  363|-> 	TALLOC_CTX *frame = talloc_stackframe();
#  364|   	char *filter;
#  365|   	TLDAPRC rc;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def683]
samba-4.23.4/source3/lib/tldap_util.c:367:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/tldap_util.c:382:9: enter_function: entry to ‘tldap_search_fmt’
samba-4.23.4/source3/lib/tldap_util.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/tldap_util.c:391:14: call_function: calling ‘tldap_search_va’ from ‘tldap_search_fmt’
#  365|   	TLDAPRC rc;
#  366|   
#  367|-> 	filter = talloc_vasprintf(frame, fmt, ap);
#  368|   	if (filter == NULL) {
#  369|   		TALLOC_FREE(frame);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def684]
samba-4.23.4/source3/lib/util_sd.c:181:29: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  179|   	struct policy_handle handle;
#  180|   	NTSTATUS status;
#  181|-> 	TALLOC_CTX *frame = talloc_stackframe();
#  182|   	struct dom_sid *sids;
#  183|   	enum lsa_SidType *types;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def685]
samba-4.23.4/source3/lib/util_sd.c:185:13: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  183|   	enum lsa_SidType *types;
#  184|   
#  185|-> 	if (cli_state_has_tcon(cli)) {
#  186|   		cli_state_save_tcon_share(cli, &orig_tcon, &orig_share);
#  187|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def686]
samba-4.23.4/source3/lib/util_sd.c:186:17: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  184|   
#  185|   	if (cli_state_has_tcon(cli)) {
#  186|-> 		cli_state_save_tcon_share(cli, &orig_tcon, &orig_share);
#  187|   	}
#  188|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def687]
samba-4.23.4/source3/lib/util_sd.c:189:18: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  187|   	}
#  188|   
#  189|-> 	status = cli_tree_connect(cli, "IPC$", "?????", NULL);
#  190|   	if (!NT_STATUS_IS_OK(status)) {
#  191|   		goto tcon_fail;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def688]
samba-4.23.4/source3/lib/util_sd.c:194:18: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  192|   	}
#  193|   
#  194|-> 	status = cli_rpc_pipe_open_noauth(cli, &ndr_table_lsarpc,
#  195|   					  &p);
#  196|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def689]
samba-4.23.4/source3/lib/util_sd.c:200:18: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  198|   	}
#  199|   
#  200|-> 	status = rpccli_lsa_open_policy(p, talloc_tos(), True,
#  201|   					GENERIC_EXECUTE_ACCESS, &handle);
#  202|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def690]
samba-4.23.4/source3/lib/util_sd.c:230:13: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:387:6: enter_function: entry to ‘parse_ace’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:409:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sd.c:415:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:418:14: call_function: calling ‘StringToSid’ from ‘parse_ace’
#  228|   	enum lsa_SidType type;
#  229|   
#  230|-> 	if (string_to_sid(sid, str)) {
#  231|   		return true;
#  232|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def691]
samba-4.23.4/source3/lib/util_sd.c:400:29: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:400:29: throw: if ‘_talloc_stackframe’ throws an exception...
samba-4.23.4/source3/lib/util_sd.c:400:29: danger: ‘str’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  398|   	const struct perm_value *v;
#  399|   	char *str = SMB_STRDUP(orig_str);
#  400|-> 	TALLOC_CTX *frame = talloc_stackframe();
#  401|   
#  402|   	if (!str) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def692]
samba-4.23.4/source3/lib/util_sd.c:407:9: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_true: following ‘true’ branch (when ‘ace’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_true: ...to here
samba-4.23.4/source3/lib/util_sd.c:407:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/lib/util_sd.c:407:9: danger: ‘str’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  405|   	}
#  406|   
#  407|-> 	ZERO_STRUCTP(ace);
#  408|   	p = strchr_m(str,':');
#  409|   	if (!p) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def693]
samba-4.23.4/source3/lib/util_sd.c:408:13: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/lib/util_sd.c:399:21: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_sd.c:402:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/lib/util_sd.c:407:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sd.c:408:13: throw: if ‘strchr_m’ throws an exception...
samba-4.23.4/source3/lib/util_sd.c:408:13: danger: ‘str’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  406|   
#  407|   	ZERO_STRUCTP(ace);
#  408|-> 	p = strchr_m(str,':');
#  409|   	if (!p) {
#  410|   		printf("ACE '%s': missing ':'.\n", orig_str);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def694]
samba-4.23.4/source3/lib/util_sock.c:433:26: warning[-Wanalyzer-fd-leak]: leak of file descriptor
samba-4.23.4/source3/lib/util_sock.c:419:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sock.c:422:14: branch_false: ...to here
samba-4.23.4/source3/lib/util_sock.c:431:21: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/util_sock.c:432:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_sock.c:433:49: branch_true: ...to here
samba-4.23.4/source3/lib/util_sock.c:433:26: danger: leaks here
#  431|   	state->fd = socket(state->saddr.u.sa.sa_family, SOCK_STREAM, protocol);
#  432|   	if (state->fd == -1) {
#  433|-> 		status = map_nt_error_from_unix(errno);
#  434|   		tevent_req_nterror(req, status);
#  435|   		return tevent_req_post(req, ev);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def695]
samba-4.23.4/source3/lib/util_sock.c:883:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
samba-4.23.4/source3/lib/util_sock.c:860:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_sock.c:865:16: branch_true: ...to here
samba-4.23.4/source3/lib/util_sock.c:865:16: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/util_sock.c:867:12: branch_false: following ‘false’ branch (when ‘sock != -1’)...
samba-4.23.4/source3/lib/util_sock.c:873:13: branch_false: ...to here
samba-4.23.4/source3/lib/util_sock.c:873:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sock.c:877:9: branch_false: ...to here
samba-4.23.4/source3/lib/util_sock.c:882:12: branch_true: following ‘true’ branch (when ‘path_len > 108’)...
samba-4.23.4/source3/lib/util_sock.c:883:17: branch_true: ...to here
samba-4.23.4/source3/lib/util_sock.c:883:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/util_sock.c:883:17: danger: ‘sock’ leaks here
#  881|   	path_len = strlcpy(sunaddr.sun_path, path, sizeof(sunaddr.sun_path));
#  882|   	if (path_len > sizeof(sunaddr.sun_path)) {
#  883|-> 		DBG_ERR("Refusing to attempt to create pipe socket "
#  884|   			"%s.  Path is longer than permitted for a "
#  885|   			"unix domain socket.  It would truncate to "

Error: GCC_ANALYZER_WARNING (CWE-775): [#def696]
samba-4.23.4/source3/lib/util_sock.c:906:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sock’
samba-4.23.4/source3/lib/util_sock.c:860:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_sock.c:865:16: branch_true: ...to here
samba-4.23.4/source3/lib/util_sock.c:865:16: acquire_resource: stream socket created here
samba-4.23.4/source3/lib/util_sock.c:867:12: branch_false: following ‘false’ branch (when ‘sock != -1’)...
samba-4.23.4/source3/lib/util_sock.c:873:13: branch_false: ...to here
samba-4.23.4/source3/lib/util_sock.c:904:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_sock.c:905:12: branch_false: ...to here
samba-4.23.4/source3/lib/util_sock.c:905:12: branch_true: following ‘true’ branch (when ‘sock != -1’)...
samba-4.23.4/source3/lib/util_sock.c:906:17: branch_true: ...to here
samba-4.23.4/source3/lib/util_sock.c:906:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/lib/util_sock.c:906:17: danger: ‘sock’ leaks here
#  904|   	SAFE_FREE(path);
#  905|   	if (sock != -1)
#  906|-> 		close(sock);
#  907|   
#  908|   	umask(old_umask);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def697]
samba-4.23.4/source3/lib/util_str.c:467:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/util_str.c:466:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/util_str.c:467:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/lib/util_str.c:467:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  465|   
#  466|   	va_start(ap, fmt);
#  467|-> 	ret = talloc_vasprintf(t, fmt, ap);
#  468|   	va_end(ap);
#  469|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def698]
samba-4.23.4/source3/lib/util_str.c:486:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/util_str.c:485:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/util_str.c:486:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/lib/util_str.c:486:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  484|   
#  485|   	va_start(ap, fmt);
#  486|-> 	ret = talloc_vasprintf(t, fmt, ap);
#  487|   	va_end(ap);
#  488|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def699]
samba-4.23.4/source3/lib/util_tdb.c:81:33: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/util_tdb.c:121:8: enter_function: entry to ‘tdb_pack’
samba-4.23.4/source3/lib/util_tdb.c:126:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/util_tdb.c:127:18: call_function: calling ‘tdb_pack_va’ from ‘tdb_pack’
#   79|   			s = va_arg(ap,char *);
#   80|   			if (s == NULL) {
#   81|-> 				smb_panic("Invalid argument");
#   82|   			}
#   83|   			w = strlen(s);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def700]
samba-4.23.4/source3/lib/util_tdb.c:100:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/util_tdb.c:121:8: enter_function: entry to ‘tdb_pack’
samba-4.23.4/source3/lib/util_tdb.c:126:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/util_tdb.c:127:18: call_function: calling ‘tdb_pack_va’ from ‘tdb_pack’
#   98|   			break;
#   99|   		default:
#  100|-> 			DEBUG(0,("Unknown tdb_pack format %c in %s\n", 
#  101|   				 c, fmt));
#  102|   			len = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def701]
samba-4.23.4/source3/lib/util_tdb.c:191:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/lib/util_tdb.c:154:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_tdb.c:155:29: branch_true: ...to here
samba-4.23.4/source3/lib/util_tdb.c:193:28: branch_false: following ‘false’ branch (when ‘bufsize >= len’)...
samba-4.23.4/source3/lib/util_tdb.c:195:28: branch_false: ...to here
samba-4.23.4/source3/lib/util_tdb.c:195:28: branch_true: following ‘true’ branch (when ‘ps’ is non-NULL)...
samba-4.23.4/source3/lib/util_tdb.c:196:39: branch_true: ...to here
samba-4.23.4/source3/lib/util_tdb.c:196:39: acquire_memory: allocated here
samba-4.23.4/source3/lib/util_tdb.c:197:36: branch_false: following ‘false’ branch...
samba-4.23.4/source3/lib/util_tdb.c:243:17: branch_false: ...to here
samba-4.23.4/source3/lib/util_tdb.c:154:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_tdb.c:155:29: branch_true: ...to here
samba-4.23.4/source3/lib/util_tdb.c:191:25: danger: ‘<unknown>’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
#  189|   		case 'P': /* null-terminated string */
#  190|   			/* Return malloc'ed string. */
#  191|-> 			ps = va_arg(ap,char **);
#  192|   			len = strnlen((const char *)buf, bufsize) + 1;
#  193|   			if (bufsize < len)

Error: GCC_ANALYZER_WARNING (CWE-404): [#def702]
samba-4.23.4/source3/lib/util_tdb.c:236:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/lib/util_tdb.c:152:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/lib/util_tdb.c:154:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/util_tdb.c:155:29: branch_true: ...to here
samba-4.23.4/source3/lib/util_tdb.c:236:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/util_tdb.c:236:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  234|   			break;
#  235|   		default:
#  236|-> 			DEBUG(0,("Unknown tdb_unpack format %c in %s\n",
#  237|   				 c, fmt));
#  238|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def703]
samba-4.23.4/source3/lib/wins_srv.c:80:17: warning[-Wanalyzer-malloc-leak]: leak of ‘src_ip_addr’
samba-4.23.4/source3/lib/wins_srv.c:77:23: acquire_memory: allocated here
samba-4.23.4/source3/lib/wins_srv.c:79:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/wins_srv.c:80:17: branch_true: ...to here
samba-4.23.4/source3/lib/wins_srv.c:80:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/wins_srv.c:80:17: danger: ‘src_ip_addr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   78|   
#   79|   	if ( !wins_ip_addr || !src_ip_addr ) {
#   80|-> 		DEBUG(0,("wins_srv_keystr: malloc error\n"));
#   81|   		goto done;
#   82|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def704]
samba-4.23.4/source3/lib/wins_srv.c:80:17: warning[-Wanalyzer-malloc-leak]: leak of ‘wins_ip_addr’
samba-4.23.4/source3/lib/wins_srv.c:76:24: acquire_memory: allocated here
samba-4.23.4/source3/lib/wins_srv.c:79:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/lib/wins_srv.c:80:17: branch_true: ...to here
samba-4.23.4/source3/lib/wins_srv.c:80:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/lib/wins_srv.c:80:17: danger: ‘wins_ip_addr’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   78|   
#   79|   	if ( !wins_ip_addr || !src_ip_addr ) {
#   80|-> 		DEBUG(0,("wins_srv_keystr: malloc error\n"));
#   81|   		goto done;
#   82|   	}

Error: COMPILER_WARNING (CWE-704): [#def705]
samba-4.23.4/source3/lib/wins_srv.c: scope_hint: In function ‘parse_ip’
samba-4.23.4/source3/lib/wins_srv.c:185:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  185 |         char *s = strchr(str, ':');
#      |                   ^~~~~~
#  183|   static void parse_ip(struct tagged_ip *ip, const char *str)
#  184|   {
#  185|-> 	char *s = strchr(str, ':');
#  186|   	if (!s) {
#  187|   		fstrcpy(ip->tag, "*");

Error: COMPILER_WARNING (CWE-704): [#def706]
samba-4.23.4/source3/lib/wins_srv.c:185:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  183|   static void parse_ip(struct tagged_ip *ip, const char *str)
#  184|   {
#  185|-> 	char *s = strchr(str, ':');
#  186|   	if (!s) {
#  187|   		fstrcpy(ip->tag, "*");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def707]
samba-4.23.4/source3/libads/ads_struct.c:95:16: warning[-Wanalyzer-malloc-leak]: leak of ‘dn’
samba-4.23.4/source3/libads/ads_struct.c:102:12: enter_function: entry to ‘ads_build_dn’
samba-4.23.4/source3/libads/ads_struct.c:107:18: call_function: calling ‘ads_build_path’ from ‘ads_build_dn’
#   93|   	*_path = ret;
#   94|   
#   95|-> 	return ADS_ERROR_NT(NT_STATUS_OK);
#   96|   }
#   97|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def708]
samba-4.23.4/source3/libads/ads_struct.c:136:14: warning[-Wanalyzer-malloc-leak]: leak of ‘dnsdomain’
samba-4.23.4/source3/libads/ads_struct.c:131:27: acquire_memory: allocated here
samba-4.23.4/source3/libads/ads_struct.c:131:12: branch_false: following ‘false’ branch (when ‘dnsdomain’ is non-NULL)...
samba-4.23.4/source3/libads/ads_struct.c:136:14: branch_false: ...to here
samba-4.23.4/source3/libads/ads_struct.c:136:14: throw: if ‘strlower_m’ throws an exception...
samba-4.23.4/source3/libads/ads_struct.c:136:14: danger: ‘dnsdomain’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  134|   	}	
#  135|   
#  136|-> 	if (!strlower_m( dnsdomain )) {
#  137|   		SAFE_FREE(dnsdomain);
#  138|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def709]
samba-4.23.4/source3/libads/krb5_setpw.c:257:15: warning[-Wanalyzer-malloc-leak]: leak of ‘password’
samba-4.23.4/source3/libads/krb5_setpw.c:183:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:189:20: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:195:15: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:196:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:203:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:234:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:240:60: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:245:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:255:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:256:20: acquire_memory: allocated here
samba-4.23.4/source3/libads/krb5_setpw.c:257:15: throw: if ‘krb5_get_init_creds_password’ throws an exception...
samba-4.23.4/source3/libads/krb5_setpw.c:257:15: danger: ‘password’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  255|   	TALLOC_FREE(realm);
#  256|   	password = SMB_STRDUP(oldpw);
#  257|-> 	ret = krb5_get_init_creds_password(context, &creds, princ, password,
#  258|   					   kerb_prompter, NULL,
#  259|   					   0, chpw_princ, opts);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def710]
samba-4.23.4/source3/libads/krb5_setpw.c:260:9: warning[-Wanalyzer-malloc-leak]: leak of ‘password’
samba-4.23.4/source3/libads/krb5_setpw.c:183:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:189:20: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:195:15: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:196:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:203:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:234:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:240:60: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:245:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:255:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:256:20: acquire_memory: allocated here
samba-4.23.4/source3/libads/krb5_setpw.c:260:9: throw: if ‘krb5_get_init_creds_opt_free’ throws an exception...
samba-4.23.4/source3/libads/krb5_setpw.c:260:9: danger: ‘password’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  258|   					   kerb_prompter, NULL,
#  259|   					   0, chpw_princ, opts);
#  260|-> 	krb5_get_init_creds_opt_free(context, opts);
#  261|   	smb_krb5_free_addresses(context, addr);
#  262|   	SAFE_FREE(chpw_princ);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def711]
samba-4.23.4/source3/libads/krb5_setpw.c:261:9: warning[-Wanalyzer-malloc-leak]: leak of ‘password’
samba-4.23.4/source3/libads/krb5_setpw.c:183:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:189:20: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:195:15: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:196:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:203:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:234:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:240:60: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:245:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libads/krb5_setpw.c:255:9: branch_false: ...to here
samba-4.23.4/source3/libads/krb5_setpw.c:256:20: acquire_memory: allocated here
samba-4.23.4/source3/libads/krb5_setpw.c:261:9: throw: if ‘smb_krb5_free_addresses’ throws an exception...
samba-4.23.4/source3/libads/krb5_setpw.c:261:9: danger: ‘password’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  259|   					   0, chpw_princ, opts);
#  260|   	krb5_get_init_creds_opt_free(context, opts);
#  261|-> 	smb_krb5_free_addresses(context, addr);
#  262|   	SAFE_FREE(chpw_princ);
#  263|   	SAFE_FREE(password);

Error: COMPILER_WARNING (CWE-704): [#def712]
samba-4.23.4/source3/libads/ldap.c: scope_hint: In function ‘ads_parent_dn’
samba-4.23.4/source3/libads/ldap.c:1855:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1855 |         p = strchr(dn, ',');
#      |           ^
# 1853|   	}
# 1854|   
# 1855|-> 	p = strchr(dn, ',');
# 1856|   
# 1857|   	if (p == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def713]
samba-4.23.4/source3/libads/ldap.c:1855:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1853|   	}
# 1854|   
# 1855|-> 	p = strchr(dn, ',');
# 1856|   
# 1857|   	if (p == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def714]
samba-4.23.4/source3/libads/ldap.c:4294:14: warning[-Wanalyzer-malloc-leak]: leak of ‘host’
samba-4.23.4/source3/libads/ldap.c:4293:16: acquire_memory: allocated here
samba-4.23.4/source3/libads/ldap.c:4294:14: throw: if ‘strlower_m’ throws an exception...
samba-4.23.4/source3/libads/ldap.c:4294:14: danger: ‘host’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 4292|   	/* hostname must be lowercase */
# 4293|   	host = SMB_STRDUP(hostname);
# 4294|-> 	if (!strlower_m(host)) {
# 4295|   		SAFE_FREE(host);
# 4296|   		return ADS_ERROR_SYSTEM(EINVAL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def715]
samba-4.23.4/source3/libads/ldap_utils.c:87:26: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#   85|   
#   86|   	if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
#   87|-> 		status = ads_do_search(ads, bp, scope, expr, attrs, res);
#   88|   	} else {
#   89|   		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def716]
samba-4.23.4/source3/libads/ldap_utils.c:89:26: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#   87|   		status = ads_do_search(ads, bp, scope, expr, attrs, res);
#   88|   	} else {
#   89|-> 		status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
#   90|   	}
#   91|   	if (ADS_ERR_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def717]
samba-4.23.4/source3/libads/ldap_utils.c:92:16: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#   90|   	}
#   91|   	if (ADS_ERR_OK(status)) {
#   92|->                DEBUG(5,("Search for %s in <%s> gave %d replies\n",
#   93|                           expr, bp, ads_count_replies(ads, *res)));
#   94|   		SAFE_FREE(bp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def718]
samba-4.23.4/source3/libads/ldap_utils.c:103:21: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  101|   		NTSTATUS ntstatus;
#  102|   
#  103|-> 		if (NT_STATUS_EQUAL(ads_ntstatus(status), NT_STATUS_IO_TIMEOUT) &&
#  104|   		    ads->config.ldap_page_size >= (lp_ldap_page_size() / 4) &&
#  105|   		    lp_ldap_page_size() > 4) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def719]
samba-4.23.4/source3/libads/ldap_utils.c:104:52: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  102|   
#  103|   		if (NT_STATUS_EQUAL(ads_ntstatus(status), NT_STATUS_IO_TIMEOUT) &&
#  104|-> 		    ads->config.ldap_page_size >= (lp_ldap_page_size() / 4) &&
#  105|   		    lp_ldap_page_size() > 4) {
#  106|   			int new_page_size = (ads->config.ldap_page_size / 2);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def720]
samba-4.23.4/source3/libads/ldap_utils.c:105:21: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  103|   		if (NT_STATUS_EQUAL(ads_ntstatus(status), NT_STATUS_IO_TIMEOUT) &&
#  104|   		    ads->config.ldap_page_size >= (lp_ldap_page_size() / 4) &&
#  105|-> 		    lp_ldap_page_size() > 4) {
#  106|   			int new_page_size = (ads->config.ldap_page_size / 2);
#  107|   			DEBUG(1, ("Reducing LDAP page size from %d to %d due to IO_TIMEOUT\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def721]
samba-4.23.4/source3/libads/ldap_utils.c:107:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  105|   		    lp_ldap_page_size() > 4) {
#  106|   			int new_page_size = (ads->config.ldap_page_size / 2);
#  107|-> 			DEBUG(1, ("Reducing LDAP page size from %d to %d due to IO_TIMEOUT\n",
#  108|   				  ads->config.ldap_page_size, new_page_size));
#  109|   			ads->config.ldap_page_size = new_page_size;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def722]
samba-4.23.4/source3/libads/ldap_utils.c:113:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  111|   
#  112|   		if (*res) 
#  113|-> 			ads_msgfree(ads, *res);
#  114|   		*res = NULL;
#  115|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def723]
samba-4.23.4/source3/libads/ldap_utils.c:116:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  114|   		*res = NULL;
#  115|   
#  116|-> 		ads_disconnect(ads);
#  117|   
#  118|   		if (ads->auth.reconnect_state->fn == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def724]
samba-4.23.4/source3/libads/ldap_utils.c:119:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  117|   
#  118|   		if (ads->auth.reconnect_state->fn == NULL) {
#  119|-> 			DBG_NOTICE("Search for %s in <%s> failed: %s\n",
#  120|   				   expr, bp, ads_errstr(status));
#  121|   			SAFE_FREE(bp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def725]
samba-4.23.4/source3/libads/ldap_utils.c:125:28: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  123|   		}
#  124|   
#  125|-> 		ntstatus = ads->auth.reconnect_state->fn(ads,
#  126|   				ads->auth.reconnect_state->private_data,
#  127|   				ads, &creds);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def726]
samba-4.23.4/source3/libads/ldap_utils.c:129:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  127|   				ads, &creds);
#  128|   		if (!NT_STATUS_IS_OK(ntstatus)) {
#  129|-> 			DBG_WARNING("Failed to get creds for realm(%s): %s\n",
#  130|   				    ads->server.realm, nt_errstr(ntstatus));
#  131|   			DBG_WARNING("Search for %s in <%s> failed: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def727]
samba-4.23.4/source3/libads/ldap_utils.c:131:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  129|   			DBG_WARNING("Failed to get creds for realm(%s): %s\n",
#  130|   				    ads->server.realm, nt_errstr(ntstatus));
#  131|-> 			DBG_WARNING("Search for %s in <%s> failed: %s\n",
#  132|   				   expr, bp, ads_errstr(status));
#  133|   			SAFE_FREE(bp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def728]
samba-4.23.4/source3/libads/ldap_utils.c:137:29: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  135|   		}
#  136|   
#  137|-> 		cred_name = cli_credentials_get_unparsed_name(creds, creds);
#  138|   		DBG_NOTICE("Reopening ads connection as %s to "
#  139|   			   "realm '%s' after error %s\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def729]
samba-4.23.4/source3/libads/ldap_utils.c:138:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  136|   
#  137|   		cred_name = cli_credentials_get_unparsed_name(creds, creds);
#  138|-> 		DBG_NOTICE("Reopening ads connection as %s to "
#  139|   			   "realm '%s' after error %s\n",
#  140|   			   cred_name, ads->server.realm, ads_errstr(status));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def730]
samba-4.23.4/source3/libads/ldap_utils.c:142:26: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  140|   			   cred_name, ads->server.realm, ads_errstr(status));
#  141|   
#  142|-> 		status = ads_connect_creds(ads, creds);
#  143|   		if (!ADS_ERR_OK(status)) {
#  144|   			DBG_WARNING("Reconnect ads connection as %s to "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def731]
samba-4.23.4/source3/libads/ldap_utils.c:144:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  142|   		status = ads_connect_creds(ads, creds);
#  143|   		if (!ADS_ERR_OK(status)) {
#  144|-> 			DBG_WARNING("Reconnect ads connection as %s to "
#  145|   				    "realm '%s' failed: %s\n",
#  146|   				    cred_name, ads->server.realm,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def732]
samba-4.23.4/source3/libads/ldap_utils.c:153:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  151|   			 * callers depend on it being around.
#  152|   			 */
#  153|-> 			ads_disconnect(ads);
#  154|   			TALLOC_FREE(creds);
#  155|   			SAFE_FREE(bp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def733]
samba-4.23.4/source3/libads/ldap_utils.c:166:34: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  164|   
#  165|   		if (ads->auth.flags & ADS_AUTH_ANON_BIND) {
#  166|-> 			status = ads_do_search(ads, bp, scope, expr, attrs, res);
#  167|   		} else {
#  168|   			status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def734]
samba-4.23.4/source3/libads/ldap_utils.c:168:34: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  166|   			status = ads_do_search(ads, bp, scope, expr, attrs, res);
#  167|   		} else {
#  168|-> 			status = ads_do_search_all_args(ads, bp, scope, expr, attrs, args, res);
#  169|   		}
#  170|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def735]
samba-4.23.4/source3/libads/ldap_utils.c:172:25: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’
samba-4.23.4/source3/libads/ldap_utils.c:218:13: enter_function: entry to ‘ads_search_retry_dn_sd_flags’
samba-4.23.4/source3/libads/ldap_utils.c:229:16: call_function: inlined call to ‘ads_do_search_retry_args’ from ‘ads_search_retry_dn_sd_flags’
#  170|   
#  171|   		if (ADS_ERR_OK(status)) {
#  172|-> 			DEBUG(5,("Search for filter: %s, base: %s gave %d replies\n",
#  173|   				 expr, bp, ads_count_replies(ads, *res)));
#  174|   			SAFE_FREE(bp);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def736]
samba-4.23.4/source3/libnet/libnet_dssync.c:555:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_utdv’
samba-4.23.4/source3/libnet/libnet_dssync.c:462:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:470:18: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:472:12: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:479:39: branch_false: following ‘false’ branch (when ‘last_query == 0’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_true: following ‘true’ branch (when ‘level == 8’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:486:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:486:25: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:502:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:509:22: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:509:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:517:21: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:517:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:541:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:548:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:552:37: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:552:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:553:38: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:552:37: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:555:41: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:555:41: danger: dereference of NULL ‘new_utdv’
#  553|   				    !ctx->single_object_replication)
#  554|   				{
#  555|-> 					new_utdv->version = 1;
#  556|   					new_utdv->ctr.ctr1.count =
#  557|   						ctr1->uptodateness_vector->count;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def737]
samba-4.23.4/source3/libnet/libnet_dssync.c:580:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_utdv’
samba-4.23.4/source3/libnet/libnet_dssync.c:462:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:470:18: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:472:12: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:479:39: branch_false: following ‘false’ branch (when ‘last_query == 0’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_true: following ‘true’ branch (when ‘level == 8’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:486:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:486:25: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:502:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:509:22: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:509:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:517:21: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:517:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:541:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:541:25: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:548:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:549:33: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:593:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:594:34: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:597:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:605:20: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:605:20: branch_true: following ‘true’ branch (when ‘linked_attributes_count == 0’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:605:20: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:479:39: branch_false: following ‘false’ branch (when ‘last_query == 0’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:485:20: branch_true: following ‘true’ branch (when ‘level == 8’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:486:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:502:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:509:22: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:509:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:517:21: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:517:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:520:27: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:523:27: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:562:27: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:562:27: branch_true: following ‘true’ branch (when ‘out_level == 6’)...
samba-4.23.4/source3/libnet/libnet_dssync.c:563:25: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:573:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:577:37: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:577:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:578:38: branch_true: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:577:37: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_dssync.c:580:41: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_dssync.c:580:41: danger: dereference of NULL ‘new_utdv’
#  578|   				    !ctx->single_object_replication)
#  579|   				{
#  580|-> 					new_utdv->version = 2;
#  581|   					new_utdv->ctr.ctr2.count =
#  582|   						ctr6->uptodateness_vector->count;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def738]
samba-4.23.4/source3/libnet/libnet_join.c:101:31: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libnet/libnet_join.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_join.c:100:9: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_join.c:100:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libnet/libnet_join.c:101:31: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/libnet/libnet_join.c:101:31: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   99|   
#  100|   	va_start(args, format);
#  101|-> 	r->out.error_string = talloc_vasprintf(mem_ctx, format, args);
#  102|   	va_end(args);
#  103|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def739]
samba-4.23.4/source3/libnet/libnet_join.c:124:31: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libnet/libnet_join.c:119:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libnet/libnet_join.c:123:9: branch_false: ...to here
samba-4.23.4/source3/libnet/libnet_join.c:123:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libnet/libnet_join.c:124:31: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/libnet/libnet_join.c:124:31: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  122|   
#  123|   	va_start(args, format);
#  124|-> 	r->out.error_string = talloc_vasprintf(mem_ctx, format, args);
#  125|   	va_end(args);
#  126|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def740]
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:700:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ph’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:674:20: enter_function: entry to ‘cli_smb2_set_info_fnum_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:686:26: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:691:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:695:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:695:18: call_function: calling ‘map_fnum_to_smb2_handle’ from ‘cli_smb2_set_info_fnum_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:695:18: return_function: returning to ‘cli_smb2_set_info_fnum_send’ from ‘map_fnum_to_smb2_handle’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:696:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:712:19: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:712:19: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:700:18: danger: dereference of NULL ‘ph’
#  698|   	}
#  699|   
#  700|-> 	subreq = smb2cli_set_info_send(
#  701|   		state,
#  702|   		ev,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def741]
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1911:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ph’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1883:20: enter_function: entry to ‘cli_smb2_query_info_fnum_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1897:26: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1902:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1906:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1906:18: call_function: calling ‘map_fnum_to_smb2_handle’ from ‘cli_smb2_query_info_fnum_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1906:18: return_function: returning to ‘cli_smb2_query_info_fnum_send’ from ‘map_fnum_to_smb2_handle’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1907:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1925:19: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1925:19: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:1911:18: danger: dereference of NULL ‘ph’
# 1909|   	}
# 1910|   
# 1911|-> 	subreq = smb2cli_query_info_send(
# 1912|   		state,
# 1913|   		ev,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def742]
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4787:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ph’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4762:20: enter_function: entry to ‘cli_smb2_notify_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4773:26: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4778:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4782:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4782:18: call_function: calling ‘map_fnum_to_smb2_handle’ from ‘cli_smb2_notify_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4782:18: return_function: returning to ‘cli_smb2_notify_send’ from ‘map_fnum_to_smb2_handle’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4783:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4796:19: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4796:19: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4787:25: danger: dereference of NULL ‘ph’
# 4785|   	}
# 4786|   
# 4787|-> 	state->subreq = smb2cli_notify_send(
# 4788|   		state,
# 4789|   		ev,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def743]
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4982:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ph’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4958:20: enter_function: entry to ‘cli_smb2_fsctl_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4969:26: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4973:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4977:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4977:18: call_function: calling ‘map_fnum_to_smb2_handle’ from ‘cli_smb2_fsctl_send’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4977:18: return_function: returning to ‘cli_smb2_fsctl_send’ from ‘map_fnum_to_smb2_handle’
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4978:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4990:19: branch_false: ...to here
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4990:19: release_memory: ‘ph’ is NULL
samba-4.23.4/source3/libsmb/cli_smb2_fnum.c:4982:18: danger: dereference of NULL ‘ph’
# 4980|   	}
# 4981|   
# 4982|-> 	subreq = smb2cli_ioctl_send(
# 4983|   		state,
# 4984|   		ev,

Error: COMPILER_WARNING (CWE-704): [#def744]
samba-4.23.4/source3/libsmb/cliconnect.c: scope_hint: In function ‘cli_connect_nb_send’
samba-4.23.4/source3/libsmb/cliconnect.c:2536:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2536 |                 char *p = strchr(host, '#');
#      |                           ^~~~~~
# 2534|   
# 2535|   	if (host != NULL) {
# 2536|-> 		char *p = strchr(host, '#');
# 2537|   
# 2538|   		if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def745]
samba-4.23.4/source3/libsmb/cliconnect.c:2536:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2534|   
# 2535|   	if (host != NULL) {
# 2536|-> 		char *p = strchr(host, '#');
# 2537|   
# 2538|   		if (p != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def746]
samba-4.23.4/source3/libsmb/clilist.c:860:44: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘finfo’
samba-4.23.4/source3/libsmb/clilist.c:759:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clilist.c:767:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/clilist.c:780:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clilist.c:783:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/clilist.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clilist.c:849:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/clilist.c:853:12: branch_false: following ‘false’ branch (when ‘ff_eos == 0’)...
samba-4.23.4/source3/libsmb/clilist.c:859:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/clilist.c:859:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clilist.c:860:44: branch_false: ...to here
samba-4.23.4/source3/libsmb/clilist.c:860:44: danger: dereference of NULL ‘finfo’
#  858|   
#  859|   	TALLOC_FREE(state->mask);
#  860|-> 	state->mask = talloc_strdup(state, finfo->name);
#  861|   	if (tevent_req_nomem(state->mask, req)) {
#  862|   		return;

Error: GCC_ANALYZER_WARNING (CWE-121): [#def747]
samba-4.23.4/source3/libsmb/cliprint.c:74:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
#   72|   	SSVAL(p,0,76);         /* API function number 76 (DosPrintJobEnum) */
#   73|   	p += 2;
#   74|-> 	strlcpy_base(p,"zWrLeh", param, sizeof(param));   /* parameter description? */
#   75|   	p = skip_string(param,sizeof(param),p);
#   76|   	strlcpy_base(p,"WWzWWDDzz", param, sizeof(param));  /* returned data format */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def748]
samba-4.23.4/source3/libsmb/cliprint.c:170:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
#  168|   	SSVAL(p,0,81);		/* DosPrintJobDel() */
#  169|   	p += 2;
#  170|-> 	strlcpy_base(p,"W", param,sizeof(param));
#  171|   	p = skip_string(param,sizeof(param),p);
#  172|   	strlcpy_base(p,"", param,sizeof(param));

Error: GCC_ANALYZER_WARNING (CWE-121): [#def749]
samba-4.23.4/source3/libsmb/clirap.c:63:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
#   61|   	SSVAL(p,0,0); /* api number */
#   62|   	p += 2;
#   63|-> 	strlcpy(p,"WrLeh",sizeof(param)-PTR_DIFF(p,param));
#   64|   	p = skip_string(param,sizeof(param),p);
#   65|   	strlcpy(p,"B13BWz",sizeof(param)-PTR_DIFF(p,param));

Error: CPPCHECK_WARNING (CWE-457): [#def750]
samba-4.23.4/source3/libsmb/clirap.c:64: error[uninitvar]: Uninitialized variable: param
#   62|   	p += 2;
#   63|   	strlcpy(p,"WrLeh",sizeof(param)-PTR_DIFF(p,param));
#   64|-> 	p = skip_string(param,sizeof(param),p);
#   65|   	strlcpy(p,"B13BWz",sizeof(param)-PTR_DIFF(p,param));
#   66|   	p = skip_string(param,sizeof(param),p);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def751]
samba-4.23.4/source3/libsmb/clirap.c:215:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
samba-4.23.4/source3/libsmb/clirap.c:214:20: branch_false: following ‘false’ branch (when ‘func != 215’)...
samba-4.23.4/source3/libsmb/clirap.c:217:25: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:238:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:242:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:244:20: branch_false: following ‘false’ branch (when ‘func != 215’)...
samba-4.23.4/source3/libsmb/clirap.c:271:36: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:286:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:292:29: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:296:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/clirap.c:299:39: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:309:28: branch_true: following ‘true’ branch (when ‘total_cnt == 0’)...
samba-4.23.4/source3/libsmb/clirap.c:310:45: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:329:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:336:25: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:336:37: branch_true: following ‘true’ branch (when ‘i < count’)...
samba-4.23.4/source3/libsmb/clirap.c:341:53: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:344:36: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:350:51: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:336:37: branch_false: following ‘false’ branch (when ‘i >= count’)...
samba-4.23.4/source3/libsmb/clirap.c:385:28: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:385:28: branch_false: following ‘false’ branch (when ‘last_entry’ is NULL)...
samba-4.23.4/source3/libsmb/clirap.c:390:28: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:390:28: branch_true: following ‘true’ branch (when ‘sname’ is non-NULL)...
samba-4.23.4/source3/libsmb/clirap.c:391:46: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:395:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:401:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:401:17: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:402:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:402:17: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:403:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:403:18: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/clirap.c:403:18: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:214:20: branch_true: following ‘true’ branch (when ‘func == 215’)...
samba-4.23.4/source3/libsmb/clirap.c:215:25: branch_true: ...to here
samba-4.23.4/source3/libsmb/clirap.c:215:25: danger: out-of-bounds write from byte 1024 till byte 1025 but ‘param’ ends at byte 1024
#  213|   
#  214|   		if (func == RAP_NetServerEnum3) {
#  215|-> 			strlcpy(p,"WrLehDzz", sizeof(param)-PTR_DIFF(p,param));
#  216|   		} else {
#  217|   			strlcpy(p,"WrLehDz", sizeof(param)-PTR_DIFF(p,param));

Error: GCC_ANALYZER_WARNING (CWE-121): [#def752]
samba-4.23.4/source3/libsmb/clirap.c:217:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
samba-4.23.4/source3/libsmb/clirap.c:214:20: branch_false: following ‘false’ branch (when ‘func != 215’)...
samba-4.23.4/source3/libsmb/clirap.c:217:25: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:217:25: danger: out-of-bounds write from byte 1024 till byte 1025 but ‘param’ ends at byte 1024
#  215|   			strlcpy(p,"WrLehDzz", sizeof(param)-PTR_DIFF(p,param));
#  216|   		} else {
#  217|-> 			strlcpy(p,"WrLehDz", sizeof(param)-PTR_DIFF(p,param));
#  218|   		}
#  219|   

Error: CPPCHECK_WARNING (CWE-457): [#def753]
samba-4.23.4/source3/libsmb/clirap.c:220: error[uninitvar]: Uninitialized variable: param
#  218|   		}
#  219|   
#  220|-> 		p = skip_string(param, sizeof(param), p);
#  221|   		strlcpy(p,"B16BBDz", sizeof(param)-PTR_DIFF(p,param));
#  222|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def754]
samba-4.23.4/source3/libsmb/clirap.c:447:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
samba-4.23.4/source3/libsmb/clirap.c:440:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/clirap.c:445:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/clirap.c:447:9: danger: out-of-bounds write from byte 1024 till byte 1025 but ‘param’ ends at byte 1024
#  445|   	SSVAL(p,0,214); /* SamOEMChangePassword command. */
#  446|   	p += 2;
#  447|-> 	strlcpy(p, "zsT", sizeof(param)-PTR_DIFF(p,param));
#  448|   	p = skip_string(param,sizeof(param),p);
#  449|   	strlcpy(p, "B516B16", sizeof(param)-PTR_DIFF(p,param));

Error: CPPCHECK_WARNING (CWE-457): [#def755]
samba-4.23.4/source3/libsmb/clirap.c:448: error[uninitvar]: Uninitialized variable: param
#  446|   	p += 2;
#  447|   	strlcpy(p, "zsT", sizeof(param)-PTR_DIFF(p,param));
#  448|-> 	p = skip_string(param,sizeof(param),p);
#  449|   	strlcpy(p, "B516B16", sizeof(param)-PTR_DIFF(p,param));
#  450|   	p = skip_string(param,sizeof(param),p);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def756]
samba-4.23.4/source3/libsmb/libsmb_context.c:394:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:393:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:394:17: throw: if ‘smbc_setOptionDebugToStderr’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:394:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  392|           if (strcmp(option_name, "debug_to_stderr") == 0) {
#  393|                   option_value.b = (bool) va_arg(ap, int);
#  394|->                 smbc_setOptionDebugToStderr(context, option_value.b);
#  395|   
#  396|           } else if (strcmp(option_name, "full_time_names") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def757]
samba-4.23.4/source3/libsmb/libsmb_context.c:398:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:397:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:398:17: throw: if ‘smbc_setOptionFullTimeNames’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:398:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  396|           } else if (strcmp(option_name, "full_time_names") == 0) {
#  397|                   option_value.b = (bool) va_arg(ap, int);
#  398|->                 smbc_setOptionFullTimeNames(context, option_value.b);
#  399|   
#  400|           } else if (strcmp(option_name, "open_share_mode") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def758]
samba-4.23.4/source3/libsmb/libsmb_context.c:402:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:401:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:402:17: throw: if ‘smbc_setOptionOpenShareMode’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:402:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  400|           } else if (strcmp(option_name, "open_share_mode") == 0) {
#  401|                   option_value.i = va_arg(ap, int);
#  402|->                 smbc_setOptionOpenShareMode(context, option_value.i);
#  403|   
#  404|           } else if (strcmp(option_name, "auth_function") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def759]
samba-4.23.4/source3/libsmb/libsmb_context.c:407:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:406:25: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:407:17: throw: if ‘smbc_setFunctionAuthDataWithContext’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:407:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  405|                   option_value.auth_fn =
#  406|                           va_arg(ap, smbc_get_auth_data_with_context_fn);
#  407|->                 smbc_setFunctionAuthDataWithContext(context, option_value.auth_fn);
#  408|   
#  409|           } else if (strcmp(option_name, "user_data") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def760]
samba-4.23.4/source3/libsmb/libsmb_context.c:411:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:410:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:411:17: throw: if ‘smbc_setOptionUserData’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:411:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  409|           } else if (strcmp(option_name, "user_data") == 0) {
#  410|                   option_value.v = va_arg(ap, void *);
#  411|->                 smbc_setOptionUserData(context, option_value.v);
#  412|   
#  413|           } else if (strcmp(option_name, "smb_encrypt_level") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def761]
samba-4.23.4/source3/libsmb/libsmb_context.c:416:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:414:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:415:20: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:416:25: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:416:25: throw: if ‘smbc_setOptionSmbEncryptionLevel’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:416:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  414|                   option_value.s = va_arg(ap, const char *);
#  415|                   if (strcmp(option_value.s, "none") == 0) {
#  416|->                         smbc_setOptionSmbEncryptionLevel(context,
#  417|                                                            SMBC_ENCRYPTLEVEL_NONE);
#  418|                   } else if (strcmp(option_value.s, "request") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def762]
samba-4.23.4/source3/libsmb/libsmb_context.c:419:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:414:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:415:20: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:418:28: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:418:27: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:419:25: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:419:25: throw: if ‘smbc_setOptionSmbEncryptionLevel’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:419:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  417|                                                            SMBC_ENCRYPTLEVEL_NONE);
#  418|                   } else if (strcmp(option_value.s, "request") == 0) {
#  419|->                         smbc_setOptionSmbEncryptionLevel(context,
#  420|                                                            SMBC_ENCRYPTLEVEL_REQUEST);
#  421|                   } else if (strcmp(option_value.s, "require") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def763]
samba-4.23.4/source3/libsmb/libsmb_context.c:422:25: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:414:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:415:20: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:418:28: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:418:27: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:421:28: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:421:27: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:422:25: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:422:25: throw: if ‘smbc_setOptionSmbEncryptionLevel’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:422:25: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  420|                                                            SMBC_ENCRYPTLEVEL_REQUEST);
#  421|                   } else if (strcmp(option_value.s, "require") == 0) {
#  422|->                         smbc_setOptionSmbEncryptionLevel(context,
#  423|                                                            SMBC_ENCRYPTLEVEL_REQUIRE);
#  424|                   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def764]
samba-4.23.4/source3/libsmb/libsmb_context.c:428:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:427:34: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:428:17: throw: if ‘smbc_setOptionBrowseMaxLmbCount’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:428:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  426|           } else if (strcmp(option_name, "browse_max_lmb_count") == 0) {
#  427|                   option_value.i = va_arg(ap, int);
#  428|->                 smbc_setOptionBrowseMaxLmbCount(context, option_value.i);
#  429|   
#  430|           } else if (strcmp(option_name, "urlencode_readdir_entries") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def765]
samba-4.23.4/source3/libsmb/libsmb_context.c:432:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:431:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:432:17: throw: if ‘smbc_setOptionUrlEncodeReaddirEntries’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:432:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  430|           } else if (strcmp(option_name, "urlencode_readdir_entries") == 0) {
#  431|                   option_value.b = (bool) va_arg(ap, int);
#  432|->                 smbc_setOptionUrlEncodeReaddirEntries(context, option_value.b);
#  433|   
#  434|           } else if (strcmp(option_name, "one_share_per_server") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def766]
samba-4.23.4/source3/libsmb/libsmb_context.c:436:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:434:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:434:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:435:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:436:17: throw: if ‘smbc_setOptionOneSharePerServer’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:436:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  434|           } else if (strcmp(option_name, "one_share_per_server") == 0) {
#  435|                   option_value.b = (bool) va_arg(ap, int);
#  436|->                 smbc_setOptionOneSharePerServer(context, option_value.b);
#  437|   
#  438|           } else if (strcmp(option_name, "use_kerberos") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def767]
samba-4.23.4/source3/libsmb/libsmb_context.c:440:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:434:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:434:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:438:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:438:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:439:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:440:17: throw: if ‘smbc_setOptionUseKerberos’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:440:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  438|           } else if (strcmp(option_name, "use_kerberos") == 0) {
#  439|                   option_value.b = (bool) va_arg(ap, int);
#  440|->                 smbc_setOptionUseKerberos(context, option_value.b);
#  441|   
#  442|           } else if (strcmp(option_name, "fallback_after_kerberos") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def768]
samba-4.23.4/source3/libsmb/libsmb_context.c:444:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:434:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:434:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:438:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:438:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:442:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:442:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:443:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:444:17: throw: if ‘smbc_setOptionFallbackAfterKerberos’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:444:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0)
#  442|           } else if (strcmp(option_name, "fallback_after_kerberos") == 0) {
#  443|                   option_value.b = (bool) va_arg(ap, int);
#  444|->                 smbc_setOptionFallbackAfterKerberos(context, option_value.b);
#  445|   
#  446|           } else if (strcmp(option_name, "use_ccache") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def769]
samba-4.23.4/source3/libsmb/libsmb_context.c:448:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:434:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:434:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:438:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:438:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:442:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:442:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:446:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:446:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:447:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:448:17: throw: if ‘smbc_setOptionUseCCache’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:448:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/0)
#  446|           } else if (strcmp(option_name, "use_ccache") == 0) {
#  447|                   option_value.b = (bool) va_arg(ap, int);
#  448|->                 smbc_setOptionUseCCache(context, option_value.b);
#  449|   
#  450|           } else if (strcmp(option_name, "no_auto_anonymous_login") == 0) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def770]
samba-4.23.4/source3/libsmb/libsmb_context.c:452:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/libsmb_context.c:390:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/libsmb_context.c:392:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:396:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:396:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:400:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:400:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:404:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:404:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:409:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:409:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:413:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:413:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:426:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:426:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:430:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:430:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:434:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:434:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:438:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:438:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:442:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:442:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:446:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:446:19: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:450:20: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:450:19: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source3/libsmb/libsmb_context.c:451:41: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:452:17: throw: if ‘smbc_setOptionNoAutoAnonymousLogin’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:452:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  450|           } else if (strcmp(option_name, "no_auto_anonymous_login") == 0) {
#  451|                   option_value.b = (bool) va_arg(ap, int);
#  452|->                 smbc_setOptionNoAutoAnonymousLogin(context, option_value.b);
#  453|           }
#  454|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def771]
samba-4.23.4/source3/libsmb/libsmb_context.c:632:17: warning[-Wanalyzer-malloc-leak]: leak of ‘user’
samba-4.23.4/source3/libsmb/libsmb_context.c:591:12: branch_false: following ‘false’ branch (when ‘context’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:597:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:597:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:601:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:606:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:614:14: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:614:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:618:30: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:620:20: branch_true: following ‘true’ branch (when ‘user’ is NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:621:32: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:621:32: acquire_memory: allocated here
samba-4.23.4/source3/libsmb/libsmb_context.c:626:20: branch_false: following ‘false’ branch (when ‘user’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:632:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:632:17: throw: if ‘smbc_setUser’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:632:17: danger: ‘user’ leaks here; was allocated at [(13)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/12)
#  630|                   }
#  631|   
#  632|->                 smbc_setUser(context, user);
#  633|   		SAFE_FREE(user);
#  634|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def772]
samba-4.23.4/source3/libsmb/libsmb_context.c:663:25: warning[-Wanalyzer-malloc-leak]: leak of ‘netbios_name’
samba-4.23.4/source3/libsmb/libsmb_context.c:591:12: branch_false: following ‘false’ branch (when ‘context’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:597:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:597:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:601:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:606:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:614:14: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:642:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:649:21: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:649:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:656:31: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:657:48: acquire_memory: allocated here
samba-4.23.4/source3/libsmb/libsmb_context.c:658:28: branch_false: following ‘false’ branch (when ‘netbios_name’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:663:25: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:663:25: throw: if ‘smbc_getUser’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:663:25: danger: ‘netbios_name’ leaks here; was allocated at [(13)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/12)
#  661|                                   return NULL;
#  662|                           }
#  663|->                         slprintf(netbios_name, 16,
#  664|                                    "smbc%s%d", smbc_getUser(context), pid);
#  665|                   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def773]
samba-4.23.4/source3/libsmb/libsmb_context.c:673:17: warning[-Wanalyzer-malloc-leak]: leak of ‘netbios_name’
samba-4.23.4/source3/libsmb/libsmb_context.c:591:12: branch_false: following ‘false’ branch (when ‘context’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:597:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:597:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:601:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:606:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:603:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:614:14: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:642:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:649:21: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:649:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/libsmb_context.c:650:40: branch_true: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:650:40: acquire_memory: allocated here
samba-4.23.4/source3/libsmb/libsmb_context.c:667:20: branch_false: following ‘false’ branch (when ‘netbios_name’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_context.c:673:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_context.c:673:17: throw: if ‘smbc_setNetbiosName’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_context.c:673:17: danger: ‘netbios_name’ leaks here; was allocated at [(13)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/12)
#  671|                   }
#  672|   
#  673|->                 smbc_setNetbiosName(context, netbios_name);
#  674|   		SAFE_FREE(netbios_name);
#  675|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def774]
samba-4.23.4/source3/libsmb/libsmb_dir.c:111:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dirent’
samba-4.23.4/source3/libsmb/libsmb_dir.c:92:13: branch_false: following ‘false’ branch (when ‘name’ is NULL)...
samba-4.23.4/source3/libsmb/libsmb_dir.c:93:13: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_dir.c:93:13: branch_false: following ‘false’ branch (when ‘comment’ is NULL)...
samba-4.23.4/source3/libsmb/libsmb_dir.c:100:16: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_dir.c:102:40: acquire_memory: allocated here
samba-4.23.4/source3/libsmb/libsmb_dir.c:104:12: branch_false: following ‘false’ branch (when ‘dirent’ is non-NULL)...
samba-4.23.4/source3/libsmb/libsmb_dir.c:111:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/libsmb_dir.c:111:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/libsmb/libsmb_dir.c:111:9: danger: ‘dirent’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  109|   	}
#  110|   
#  111|-> 	ZERO_STRUCTP(dirent);
#  112|   
#  113|   	if (dir->dir_list == NULL) {

Error: CPPCHECK_WARNING (CWE-768): [#def775]
samba-4.23.4/source3/libsmb/libsmb_dir.c:2137: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_nsec=((1l<<30)-2l)},access_time,write_time,(struct timespec){.tv_nsec=((1l<<30)-2l)}' depends on order of evaluation of side effects
# 2135|   		(struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT },
# 2136|   		access_time,
# 2137|-> 		write_time,
# 2138|   		(struct timespec) { .tv_nsec = SAMBA_UTIME_OMIT },
# 2139|   		0);

Error: COMPILER_WARNING (CWE-704): [#def776]
samba-4.23.4/source3/libsmb/libsmb_path.c: scope_hint: In function ‘SMBC_parse_path’
samba-4.23.4/source3/libsmb/libsmb_path.c:270:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  270 |         if ((q = strrchr(p, '?')) != NULL ) {
#      |                ^
#  268|   
#  269|           /* See if any options were specified */
#  270|->         if ((q = strrchr(p, '?')) != NULL ) {
#  271|                   /* There are options.  Null terminate here and point to them */
#  272|                   *q++ = '\0';

Error: COMPILER_WARNING (CWE-704): [#def777]
samba-4.23.4/source3/libsmb/libsmb_path.c:270:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  268|   
#  269|           /* See if any options were specified */
#  270|->         if ((q = strrchr(p, '?')) != NULL ) {
#  271|                   /* There are options.  Null terminate here and point to them */
#  272|                   *q++ = '\0';

Error: CPPCHECK_WARNING (CWE-768): [#def778]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:1850: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time}' depends on order of evaluation of side effects
# 1848|   				path,
# 1849|   				(struct timespec) {
# 1850|-> 					.tv_sec = dad->create_time },
# 1851|   				(struct timespec) {
# 1852|   					.tv_sec = dad->access_time },

Error: CPPCHECK_WARNING (CWE-768): [#def779]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:1852: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time},(struct timespec){.tv_sec=dad->write_time}' depends on order of evaluation of side effects
# 1850|   					.tv_sec = dad->create_time },
# 1851|   				(struct timespec) {
# 1852|-> 					.tv_sec = dad->access_time },
# 1853|   				(struct timespec) {
# 1854|   					.tv_sec = dad->write_time },

Error: CPPCHECK_WARNING (CWE-768): [#def780]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:1854: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time},(struct timespec){.tv_sec=dad->write_time},(struct timespec){.tv_sec=dad->change_time}' depends on order of evaluation of side effects
# 1852|   					.tv_sec = dad->access_time },
# 1853|   				(struct timespec) {
# 1854|-> 					.tv_sec = dad->write_time },
# 1855|   				(struct timespec) {
# 1856|   					.tv_sec = dad->change_time },

Error: CPPCHECK_WARNING (CWE-768): [#def781]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:2012: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time}' depends on order of evaluation of side effects
# 2010|   					path,
# 2011|   					(struct timespec) {
# 2012|-> 						.tv_sec = dad->create_time },
# 2013|   					(struct timespec) {
# 2014|   						.tv_sec = dad->access_time },

Error: CPPCHECK_WARNING (CWE-768): [#def782]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:2014: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time},(struct timespec){.tv_sec=dad->write_time}' depends on order of evaluation of side effects
# 2012|   						.tv_sec = dad->create_time },
# 2013|   					(struct timespec) {
# 2014|-> 						.tv_sec = dad->access_time },
# 2015|   					(struct timespec) {
# 2016|   						.tv_sec = dad->write_time },

Error: CPPCHECK_WARNING (CWE-768): [#def783]
samba-4.23.4/source3/libsmb/libsmb_xattr.c:2016: error[unknownEvaluationOrder]: Expression 'context,srv,path,(struct timespec){.tv_sec=dad->create_time},(struct timespec){.tv_sec=dad->access_time},(struct timespec){.tv_sec=dad->write_time},(struct timespec){.tv_sec=dad->change_time}' depends on order of evaluation of side effects
# 2014|   						.tv_sec = dad->access_time },
# 2015|   					(struct timespec) {
# 2016|-> 						.tv_sec = dad->write_time },
# 2017|   					(struct timespec) {
# 2018|   						.tv_sec = dad->change_time },

Error: GCC_ANALYZER_WARNING (CWE-404): [#def784]
samba-4.23.4/source3/libsmb/pylibsmb.c:109:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/libsmb/pylibsmb.c:108:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/libsmb/pylibsmb.c:109:15: throw: if ‘PyArg_VaParseTupleAndKeywords’ throws an exception...
samba-4.23.4/source3/libsmb/pylibsmb.c:109:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  107|   	int ret;
#  108|   	va_start(a, keywords);
#  109|-> 	ret = PyArg_VaParseTupleAndKeywords(args, kw, format,
#  110|   					    _keywords, a);
#  111|   	va_end(a);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def785]
samba-4.23.4/source3/libsmb/pylibsmb.c:674:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘share’
samba-4.23.4/source3/libsmb/pylibsmb.c:548:12: enter_function: entry to ‘py_cli_state_init’
samba-4.23.4/source3/libsmb/pylibsmb.c:582:45: call_function: calling ‘get_pytype’ from ‘py_cli_state_init’
samba-4.23.4/source3/libsmb/pylibsmb.c:582:45: return_function: returning to ‘py_cli_state_init’ from ‘get_pytype’
samba-4.23.4/source3/libsmb/pylibsmb.c:584:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:589:15: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:599:9: call_function: inlined call to ‘Py_DECREF’ from ‘py_cli_state_init’
samba-4.23.4/source3/libsmb/pylibsmb.c:601:12: branch_true: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:601:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:606:26: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:629:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:638:12: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:638:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:652:23: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:652:23: call_function: calling ‘py_cli_state_setup_ev’ from ‘py_cli_state_init’
samba-4.23.4/source3/libsmb/pylibsmb.c:652:23: return_function: returning to ‘py_cli_state_init’ from ‘py_cli_state_setup_ev’
samba-4.23.4/source3/libsmb/pylibsmb.c:653:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:659:13: branch_true: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:659:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:660:29: branch_true: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:666:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:672:35: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:674:15: danger: use of uninitialized value ‘share’ here
#  672|   				  lpcfg_client_smb_transports(lp_ctx));
#  673|   
#  674|-> 	req = cli_full_connection_creds_send(
#  675|   		frame, self->ev, "myname", host, NULL, &ts, share, "?????",
#  676|   		cli_creds, flags,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def786]
samba-4.23.4/source3/libsmb/pylibsmb.c:1785:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘buflen’
samba-4.23.4/source3/libsmb/pylibsmb.c:1778:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:1785:15: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:1785:15: danger: use of uninitialized value ‘buflen’ here
# 1783|   	}
# 1784|   
# 1785|-> 	req = cli_write_send(NULL, self->ev, self->cli, fnum, mode,
# 1786|   			     (uint8_t *)buf, offset, buflen);
# 1787|   	if (!py_tevent_req_wait_exc(self, req)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def787]
samba-4.23.4/source3/libsmb/pylibsmb.c:1954:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘size’
samba-4.23.4/source3/libsmb/pylibsmb.c:1947:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:1954:18: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:1954:18: danger: use of uninitialized value ‘size’ here
# 1952|   	}
# 1953|   
# 1954|-> 	result = PyBytes_FromStringAndSize(NULL, size);
# 1955|   	if (result == NULL) {
# 1956|   		TALLOC_FREE(frame);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def788]
samba-4.23.4/source3/libsmb/pylibsmb.c:2016:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘size’
samba-4.23.4/source3/libsmb/pylibsmb.c:2010:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:2016:15: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:2016:15: danger: use of uninitialized value ‘size’ here
# 2014|   	}
# 2015|   
# 2016|-> 	req = cli_ftruncate_send(frame, self->ev, self->cli, fnum, size);
# 2017|   	if (!py_tevent_req_wait_exc(self, req)) {
# 2018|   		TALLOC_FREE(frame);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def789]
samba-4.23.4/source3/libsmb/pylibsmb.c:2052:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘flag’
samba-4.23.4/source3/libsmb/pylibsmb.c:2046:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:2052:15: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:2052:15: danger: use of uninitialized value ‘flag’ here
# 2050|   	}
# 2051|   
# 2052|-> 	req = cli_nt_delete_on_close_send(frame, self->ev, self->cli, fnum,
# 2053|   					  flag);
# 2054|   	if (!py_tevent_req_wait_exc(self, req)) {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def790]
samba-4.23.4/source3/libsmb/pylibsmb.c:3210:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘buflen’
samba-4.23.4/source3/libsmb/pylibsmb.c:3205:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:3210:36: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:3210:9: danger: use of uninitialized value ‘buflen’ here
# 3208|   	}
# 3209|   
# 3210|-> 	in = (DATA_BLOB) { .data = (uint8_t *)buf, .length = buflen, };
# 3211|   
# 3212|   	req = cli_fsctl_send(

Error: GCC_ANALYZER_WARNING (CWE-457): [#def791]
samba-4.23.4/source3/libsmb/pylibsmb.c:3281:15: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dst_offset’
samba-4.23.4/source3/libsmb/pylibsmb.c:3261:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:3267:14: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:3277:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/pylibsmb.c:3281:15: branch_false: ...to here
samba-4.23.4/source3/libsmb/pylibsmb.c:3281:15: danger: use of uninitialized value ‘dst_offset’ here
# 3279|   	}
# 3280|   
# 3281|-> 	req = cli_smb2_splice_send(frame,
# 3282|   				   self->ev,
# 3283|   				   self->cli,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def792]
samba-4.23.4/source3/libsmb/smbsock_connect.c:1125:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’
samba-4.23.4/source3/libsmb/smbsock_connect.c:1111:18: acquire_resource: datagram socket created here
samba-4.23.4/source3/libsmb/smbsock_connect.c:1112:12: branch_false: following ‘false’ branch (when ‘sockfd != -1’)...
samba-4.23.4/source3/libsmb/smbsock_connect.c:1116:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/smbsock_connect.c:1125:9: throw: if ‘set_sockaddr_port’ throws an exception...
samba-4.23.4/source3/libsmb/smbsock_connect.c:1125:9: danger: ‘sockfd’ leaks here
# 1123|   	}
# 1124|   
# 1125|-> 	set_sockaddr_port(&raddr->u.sa, port);
# 1126|   
# 1127|   	ret = connect(sockfd, &raddr->u.sa, raddr->sa_socklen);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def793]
samba-4.23.4/source3/libsmb/smbsock_connect.c:1127:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘sockfd’
samba-4.23.4/source3/libsmb/smbsock_connect.c:1111:18: acquire_resource: datagram socket created here
samba-4.23.4/source3/libsmb/smbsock_connect.c:1112:12: branch_false: following ‘false’ branch (when ‘sockfd != -1’)...
samba-4.23.4/source3/libsmb/smbsock_connect.c:1116:17: branch_false: ...to here
samba-4.23.4/source3/libsmb/smbsock_connect.c:1127:15: throw: if ‘connect’ throws an exception...
samba-4.23.4/source3/libsmb/smbsock_connect.c:1127:15: danger: ‘sockfd’ leaks here
# 1125|   	set_sockaddr_port(&raddr->u.sa, port);
# 1126|   
# 1127|-> 	ret = connect(sockfd, &raddr->u.sa, raddr->sa_socklen);
# 1128|   	if (ret == -1) {
# 1129|   		int saved_errno = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def794]
samba-4.23.4/source3/libsmb/unexpected.c:93:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘create_pipe_sock(nmbd_socket_dir, "unexpected", 493)’
samba-4.23.4/source3/libsmb/unexpected.c:80:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/unexpected.c:84:9: branch_false: ...to here
samba-4.23.4/source3/libsmb/unexpected.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/libsmb/unexpected.c:93:14: branch_false: ...to here
samba-4.23.4/source3/libsmb/unexpected.c:93:14: danger: ‘create_pipe_sock(nmbd_socket_dir, "unexpected", 493)’ leaks here
#   91|   		goto fail;
#   92|   	}
#   93|-> 	rc = listen(result->listen_sock, 5);
#   94|   	if (rc < 0) {
#   95|   		status = map_nt_error_from_unix(errno);

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def795]
samba-4.23.4/source3/modules/vfs_crossrename.c:165:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘openat(fsp_get_pathref_fd(srcfsp), *source.base_name, 0, 0)’
samba-4.23.4/source3/modules/vfs_crossrename.c:64:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:68:14: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:68:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:73:13: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:84:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:97:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:103:22: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:111:39: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:112:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:117:49: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:144:15: release_resource: first ‘close’ here
samba-4.23.4/source3/modules/vfs_crossrename.c:145:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:146:49: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:164:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:165:23: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:165:23: danger: second ‘close’ here; first ‘close’ was at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  163|   out:
#  164|   	if (ifd != -1) {
#  165|-> 		ret = close(ifd);
#  166|   		if (ret == -1) {
#  167|   			DBG_DEBUG("Failed to close %s (%d): %s.\n",

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def796]
samba-4.23.4/source3/modules/vfs_crossrename.c:174:23: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘ofd’
samba-4.23.4/source3/modules/vfs_crossrename.c:64:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:68:14: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:68:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:73:13: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:84:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:97:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:103:22: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:106:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:111:39: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:112:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:117:49: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:145:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:151:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:151:15: release_resource: first ‘close’ here
samba-4.23.4/source3/modules/vfs_crossrename.c:152:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_crossrename.c:153:49: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:173:12: branch_true: following ‘true’ branch (when ‘ofd != -1’)...
samba-4.23.4/source3/modules/vfs_crossrename.c:174:23: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_crossrename.c:174:23: danger: second ‘close’ here; first ‘close’ was at [(15)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/14)
#  172|   	}
#  173|   	if (ofd != -1) {
#  174|-> 		ret = close(ofd);
#  175|   		if (ret == -1) {
#  176|   			DBG_DEBUG("Failed to close %s (%d): %s.\n",

Error: GCC_ANALYZER_WARNING (CWE-404): [#def797]
samba-4.23.4/source3/modules/vfs_default.c:3159:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_default.c:3137:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_default.c:3159:26: throw: if ‘fsp_get_io_fd’ throws an exception...
samba-4.23.4/source3/modules/vfs_default.c:3159:26: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3157|   #endif
# 3158|   		argp = va_arg(dup_cmd_arg, void *);
# 3159|-> 		result = sys_fcntl_ptr(fsp_get_io_fd(fsp), cmd, argp);
# 3160|   		break;
# 3161|   	default:

Error: GCC_ANALYZER_WARNING (CWE-404): [#def798]
samba-4.23.4/source3/modules/vfs_default.c:3163:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_default.c:3137:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_default.c:3163:26: throw: if ‘fsp_get_io_fd’ throws an exception...
samba-4.23.4/source3/modules/vfs_default.c:3163:26: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 3161|   	default:
# 3162|   		val = va_arg(dup_cmd_arg, int);
# 3163|-> 		result = sys_fcntl_int(fsp_get_io_fd(fsp), cmd, val);
# 3164|   	}
# 3165|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def799]
samba-4.23.4/source3/modules/vfs_dirsort.c:123:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘handle’
samba-4.23.4/source3/modules/vfs_dirsort.c:135:13: enter_function: entry to ‘dirsort_fdopendir’
samba-4.23.4/source3/modules/vfs_dirsort.c:143:12: branch_false: following ‘false’ branch (when ‘handle’ is NULL)...
samba-4.23.4/source3/modules/vfs_dirsort.c:150:16: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_dirsort.c:151:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_dirsort.c:155:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_dirsort.c:161:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_dirsort.c:166:14: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_dirsort.c:166:14: call_function: calling ‘open_and_sort_dir’ from ‘dirsort_fdopendir’
#  121|   
#  122|   		total_count++;
#  123|-> 		dp = SMB_VFS_NEXT_READDIR(handle,
#  124|   					  data->fsp,
#  125|   					  data->source_directory);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def800]
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(mapfile, "r")’
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:54:13: acquire_resource: opened here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: danger: ‘fopen(mapfile, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   60|   	}
#   61|   
#   62|-> 	DEBUG(10, ("Scanning mapfile [%s]\n", mapfile));
#   63|   
#   64|   	while (fgets(buf, sizeof(buf), f) != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def801]
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(mapfile, "r")’
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:54:13: acquire_memory: allocated here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:56:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/modules/vfs_expand_msdfs.c:62:9: danger: ‘fopen(mapfile, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   60|   	}
#   61|   
#   62|-> 	DEBUG(10, ("Scanning mapfile [%s]\n", mapfile));
#   63|   
#   64|   	while (fgets(buf, sizeof(buf), f) != NULL) {

Error: CPPCHECK_WARNING (CWE-457): [#def802]
samba-4.23.4/source3/modules/vfs_fruit.c:863: error[uninitvar]: Uninitialized variable: p
#  861|   	SIVAL(p, 4, 0);
#  862|   	SBVAL(p, 8, req_bitmap);
#  863|-> 	ok = data_blob_append(req, &blob, p, 16);
#  864|   	if (!ok) {
#  865|   		return NT_STATUS_UNSUCCESSFUL;

Error: COMPILER_WARNING (CWE-704): [#def803]
samba-4.23.4/source3/modules/vfs_fruit.c: scope_hint: In function ‘fruit_tmsize_do_dirent’
samba-4.23.4/source3/modules/vfs_fruit.c:5338:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5338 |         p = strstr(name, "sparsebundle");
#      |           ^
# 5336|   	off_t tm_size;
# 5337|   
# 5338|-> 	p = strstr(name, "sparsebundle");
# 5339|   	if (p == NULL) {
# 5340|   		return true;

Error: COMPILER_WARNING (CWE-704): [#def804]
samba-4.23.4/source3/modules/vfs_fruit.c:5338:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5336|   	off_t tm_size;
# 5337|   
# 5338|-> 	p = strstr(name, "sparsebundle");
# 5339|   	if (p == NULL) {
# 5340|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def805]
samba-4.23.4/source3/modules/vfs_full_audit.c:615:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_full_audit.c:2268:27: enter_function: entry to ‘smb_full_audit_offload_write_send’
samba-4.23.4/source3/modules/vfs_full_audit.c:2284:9: call_function: calling ‘do_log’ from ‘smb_full_audit_offload_write_send’
#  613|   
#  614|   	va_start(ap, format);
#  615|-> 	op_msg = talloc_vasprintf(talloc_tos(), format, ap);
#  616|   	va_end(ap);
#  617|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def806]
samba-4.23.4/source3/modules/vfs_full_audit.c:615:35: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_full_audit.c:2268:27: enter_function: entry to ‘smb_full_audit_offload_write_send’
samba-4.23.4/source3/modules/vfs_full_audit.c:2284:9: call_function: calling ‘do_log’ from ‘smb_full_audit_offload_write_send’
#  613|   
#  614|   	va_start(ap, format);
#  615|-> 	op_msg = talloc_vasprintf(talloc_tos(), format, ap);
#  616|   	va_end(ap);
#  617|   

Error: COMPILER_WARNING: [#def807]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_set_quota’
samba-4.23.4/source3/modules/vfs_full_audit.c:834:61: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  834 |         do_log(SMB_VFS_OP_SET_QUOTA, (result >= 0), handle, "");
#      |                                                             ^~
#  832|   	result = SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt);
#  833|   
#  834|-> 	do_log(SMB_VFS_OP_SET_QUOTA, (result >= 0), handle, "");
#  835|   
#  836|   	return result;

Error: COMPILER_WARNING: [#def808]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_get_shadow_copy_data’
samba-4.23.4/source3/modules/vfs_full_audit.c:848:72: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  848 |         do_log(SMB_VFS_OP_GET_SHADOW_COPY_DATA, (result >= 0), handle, "");
#      |                                                                        ^~
#  846|   	result = SMB_VFS_NEXT_GET_SHADOW_COPY_DATA(handle, fsp, shadow_copy_data, labels);
#  847|   
#  848|-> 	do_log(SMB_VFS_OP_GET_SHADOW_COPY_DATA, (result >= 0), handle, "");
#  849|   
#  850|   	return result;

Error: COMPILER_WARNING: [#def809]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_statvfs’
samba-4.23.4/source3/modules/vfs_full_audit.c:861:59: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  861 |         do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, "");
#      |                                                           ^~
#  859|   	result = SMB_VFS_NEXT_STATVFS(handle, smb_fname, statbuf);
#  860|   
#  861|-> 	do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, "");
#  862|   
#  863|   	return result;

Error: COMPILER_WARNING: [#def810]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_fs_capabilities’
samba-4.23.4/source3/modules/vfs_full_audit.c:872:58: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  872 |         do_log(SMB_VFS_OP_FS_CAPABILITIES, true, handle, "");
#      |                                                          ^~
#  870|   	result = SMB_VFS_NEXT_FS_CAPABILITIES(handle, p_ts_res);
#  871|   
#  872|-> 	do_log(SMB_VFS_OP_FS_CAPABILITIES, true, handle, "");
#  873|   
#  874|   	return result;

Error: COMPILER_WARNING: [#def811]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_get_dfs_referrals’
samba-4.23.4/source3/modules/vfs_full_audit.c:886:24: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  886 |                handle, "");
#      |                        ^~
#  884|   
#  885|   	do_log(SMB_VFS_OP_GET_DFS_REFERRALS, NT_STATUS_IS_OK(status),
#  886|-> 	       handle, "");
#  887|   
#  888|   	return status;

Error: COMPILER_WARNING: [#def812]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_snap_check_path’
samba-4.23.4/source3/modules/vfs_full_audit.c:967:24: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  967 |                handle, "");
#      |                        ^~
#  965|   					      base_volume);
#  966|   	do_log(SMB_VFS_OP_SNAP_CHECK_PATH, NT_STATUS_IS_OK(status),
#  967|-> 	       handle, "");
#  968|   
#  969|   	return status;

Error: COMPILER_WARNING: [#def813]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_snap_create’
samba-4.23.4/source3/modules/vfs_full_audit.c:984:73: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  984 |         do_log(SMB_VFS_OP_SNAP_CREATE, NT_STATUS_IS_OK(status), handle, "");
#      |                                                                         ^~
#  982|   	status = SMB_VFS_NEXT_SNAP_CREATE(handle, mem_ctx, base_volume, tstamp,
#  983|   					  rw, base_path, snap_path);
#  984|-> 	do_log(SMB_VFS_OP_SNAP_CREATE, NT_STATUS_IS_OK(status), handle, "");
#  985|   
#  986|   	return status;

Error: COMPILER_WARNING: [#def814]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_snap_delete’
samba-4.23.4/source3/modules/vfs_full_audit.c:998:73: warning[-Wformat-zero-length]: zero-length gnu_printf format string
#  998 |         do_log(SMB_VFS_OP_SNAP_DELETE, NT_STATUS_IS_OK(status), handle, "");
#      |                                                                         ^~
#  996|   	status = SMB_VFS_NEXT_SNAP_DELETE(handle, mem_ctx, base_path,
#  997|   					  snap_path);
#  998|-> 	do_log(SMB_VFS_OP_SNAP_DELETE, NT_STATUS_IS_OK(status), handle, "");
#  999|   
# 1000|   	return status;

Error: COMPILER_WARNING: [#def815]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_readdir’
samba-4.23.4/source3/modules/vfs_full_audit.c:1027:50: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 1027 |         do_log(SMB_VFS_OP_READDIR, True, handle, "");
#      |                                                  ^~
# 1025|   	 * (End of dir is also failure), so always succeed.
# 1026|   	 */
# 1027|-> 	do_log(SMB_VFS_OP_READDIR, True, handle, "");
# 1028|   
# 1029|   	return result;

Error: COMPILER_WARNING: [#def816]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_rewinddir’
samba-4.23.4/source3/modules/vfs_full_audit.c:1037:52: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 1037 |         do_log(SMB_VFS_OP_REWINDDIR, True, handle, "");
#      |                                                    ^~
# 1035|   	SMB_VFS_NEXT_REWINDDIR(handle, dirp);
# 1036|   
# 1037|-> 	do_log(SMB_VFS_OP_REWINDDIR, True, handle, "");
# 1038|   }
# 1039|   

Error: COMPILER_WARNING: [#def817]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_closedir’
samba-4.23.4/source3/modules/vfs_full_audit.c:1079:60: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 1079 |         do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, "");
#      |                                                            ^~
# 1077|   	result = SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
# 1078|   
# 1079|-> 	do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, "");
# 1080|   
# 1081|   	return result;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def818]
samba-4.23.4/source3/modules/vfs_full_audit.c:1808:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_full_audit.c:1806:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_full_audit.c:1808:18: throw: if ‘smb_vfs_call_fcntl’ throws an exception...
samba-4.23.4/source3/modules/vfs_full_audit.c:1808:18: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1806|   	va_copy(dup_cmd_arg, cmd_arg);
# 1807|   	arg = va_arg(dup_cmd_arg, void *);
# 1808|-> 	result = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
# 1809|   	va_end(dup_cmd_arg);
# 1810|   

Error: COMPILER_WARNING: [#def819]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_translate_name’
samba-4.23.4/source3/modules/vfs_full_audit.c:2174:76: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2174 |         do_log(SMB_VFS_OP_TRANSLATE_NAME, NT_STATUS_IS_OK(result), handle, "");
#      |                                                                            ^~
# 2172|   					     mapped_name);
# 2173|   
# 2174|-> 	do_log(SMB_VFS_OP_TRANSLATE_NAME, NT_STATUS_IS_OK(result), handle, "");
# 2175|   
# 2176|   	return result;

Error: COMPILER_WARNING: [#def820]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_fsctl’
samba-4.23.4/source3/modules/vfs_full_audit.c:2225:67: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2225 |         do_log(SMB_VFS_OP_FSCTL, NT_STATUS_IS_OK(result), handle, "");
#      |                                                                   ^~
# 2223|   				out_len);
# 2224|   
# 2225|-> 	do_log(SMB_VFS_OP_FSCTL, NT_STATUS_IS_OK(result), handle, "");
# 2226|   
# 2227|   	return result;

Error: COMPILER_WARNING: [#def821]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_offload_read_send’
samba-4.23.4/source3/modules/vfs_full_audit.c:2245:59: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2245 |         do_log(SMB_VFS_OP_OFFLOAD_READ_SEND, req, handle, "");
#      |                                                           ^~
# 2243|   					     fsctl, ttl, offset, to_copy);
# 2244|   
# 2245|-> 	do_log(SMB_VFS_OP_OFFLOAD_READ_SEND, req, handle, "");
# 2246|   
# 2247|   	return req;

Error: COMPILER_WARNING: [#def822]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_offload_read_recv’
samba-4.23.4/source3/modules/vfs_full_audit.c:2263:79: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2263 |         do_log(SMB_VFS_OP_OFFLOAD_READ_RECV, NT_STATUS_IS_OK(status), handle, "");
#      |                                                                               ^~
# 2261|   						flags, xferlen, _token_blob);
# 2262|   
# 2263|-> 	do_log(SMB_VFS_OP_OFFLOAD_READ_RECV, NT_STATUS_IS_OK(status), handle, "");
# 2264|   
# 2265|   	return status;

Error: COMPILER_WARNING: [#def823]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_offload_write_send’
samba-4.23.4/source3/modules/vfs_full_audit.c:2284:60: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2284 |         do_log(SMB_VFS_OP_OFFLOAD_WRITE_SEND, req, handle, "");
#      |                                                            ^~
# 2282|   					   dest_fsp, dest_off, num);
# 2283|   
# 2284|-> 	do_log(SMB_VFS_OP_OFFLOAD_WRITE_SEND, req, handle, "");
# 2285|   
# 2286|   	return req;

Error: COMPILER_WARNING: [#def824]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_offload_write_recv’
samba-4.23.4/source3/modules/vfs_full_audit.c:2297:80: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2297 |         do_log(SMB_VFS_OP_OFFLOAD_WRITE_RECV, NT_STATUS_IS_OK(result), handle, "");
#      |                                                                                ^~
# 2295|   	result = SMB_VFS_NEXT_OFFLOAD_WRITE_RECV(handle, req, copied);
# 2296|   
# 2297|-> 	do_log(SMB_VFS_OP_OFFLOAD_WRITE_RECV, NT_STATUS_IS_OK(result), handle, "");
# 2298|   
# 2299|   	return result;

Error: COMPILER_WARNING: [#def825]
samba-4.23.4/source3/modules/vfs_full_audit.c: scope_hint: In function ‘smb_full_audit_durable_reconnect’
samba-4.23.4/source3/modules/vfs_full_audit.c:2904:25: warning[-Wformat-zero-length]: zero-length gnu_printf format string
# 2904 |                         "");
#      |                         ^~
# 2902|   			NT_STATUS_IS_OK(result),
# 2903|   			handle,
# 2904|-> 			"");
# 2905|   
# 2906|   	return result;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def826]
samba-4.23.4/source3/modules/vfs_gpfs.c:1117:17: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
samba-4.23.4/source3/modules/vfs_gpfs.c:1100:37: acquire_memory: allocated here
samba-4.23.4/source3/modules/vfs_gpfs.c:1101:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
samba-4.23.4/source3/modules/vfs_gpfs.c:1106:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1113:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_gpfs.c:1114:52: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1117:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/modules/vfs_gpfs.c:1117:17: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1115|   		struct gpfs_ace_v1 *g_ace = &result->ace_v1[i];
# 1116|   
# 1117|-> 		DEBUG(10, ("Converting type %d perm %x\n",
# 1118|   			   (int)ace->a_type, (int)ace->a_perm));
# 1119|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def827]
samba-4.23.4/source3/modules/vfs_gpfs.c:1150:25: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
samba-4.23.4/source3/modules/vfs_gpfs.c:1100:37: acquire_memory: allocated here
samba-4.23.4/source3/modules/vfs_gpfs.c:1101:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
samba-4.23.4/source3/modules/vfs_gpfs.c:1106:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1113:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_gpfs.c:1114:52: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1150:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/modules/vfs_gpfs.c:1150:25: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
# 1148|   			break;
# 1149|   		default:
# 1150|-> 			DEBUG(10, ("Got invalid ace_type: %d\n", ace->a_type));
# 1151|   			errno = EINVAL;
# 1152|   			SAFE_FREE(result);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def828]
samba-4.23.4/source3/modules/vfs_gpfs.c:1163:17: warning[-Wanalyzer-malloc-leak]: leak of ‘result’
samba-4.23.4/source3/modules/vfs_gpfs.c:1100:37: acquire_memory: allocated here
samba-4.23.4/source3/modules/vfs_gpfs.c:1101:12: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
samba-4.23.4/source3/modules/vfs_gpfs.c:1106:9: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1113:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_gpfs.c:1114:52: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_gpfs.c:1163:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/modules/vfs_gpfs.c:1163:17: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
# 1161|   			ACL_PERM_EXECUTE : 0;
# 1162|   
# 1163|-> 		DEBUGADD(10, ("Converted to %d id %d perm %x\n",
# 1164|   			      g_ace->ace_type, g_ace->ace_who, g_ace->ace_perm));
# 1165|   	}

Error: COMPILER_WARNING (CWE-704): [#def829]
samba-4.23.4/source3/modules/vfs_media_harmony.c: scope_hint: In function ‘alloc_get_client_path’
samba-4.23.4/source3/modules/vfs_media_harmony.c:410:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  410 |                 (pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#      |                          ^
#  408|   	DEBUG(MH_INFO_DEBUG, ("newPath #1 %s\n", *newPath));
#  409|   	if (
#  410|-> 		(pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#  411|   			&&
#  412|   		(

Error: COMPILER_WARNING (CWE-704): [#def830]
samba-4.23.4/source3/modules/vfs_media_harmony.c:410:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  408|   	DEBUG(MH_INFO_DEBUG, ("newPath #1 %s\n", *newPath));
#  409|   	if (
#  410|-> 		(pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#  411|   			&&
#  412|   		(

Error: GCC_ANALYZER_WARNING (CWE-401): [#def831]
samba-4.23.4/source3/modules/vfs_recycle.c:291:9: warning[-Wanalyzer-malloc-leak]: leak of ‘tmp_str’
samba-4.23.4/source3/modules/vfs_recycle.c:285:19: acquire_memory: allocated here
samba-4.23.4/source3/modules/vfs_recycle.c:286:9: branch_false: following ‘false’ branch (when ‘tmp_str’ is non-NULL)...
samba-4.23.4/source3/modules/vfs_recycle.c:289:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_recycle.c:291:9: branch_true: following ‘true’ branch (when ‘new_dir’ is NULL)...
samba-4.23.4/source3/modules/vfs_recycle.c:291:9: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_recycle.c:291:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/modules/vfs_recycle.c:291:9: danger: ‘tmp_str’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  289|   	len = strlen(dname)+1;
#  290|   	new_dir = (char *)SMB_MALLOC(len + 1);
#  291|-> 	ALLOC_CHECK(new_dir, done);
#  292|   	*new_dir = '\0';
#  293|   	if (dname[0] == '/') {

Error: COMPILER_WARNING (CWE-704): [#def832]
samba-4.23.4/source3/modules/vfs_shadow_copy2.c: scope_hint: In function ‘shadow_copy2_connect’
samba-4.23.4/source3/modules/vfs_shadow_copy2.c:3131:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3131 |                         p = strstr(basedir, config->mount_point);
#      |                           ^
# 3129|   		} else {
# 3130|   			char *p;
# 3131|-> 			p = strstr(basedir, config->mount_point);
# 3132|   			if (p != basedir) {
# 3133|   				DEBUG(1, ("Warning: basedir (%s) is not a "

Error: COMPILER_WARNING (CWE-704): [#def833]
samba-4.23.4/source3/modules/vfs_shadow_copy2.c:3131:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3129|   		} else {
# 3130|   			char *p;
# 3131|-> 			p = strstr(basedir, config->mount_point);
# 3132|   			if (p != basedir) {
# 3133|   				DEBUG(1, ("Warning: basedir (%s) is not a "

Error: GCC_ANALYZER_WARNING (CWE-476): [#def834]
samba-4.23.4/source3/modules/vfs_streams_depot.c:384:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘stream_dir_parent_fname’
samba-4.23.4/source3/modules/vfs_streams_depot.c:313:12: enter_function: entry to ‘stream_dir_remove_invalid’
samba-4.23.4/source3/modules/vfs_streams_depot.c:323:30: release_memory: ‘stream_dir_parent_fname’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:329:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:341:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:341:15: call_function: calling ‘stream_dir_parent_pathref’ from ‘stream_dir_remove_invalid’
samba-4.23.4/source3/modules/vfs_streams_depot.c:341:15: return_function: returning to ‘stream_dir_remove_invalid’ from ‘stream_dir_parent_pathref’
samba-4.23.4/source3/modules/vfs_streams_depot.c:347:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:351:26: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:351:26: release_memory: ‘stream_dir_parent_fname’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:358:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:358:12: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:379:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:384:23: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:384:23: danger: dereference of NULL ‘stream_dir_parent_fname’
#  382|   		}
#  383|   
#  384|-> 		ret = SMB_VFS_NEXT_RENAMEAT(handle,
#  385|   					    stream_dir_parent_fname->fsp,
#  386|   					    stream_dir_old,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def835]
samba-4.23.4/source3/modules/vfs_streams_depot.c:447:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rootdir_pathref’
samba-4.23.4/source3/modules/vfs_streams_depot.c:550:17: enter_function: entry to ‘walk_streams’
samba-4.23.4/source3/modules/vfs_streams_depot.c:557:30: release_memory: ‘stream_dir’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:564:15: call_function: calling ‘stream_dir_pathref’ from ‘walk_streams’
#  445|   	}
#  446|   
#  447|-> 	status = openat_pathref_fsp(rootdir_pathref->fsp, result);
#  448|   	if (NT_STATUS_IS_OK(status)) {
#  449|   		if (config->check_valid && !stream_dir_valid(conn, base->fsp))

Error: GCC_ANALYZER_WARNING (CWE-476): [#def836]
samba-4.23.4/source3/modules/vfs_streams_depot.c:903:23: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘rootdir_pathref’
samba-4.23.4/source3/modules/vfs_streams_depot.c:871:12: enter_function: entry to ‘streams_depot_unlinkat’
samba-4.23.4/source3/modules/vfs_streams_depot.c:878:30: release_memory: ‘rootdir_pathref’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:879:30: release_memory: ‘rootdir_pathref’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:884:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:889:15: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:891:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:894:42: branch_false: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:896:15: call_function: calling ‘streams_depot_rootdir_pathref’ from ‘streams_depot_unlinkat’
samba-4.23.4/source3/modules/vfs_streams_depot.c:896:15: return_function: returning to ‘streams_depot_unlinkat’ from ‘streams_depot_rootdir_pathref’
samba-4.23.4/source3/modules/vfs_streams_depot.c:902:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/modules/vfs_streams_depot.c:906:64: branch_true: ...to here
samba-4.23.4/source3/modules/vfs_streams_depot.c:906:64: release_memory: ‘rootdir_pathref’ is NULL
samba-4.23.4/source3/modules/vfs_streams_depot.c:903:23: danger: dereference of NULL ‘rootdir_pathref’
#  901|   					    &rootdir_pathref);
#  902|   	if (ret == 0) {
#  903|-> 		ret = stream_dir_parent_pathref(talloc_tos(),
#  904|   						smb_fname->twrp,
#  905|   						smb_fname->flags,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def837]
samba-4.23.4/source3/modules/vfs_streams_xattr.c:1655:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_streams_xattr.c:1652:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_streams_xattr.c:1655:15: throw: if ‘smb_vfs_call_fcntl’ throws an exception...
samba-4.23.4/source3/modules/vfs_streams_xattr.c:1655:15: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1653|   	arg = va_arg(dup_cmd_arg, void *);
# 1654|   
# 1655|-> 	ret = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
# 1656|   
# 1657|   	va_end(dup_cmd_arg);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def838]
samba-4.23.4/source3/modules/vfs_time_audit.c:1376:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_time_audit.c:1374:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_time_audit.c:1376:9: throw: if ‘clock_gettime_mono’ throws an exception...
samba-4.23.4/source3/modules/vfs_time_audit.c:1376:9: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1374|   	va_copy(dup_cmd_arg, cmd_arg);
# 1375|   	arg = va_arg(dup_cmd_arg, void *);
# 1376|-> 	clock_gettime_mono(&ts1);
# 1377|   	result = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
# 1378|   	clock_gettime_mono(&ts2);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def839]
samba-4.23.4/source3/modules/vfs_time_audit.c:1377:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_time_audit.c:1374:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_time_audit.c:1377:18: throw: if ‘smb_vfs_call_fcntl’ throws an exception...
samba-4.23.4/source3/modules/vfs_time_audit.c:1377:18: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 1375|   	arg = va_arg(dup_cmd_arg, void *);
# 1376|   	clock_gettime_mono(&ts1);
# 1377|-> 	result = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
# 1378|   	clock_gettime_mono(&ts2);
# 1379|   	va_end(dup_cmd_arg);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def840]
samba-4.23.4/source3/modules/vfs_time_audit.c:1378:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/modules/vfs_time_audit.c:1374:9: acquire_resource: ‘va_copy’ called here
samba-4.23.4/source3/modules/vfs_time_audit.c:1378:9: throw: if ‘clock_gettime_mono’ throws an exception...
samba-4.23.4/source3/modules/vfs_time_audit.c:1378:9: danger: missing call to ‘va_end’ to match ‘va_copy’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 1376|   	clock_gettime_mono(&ts1);
# 1377|   	result = SMB_VFS_NEXT_FCNTL(handle, fsp, cmd, arg);
# 1378|-> 	clock_gettime_mono(&ts2);
# 1379|   	va_end(dup_cmd_arg);
# 1380|   

Error: COMPILER_WARNING (CWE-704): [#def841]
samba-4.23.4/source3/modules/vfs_virusfilter.c: scope_hint: In function ‘virusfilter_vfs_connect’
samba-4.23.4/source3/modules/vfs_virusfilter.c:375:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  375 |                 sret = strstr(config->quarantine_prefix, "/");
#      |                      ^
#  373|   	 */
#  374|   	if (config->quarantine_prefix != NULL) {
#  375|-> 		sret = strstr(config->quarantine_prefix, "/");
#  376|   		if (sret != NULL) {
#  377|   			DBG_ERR("quarantine prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def842]
samba-4.23.4/source3/modules/vfs_virusfilter.c:375:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  373|   	 */
#  374|   	if (config->quarantine_prefix != NULL) {
#  375|-> 		sret = strstr(config->quarantine_prefix, "/");
#  376|   		if (sret != NULL) {
#  377|   			DBG_ERR("quarantine prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def843]
samba-4.23.4/source3/modules/vfs_virusfilter.c:386:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  386 |                 sret = strstr(config->quarantine_suffix, "/");
#      |                      ^
#  384|   	}
#  385|   	if (config->quarantine_suffix != NULL) {
#  386|-> 		sret = strstr(config->quarantine_suffix, "/");
#  387|   		if (sret != NULL) {
#  388|   			DBG_ERR("quarantine suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def844]
samba-4.23.4/source3/modules/vfs_virusfilter.c:386:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  384|   	}
#  385|   	if (config->quarantine_suffix != NULL) {
#  386|-> 		sret = strstr(config->quarantine_suffix, "/");
#  387|   		if (sret != NULL) {
#  388|   			DBG_ERR("quarantine suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def845]
samba-4.23.4/source3/modules/vfs_virusfilter.c:430:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  430 |                 sret = strstr(config->rename_prefix, "/");
#      |                      ^
#  428|   	 */
#  429|   	if (config->rename_prefix != NULL) {
#  430|-> 		sret = strstr(config->rename_prefix, "/");
#  431|   		if (sret != NULL) {
#  432|   			DBG_ERR("rename prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def846]
samba-4.23.4/source3/modules/vfs_virusfilter.c:430:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  428|   	 */
#  429|   	if (config->rename_prefix != NULL) {
#  430|-> 		sret = strstr(config->rename_prefix, "/");
#  431|   		if (sret != NULL) {
#  432|   			DBG_ERR("rename prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def847]
samba-4.23.4/source3/modules/vfs_virusfilter.c:441:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  441 |                 sret = strstr(config->rename_suffix, "/");
#      |                      ^
#  439|   	}
#  440|   	if (config->rename_suffix != NULL) {
#  441|-> 		sret = strstr(config->rename_suffix, "/");
#  442|   		if (sret != NULL) {
#  443|   			DBG_ERR("rename suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def848]
samba-4.23.4/source3/modules/vfs_virusfilter.c:441:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  439|   	}
#  440|   	if (config->rename_suffix != NULL) {
#  441|-> 		sret = strstr(config->rename_suffix, "/");
#  442|   		if (sret != NULL) {
#  443|   			DBG_ERR("rename suffix must not contain directory "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def849]
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:215:17: warning[-Wanalyzer-malloc-leak]: leak of ‘userdata’
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:201:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:205:58: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:205:58: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:205:19: branch_false: following ‘false’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:210:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:215:17: throw: if ‘release_name’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:215:17: danger: ‘userdata’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  213|   		memcpy((char *)userdata->data, &force_new_election, sizeof(bool));
#  214|   
#  215|-> 		release_name(subrec, namerec,
#  216|   			unbecome_local_master_success,
#  217|   			unbecome_local_master_fail,

Error: COMPILER_WARNING: [#def850]
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c: scope_hint: In function ‘become_local_master_browser’
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:549:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  549 |         strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:24: included_from: Included from here.
samba-4.23.4/source3/nmbd/nmbd.h:212:14: note: destination object ‘data’ of size 16
#  212 |         char data[16]; /* 16 is to ensure alignment/padding on all systems */
#      |              ^~~~
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
samba-4.23.4/lib/replace/replace.h:48: included_from: Included from here.
samba-4.23.4/source3/include/includes.h:23: included_from: Included from here.
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:23: included_from: Included from here.
/usr/include/bits/string_fortified.h:173:1: note: in a call to function ‘strlcpy’ declared with attribute ‘access (write_only, 1, 3)’
#  173 | __NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
#      | ^~~~~
#  547|   	userdata->free_fn = NULL;
#  548|   	userdata->userdata_len = strlen(work->work_group)+1;
#  549|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  550|   
#  551|   	/* Register the special browser group name. */

Error: COMPILER_WARNING: [#def851]
samba-4.23.4/source3/nmbd/nmbd_become_lmb.c:549:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  547|   	userdata->free_fn = NULL;
#  548|   	userdata->userdata_len = strlen(work->work_group)+1;
#  549|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  550|   
#  551|   	/* Register the special browser group name. */

Error: COMPILER_WARNING: [#def852]
samba-4.23.4/source3/nmbd/nmbd_browsesync.c: scope_hint: In function ‘find_domain_master_name_query_success’
samba-4.23.4/source3/nmbd/nmbd_browsesync.c:337:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  337 |         strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source3/nmbd/nmbd_browsesync.c:24: included_from: Included from here.
samba-4.23.4/source3/nmbd/nmbd.h:212:14: note: destination object ‘data’ of size 16
#  212 |         char data[16]; /* 16 is to ensure alignment/padding on all systems */
#      |              ^~~~
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
samba-4.23.4/lib/replace/replace.h:48: included_from: Included from here.
samba-4.23.4/source3/include/includes.h:23: included_from: Included from here.
samba-4.23.4/source3/nmbd/nmbd_browsesync.c:23: included_from: Included from here.
/usr/include/bits/string_fortified.h:173:1: note: in a call to function ‘strlcpy’ declared with attribute ‘access (write_only, 1, 3)’
#  173 | __NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
#      | ^~~~~
#  335|   	userdata->free_fn = NULL;
#  336|   	userdata->userdata_len = strlen(work->work_group)+1;
#  337|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  338|   
#  339|   	node_status( subrec, &nmbname, answer_ip, 

Error: COMPILER_WARNING: [#def853]
samba-4.23.4/source3/nmbd/nmbd_browsesync.c:337:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  335|   	userdata->free_fn = NULL;
#  336|   	userdata->userdata_len = strlen(work->work_group)+1;
#  337|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  338|   
#  339|   	node_status( subrec, &nmbname, answer_ip, 

Error: GCC_ANALYZER_WARNING (CWE-401): [#def854]
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:529:33: warning[-Wanalyzer-malloc-leak]: leak of ‘prdata’
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:469:12: branch_true: following ‘true’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:470:15: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:519:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:55: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:55: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:36: branch_false: following ‘false’ branch (when ‘prdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:528:25: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:528:37: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:529:33: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:529:33: throw: if ‘set_nb_flags’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:529:33: danger: ‘prdata’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  527|   
#  528|   			for (i = 0; i < namerec->data.num_ips; i++) {
#  529|-> 				set_nb_flags(&prdata[i*6],namerec->data.nb_flags);
#  530|   				putip((char *)&prdata[2+(i*6)], &namerec->data.ip[i]);
#  531|   			}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def855]
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:533:25: warning[-Wanalyzer-malloc-leak]: leak of ‘prdata’
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:469:12: branch_true: following ‘true’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:470:15: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:519:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:55: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:55: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:522:36: branch_false: following ‘false’ branch (when ‘prdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:528:25: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:528:37: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:533:25: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:533:25: throw: if ‘sort_query_replies’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_incomingrequests.c:533:25: danger: ‘prdata’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  531|   			}
#  532|   
#  533|-> 			sort_query_replies(prdata, i, p->ip);
#  534|   
#  535|   			reply_data_len = namerec->data.num_ips * 6;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def856]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:215:28: warning[-Wanalyzer-malloc-leak]: leak of ‘namerec’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:204:12: branch_false: following ‘false’ branch (when ‘num_ips != 0’)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:209:11: branch_false: following ‘false’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:214:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:215:28: throw: if ‘malloc_array’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:215:28: danger: ‘namerec’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  213|   
#  214|   	memset( (char *)namerec, '\0', sizeof(*namerec) );
#  215|-> 	namerec->data.ip = SMB_MALLOC_ARRAY( struct in_addr, num_ips );
#  216|   	if( NULL == namerec->data.ip ) {
#  217|   		DEBUG( 0, ( "add_name_to_subnet: malloc fail when creating ip_flgs.\n" ) );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def857]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:217:17: warning[-Wanalyzer-malloc-leak]: leak of ‘namerec’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:204:12: branch_false: following ‘false’ branch (when ‘num_ips != 0’)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:209:11: branch_false: following ‘false’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:214:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:216:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:217:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:217:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:217:17: danger: ‘namerec’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  215|   	namerec->data.ip = SMB_MALLOC_ARRAY( struct in_addr, num_ips );
#  216|   	if( NULL == namerec->data.ip ) {
#  217|-> 		DEBUG( 0, ( "add_name_to_subnet: malloc fail when creating ip_flgs.\n" ) );
#  218|   		ZERO_STRUCTP(namerec);
#  219|   		SAFE_FREE(namerec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def858]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:218:17: warning[-Wanalyzer-malloc-leak]: leak of ‘namerec’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:204:12: branch_false: following ‘false’ branch (when ‘num_ips != 0’)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:209:11: branch_false: following ‘false’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:214:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:216:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:217:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:218:17: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:218:17: danger: ‘namerec’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  216|   	if( NULL == namerec->data.ip ) {
#  217|   		DEBUG( 0, ( "add_name_to_subnet: malloc fail when creating ip_flgs.\n" ) );
#  218|-> 		ZERO_STRUCTP(namerec);
#  219|   		SAFE_FREE(namerec);
#  220|   		return False;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def859]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:225:9: warning[-Wanalyzer-malloc-leak]: leak of ‘namerec’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:204:12: branch_false: following ‘false’ branch (when ‘num_ips != 0’)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:208:19: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:209:11: branch_false: following ‘false’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:214:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:216:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:223:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:225:9: throw: if ‘make_nmb_name’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:225:9: danger: ‘namerec’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  223|   	namerec->subnet = subrec;
#  224|   
#  225|-> 	make_nmb_name(&namerec->name, name, type);
#  226|   	if (!upcase_name(&namerec->name, NULL )) {
#  227|   		SAFE_FREE(namerec->data.ip);

Error: CPPCHECK_WARNING (CWE-590): [#def860]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:541: error[autovarInvalidDeallocation]: Deallocation of an auto-variable (.) results in undefined behaviour.
#  539|   
#  540|   	if(iplist != &subrec->myip) {
#  541|-> 		SAFE_FREE(iplist);
#  542|   	}
#  543|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def861]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:555:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:643:6: enter_function: entry to ‘dump_all_namelists’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:651:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:656:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:657:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:662:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:664:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:665:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:673:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:673:17: call_function: calling ‘dump_subnet_namelist’ from ‘dump_all_namelists’
#  553|   	int i;
#  554|   
#  555|-> 	fprintf(fp,"\tName = %s\t", nmb_namestr(&namerec->name));
#  556|   	switch(namerec->data.source) {
#  557|   		case LMHOSTS_NAME:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def862]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:54: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:651:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:656:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:657:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:662:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:664:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:665:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:673:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:54: throw: if ‘get_next_subnet_maybe_unicast’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:54: danger: ‘fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  670|   	fd = -1;
#  671|   
#  672|-> 	for (subrec = FIRST_SUBNET; subrec; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) {
#  673|   		dump_subnet_namelist( subrec, fp );
#  674|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def863]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:676:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:651:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:656:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:657:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:662:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:664:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:665:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:676:14: throw: if ‘we_are_a_wins_client’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:676:14: danger: ‘fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  674|   	}
#  675|   
#  676|-> 	if (!we_are_a_wins_client()) {
#  677|   		dump_subnet_namelist( unicast_subnet, fp );
#  678|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def864]
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:685:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:651:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:656:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:657:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:662:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:664:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:665:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:672:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:684:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:685:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:685:17: throw: if ‘dump_wins_subnet_namelist’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_namelistdb.c:685:17: danger: ‘fp’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  683|   
#  684|   	if (wins_server_subnet != NULL) {
#  685|-> 		dump_wins_subnet_namelist(fp );
#  686|   	}
#  687|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def865]
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:325:9: warning[-Wanalyzer-malloc-leak]: leak of ‘userdata’
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:320:46: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:321:12: branch_false: following ‘false’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:325:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:325:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_nameregister.c:325:9: danger: ‘userdata’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  323|   		return;
#  324|   	}
#  325|-> 	ZERO_STRUCTP(userdata);
#  326|   	userdata->userdata_len = strlen(tag) + 1;
#  327|   	strlcpy(userdata->data, tag, userdata->userdata_len);	

Error: GCC_ANALYZER_WARNING (CWE-401): [#def866]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:46:35: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:78:6: enter_function: entry to ‘process_logon_packet’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:272:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:22: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:284:29: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:285:21: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:285:21: call_function: calling ‘delay_logon’ from ‘process_logon_packet’
#   44|   static bool delay_logon(const char *peer_name, const char *peer_addr)
#   45|   {
#   46|-> 	const char **delay_list = lp_init_logon_delayed_hosts();
#   47|   	const char *peer[2];
#   48|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def867]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:56:16: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:78:6: enter_function: entry to ‘process_logon_packet’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:272:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:22: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:284:29: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:285:21: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:285:21: call_function: calling ‘delay_logon’ from ‘process_logon_packet’
#   54|   	peer[1] = peer_addr;
#   55|   
#   56|-> 	return list_match(delay_list, (const char *)peer, client_match);
#   57|   }
#   58|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def868]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  237|   		}
#  238|   
#  239|-> 		DEBUG(5,("process_logon_packet: LOGON_SAM_LOGON_REQUEST request from %s(%s) for %s, returning logon svr %s domain %s code %x token=%x\n",
#  240|   			request.req.logon.computer_name,
#  241|   			inet_ntoa(p->ip),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def869]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:256:43: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:256:43: throw: if ‘lp_workgroup’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:256:43: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8)
#  254|   		nt4.pdc_name		= pdc_name;
#  255|   		nt4.user_name		= request.req.logon.user_name;
#  256|-> 		nt4.domain_name		= lp_workgroup();
#  257|   		nt4.nt_version		= NETLOGON_NT_VERSION_1;
#  258|   		nt4.lmnt_token		= 0xffff;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def870]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:264:21: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:264:21: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:264:21: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  262|   		samlogon.data.nt4 = nt4;
#  263|   		
#  264|-> 		if (DEBUGLEVEL >= 10) {
#  265|   			NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &nt4);
#  266|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def871]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:265:25: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:264:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:265:25: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:265:25: throw: if ‘ndr_print_debug’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:265:25: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#  263|   		
#  264|   		if (DEBUGLEVEL >= 10) {
#  265|-> 			NDR_PRINT_DEBUG(NETLOGON_SAM_LOGON_RESPONSE_NT40, &nt4);
#  266|   		}
#  267|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def872]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:271:26: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:271:26: throw: if ‘_talloc_tos’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:271:26: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
#  269|   		response.data.samlogon = samlogon;
#  270|   
#  271|-> 		status = push_nbt_netlogon_response(&blob_out, talloc_tos(), &response);
#  272|   		if (!NT_STATUS_IS_OK(status)) {
#  273|   			DEBUG(0,("process_logon_packet: failed to push packet\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def873]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:273:25: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:272:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:273:25: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:273:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:273:25: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  271|   		status = push_nbt_netlogon_response(&blob_out, talloc_tos(), &response);
#  272|   		if (!NT_STATUS_IS_OK(status)) {
#  273|-> 			DEBUG(0,("process_logon_packet: failed to push packet\n"));
#  274|   			SAFE_FREE(source_addr);
#  275|   			return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def874]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:304:25: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:272:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:22: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:304:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:304:25: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8)
#  302|   					p);
#  303|   		} else {
#  304|-> 			DEBUG(3, ("process_logon_packet: "
#  305|   				  "processing delayed initial "
#  306|   				  "logon reply for client "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def875]
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:310:25: warning[-Wanalyzer-malloc-leak]: leak of ‘source_addr’
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:102:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:117:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:123:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:128:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:232:31: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:233:20: branch_false: following ‘false’ branch (when ‘source_addr’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:239:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:272:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:283:22: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:310:25: throw: if ‘lp_netbios_name’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_processlogon.c:310:25: danger: ‘source_addr’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  308|   				  source_name, source_addr));
#  309|   			p->locked = false;
#  310|-> 			send_mailslot(true, request.req.logon.mailslot_name,
#  311|   				(char *)blob_out.data,
#  312|   				blob_out.length,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def876]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:37:9: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:93:25: enter_function: entry to ‘make_response_record’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_false: following ‘false’ branch (when ‘userdata’ is NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:147:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:162:9: call_function: calling ‘add_response_record’ from ‘make_response_record’
#   35|   	num_response_packets++; /* count of total number of packets still around */
#   36|   
#   37|-> 	DEBUG(4,("add_response_record: adding response record id:%hu to subnet %s. num_records:%d\n",
#   38|   		rrec->response_id, subrec->subnet_name, num_response_packets));
#   39|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def877]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_true: following ‘true’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:20: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: throw: if the called function throws an exception...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: danger: ‘rrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  121|   		/* Intelligent userdata. */
#  122|   		if(userdata->copy_fn) {
#  123|-> 			if((rrec->userdata = (*userdata->copy_fn)(userdata)) == NULL) {
#  124|   				DEBUG(0,("make_response_queue_record: copy fail for userdata.\n"));
#  125|   				ZERO_STRUCTP(rrec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def878]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:124:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_true: following ‘true’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:20: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:27: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:124:33: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:124:33: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:124:33: danger: ‘rrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  122|   		if(userdata->copy_fn) {
#  123|   			if((rrec->userdata = (*userdata->copy_fn)(userdata)) == NULL) {
#  124|-> 				DEBUG(0,("make_response_queue_record: copy fail for userdata.\n"));
#  125|   				ZERO_STRUCTP(rrec);
#  126|   				SAFE_FREE(rrec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def879]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:125:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_true: following ‘true’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:20: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:46: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:123:27: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:124:33: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:125:33: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:125:33: danger: ‘rrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  123|   			if((rrec->userdata = (*userdata->copy_fn)(userdata)) == NULL) {
#  124|   				DEBUG(0,("make_response_queue_record: copy fail for userdata.\n"));
#  125|-> 				ZERO_STRUCTP(rrec);
#  126|   				SAFE_FREE(rrec);
#  127|   				return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def880]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:133:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_true: following ‘true’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:20: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:132:41: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:131:27: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:133:33: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:133:33: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:133:33: danger: ‘rrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  131|   			if((rrec->userdata = (struct userdata_struct *)
#  132|   					SMB_MALLOC(sizeof(struct userdata_struct)+userdata->userdata_len)) == NULL) {
#  133|-> 				DEBUG(0,("make_response_queue_record: malloc fail for userdata.\n"));
#  134|   				ZERO_STRUCTP(rrec);
#  135|   				SAFE_FREE(rrec);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def881]
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:134:33: warning[-Wanalyzer-malloc-leak]: leak of ‘rrec’
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:22: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:104:12: branch_false: following ‘false’ branch (when ‘rrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:109:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:120:11: branch_true: following ‘true’ branch (when ‘userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:20: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:122:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:132:41: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:131:27: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:133:33: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:134:33: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_responserecordsdb.c:134:33: danger: ‘rrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  132|   					SMB_MALLOC(sizeof(struct userdata_struct)+userdata->userdata_len)) == NULL) {
#  133|   				DEBUG(0,("make_response_queue_record: malloc fail for userdata.\n"));
#  134|-> 				ZERO_STRUCTP(rrec);
#  135|   				SAFE_FREE(rrec);
#  136|   				return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def882]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:71:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:265:6: enter_function: entry to ‘write_browse_list’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:367:39: call_function: calling ‘find_server_in_workgroup’ from ‘write_browse_list’
#   69|     
#   70|   	for (ret = work->serverlist; ret; ret = ret->next) {
#   71|-> 		if (strequal(ret->serv.name,name))
#   72|   			return ret;
#   73|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def883]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:190:68: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:265:6: enter_function: entry to ‘write_browse_list’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:379:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:400:45: call_function: calling ‘write_this_server_name’ from ‘write_browse_list’
#  188|   
#  189|   	/* Go through all the subnets we have already seen. */
#  190|-> 	for (ssub = FIRST_SUBNET; ssub && (ssub != subrec); ssub = NEXT_SUBNET_INCLUDING_UNICAST(ssub)) {
#  191|   		for(iwork = ssub->workgrouplist; iwork; iwork = iwork->next) {
#  192|   			if(find_server_in_workgroup( iwork, servrec->serv.name) != NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def884]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:225:12: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:265:6: enter_function: entry to ‘write_browse_list’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:379:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:383:44: call_function: calling ‘write_this_workgroup_name’ from ‘write_browse_list’
#  223|   	struct subnet_record *ssub;
#  224|   
#  225|-> 	if(strequal(lp_workgroup(), work->work_group))
#  226|   		return 0;
#  227|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def885]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:238:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:265:6: enter_function: entry to ‘write_browse_list’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:379:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:383:44: call_function: calling ‘write_this_workgroup_name’ from ‘write_browse_list’
#  236|   			this subnet when we passed over the broadcast subnets. */
#  237|   
#  238|-> 		if(find_workgroup_on_subnet( ssub, work->work_group) != NULL)
#  239|   			return 0;
#  240|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def886]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: throw: if ‘lp_workgroup’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8)
#  339|   	 */
#  340|   
#  341|-> 	if((work = find_workgroup_on_subnet(FIRST_SUBNET, lp_workgroup())) == NULL) { 
#  342|   		DEBUG(0,("write_browse_list: Fatal error - cannot find my workgroup %s\n",
#  343|   			lp_workgroup()));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def887]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:342:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:342:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:342:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:342:17: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#  340|   
#  341|   	if((work = find_workgroup_on_subnet(FIRST_SUBNET, lp_workgroup())) == NULL) { 
#  342|-> 		DEBUG(0,("write_browse_list: Fatal error - cannot find my workgroup %s\n",
#  343|   			lp_workgroup()));
#  344|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def888]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: throw: if ‘my_netbios_names’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8)
#  360|   	 */
#  361|   
#  362|-> 	for (i=0; my_netbios_names(i); i++) {
#  363|   		stype = 0;
#  364|   		for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def889]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:63: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:63: throw: if ‘get_next_subnet_maybe_unicast’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:63: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#  362|   	for (i=0; my_netbios_names(i); i++) {
#  363|   		stype = 0;
#  364|-> 		for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) {
#  365|   			if((work = find_workgroup_on_subnet( subrec, lp_workgroup() )) == NULL)
#  366|   				continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def890]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:365:36: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:365:36: throw: if ‘lp_workgroup’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:365:36: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8)
#  363|   		stype = 0;
#  364|   		for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) {
#  365|-> 			if((work = find_workgroup_on_subnet( subrec, lp_workgroup() )) == NULL)
#  366|   				continue;
#  367|   			if((servrec = find_server_in_workgroup( work, my_netbios_names(i))) == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def891]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:367:39: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:367:39: throw: if ‘my_netbios_names’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:367:39: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/8)
#  365|   			if((work = find_workgroup_on_subnet( subrec, lp_workgroup() )) == NULL)
#  366|   				continue;
#  367|-> 			if((servrec = find_server_in_workgroup( work, my_netbios_names(i))) == NULL)
#  368|   				continue;
#  369|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def892]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:374:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:45: branch_false: following ‘false’ branch (when ‘subrec’ is NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:374:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:374:17: throw: if ‘lp_workgroup’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:374:17: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
#  372|   
#  373|   		/* Output server details, plus what workgroup they're in. */
#  374|-> 		write_browse_list_entry(fp, my_netbios_names(i), stype,
#  375|   			string_truncate(lp_server_string(talloc_tos(), lp_sub), MAX_SERVER_STRING_LENGTH), lp_workgroup());
#  376|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def893]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:375:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:362:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:364:45: branch_false: following ‘false’ branch (when ‘subrec’ is NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:374:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:375:25: throw: if ‘_talloc_tos’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:375:25: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/8)
#  373|   		/* Output server details, plus what workgroup they're in. */
#  374|   		write_browse_list_entry(fp, my_netbios_names(i), stype,
#  375|-> 			string_truncate(lp_server_string(talloc_tos(), lp_sub), MAX_SERVER_STRING_LENGTH), lp_workgroup());
#  376|   	}
#  377|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def894]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:55: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:379:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:381:52: branch_false: following ‘false’ branch (when ‘work’ is NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:55: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:55: throw: if ‘get_next_subnet_maybe_unicast’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:55: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/8)
#  376|   	}
#  377|   
#  378|-> 	for (subrec = FIRST_SUBNET; subrec ; subrec = NEXT_SUBNET_INCLUDING_UNICAST(subrec)) { 
#  379|   		subrec->work_changed = False;
#  380|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def895]
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:397:36: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:301:11: branch_true: following ‘true’ branch (when ‘list_changed != 0’)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:304:9: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:307:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:310:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:317:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:326:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:327:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:341:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:352:50: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:378:37: branch_true: following ‘true’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:379:17: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:397:36: throw: if ‘is_myname’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_serverlistdb.c:397:36: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/8)
#  395|   
#  396|   				/* We have already written our names here. */
#  397|-> 				if(is_myname(servrec->serv.name))
#  398|   					continue;
#  399|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def896]
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:172:9: warning[-Wanalyzer-malloc-leak]: leak of ‘subrec’
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:166:18: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:167:12: branch_false: following ‘false’ branch (when ‘subrec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:172:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:172:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_subnetdb.c:172:9: danger: ‘subrec’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  170|   	}
#  171|     
#  172|-> 	ZERO_STRUCTP(subrec);
#  173|   
#  174|   	if((subrec->subnet_name = SMB_STRDUP(name)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def897]
samba-4.23.4/source3/nmbd/nmbd_synclists.c:169:9: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/nmbd/nmbd_synclists.c:161:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:166:13: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:166:13: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:167:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:169:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:169:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:169:9: danger: ‘s’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  167|   	if (!s) goto done;
#  168|   
#  169|-> 	ZERO_STRUCTP(s);
#  170|   
#  171|   	unstrcpy(s->workgroup, work->work_group);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def898]
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*s.fname, "r")’
samba-4.23.4/source3/nmbd/nmbd_synclists.c:281:13: acquire_resource: opened here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:283:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:283:12: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:286:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: danger: ‘fopen(*s.fname, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  287|   		TALLOC_CTX *frame = NULL;
#  288|   
#  289|-> 		if (!fgets_slash(NULL, line, sizeof(line), f))
#  290|   			continue;
#  291|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def899]
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*s.fname, "r")’
samba-4.23.4/source3/nmbd/nmbd_synclists.c:281:13: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:283:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:283:12: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:286:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_synclists.c:289:22: danger: ‘fopen(*s.fname, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  287|   		TALLOC_CTX *frame = NULL;
#  288|   
#  289|-> 		if (!fgets_slash(NULL, line, sizeof(line), f))
#  290|   			continue;
#  291|   

Error: CPPCHECK_WARNING (CWE-590): [#def900]
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:89: error[autovarInvalidDeallocation]: Deallocation of an auto-variable (ip) results in undefined behaviour.
#   87|   
#   88|   	if(iplist != &ip) {
#   89|-> 		SAFE_FREE(iplist);
#   90|   	}
#   91|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def901]
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:167:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_userdata’
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:151:74: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:153:11: branch_false: following ‘false’ branch (when ‘new_userdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:156:33: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:167:25: throw: if ‘copy_packet’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsproxy.c:167:25: danger: ‘new_userdata’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  165|   
#  166|   	/* Do a deep copy of the packet. */
#  167|-> 	if((copy_of_p = copy_packet(p)) == NULL) {
#  168|   		SAFE_FREE(new_userdata);
#  169|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def902]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:120:9: warning[-Wanalyzer-malloc-leak]: leak of ‘namerec’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2440:12: enter_function: entry to ‘wins_writedb_traverse_fn’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2445:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2449:19: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2449:19: call_function: calling ‘wins_record_to_name_record’ from ‘wins_writedb_traverse_fn’
#  118|   		return NULL;
#  119|   	}
#  120|-> 	ZERO_STRUCTP(namerec);
#  121|   
#  122|   	namerec->data.ip = SMB_MALLOC_ARRAY(struct in_addr, num_ips);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def903]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:185:15: warning[-Wanalyzer-malloc-leak]: leak of ‘data.dptr’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:283:13: enter_function: entry to ‘store_or_replace_wins_namerec’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:293:16: call_function: calling ‘name_record_to_wins_record’ from ‘store_or_replace_wins_namerec’
#  183|   	data.dsize = len;
#  184|   
#  185|-> 	len = tdb_pack(data.dptr, data.dsize, "wbddddddd",
#  186|                           namerec->data.nb_flags,
#  187|                           (unsigned char)namerec->data.source,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def904]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(state_path(_talloc_tos("../../source3/nmbd/nmbd_winsserver.c:626"), "wins.dat"), "r")’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:603:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:607:19: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:608:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:613:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:616:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:622:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:627:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:632:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:632:14: acquire_resource: opened here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:634:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:634:12: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:640:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:641:23: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: danger: ‘fopen(state_path(_talloc_tos("../../source3/nmbd/nmbd_winsserver.c:626"), "wins.dat"), "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#  659|   		/* Read a line from the wins.dat file. Strips whitespace
#  660|   			from the beginning and end of the line.  */
#  661|-> 		if (!fgets_slash(NULL, line, sizeof(line), fp)) {
#  662|   			continue;
#  663|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def905]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(state_path(_talloc_tos("../../source3/nmbd/nmbd_winsserver.c:626"), "wins.dat"), "r")’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:603:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:607:19: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:608:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:613:20: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:616:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:622:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:627:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:632:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:632:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:634:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:634:12: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:640:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:641:23: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:661:22: danger: ‘fopen(state_path(_talloc_tos("../../source3/nmbd/nmbd_winsserver.c:626"), "wins.dat"), "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  659|   		/* Read a line from the wins.dat file. Strips whitespace
#  660|   			from the beginning and end of the line.  */
#  661|-> 		if (!fgets_slash(NULL, line, sizeof(line), fp)) {
#  662|   			continue;
#  663|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def906]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1946:33: warning[-Wanalyzer-malloc-leak]: leak of ‘prdata’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1922:11: branch_false: following ‘false’ branch (when ‘num_ips != 0’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1930:30: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1930:30: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1930:11: branch_false: following ‘false’ branch (when ‘prdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1930:11: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1942:42: branch_true: following ‘true’ branch (when ‘namerec’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1943:21: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1946:33: throw: if ‘set_nb_flags’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1946:33: danger: ‘prdata’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
# 1944|   			int i;
# 1945|   			for(i = 0; i < namerec->data.num_ips; i++) {
# 1946|-> 				set_nb_flags(&prdata[num_ips * 6],namerec->data.nb_flags);
# 1947|   				putip((char *)&prdata[(num_ips * 6) + 2], &namerec->data.ip[i]);
# 1948|   				num_ips++;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def907]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2012:25: warning[-Wanalyzer-malloc-leak]: leak of ‘prdata’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1983:11: branch_true: following ‘true’ branch (when ‘rcode == 0’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:24: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:17: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:112: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2005:46: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2005:27: branch_false: following ‘false’ branch (when ‘prdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2011:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2011:28: branch_true: following ‘true’ branch (when ‘i < ip_count’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2012:25: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2012:25: throw: if ‘set_nb_flags’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2012:25: danger: ‘prdata’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 2010|   
# 2011|   		for(i = 0; i < ip_count; i++) {
# 2012|-> 			set_nb_flags(&prdata[i*6],namerec->data.nb_flags);
# 2013|   			putip((char *)&prdata[2+(i*6)], &namerec->data.ip[i]);
# 2014|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def908]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2016:17: warning[-Wanalyzer-malloc-leak]: leak of ‘prdata’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1983:11: branch_true: following ‘true’ branch (when ‘rcode == 0’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:24: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:17: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:1987:112: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2002:19: branch_false: following ‘false’ branch (when ‘ip_count != 1’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2005:46: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2005:46: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2005:27: branch_false: following ‘false’ branch (when ‘prdata’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2011:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2011:28: branch_false: following ‘false’ branch (when ‘i >= ip_count’)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2016:17: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2016:17: throw: if ‘sort_query_replies’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2016:17: danger: ‘prdata’ leaks here; was allocated at [(7)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/6)
# 2014|   		}
# 2015|   
# 2016|-> 		sort_query_replies(prdata, i, p->ip);
# 2017|   		reply_data_len = ip_count * 6;
# 2018|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def909]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2523:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2481:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2486:12: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2503:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2505:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2509:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2510:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2515:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2515:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2516:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2523:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2523:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2523:9: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 2521|   	fd = -1;
# 2522|   
# 2523|-> 	DEBUG(4,("wins_write_database: Dump of WINS name list.\n"));
# 2524|   
# 2525|   	fprintf(fp,"VERSION %d %u\n", WINS_VERSION, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def910]
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2527:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2481:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2486:12: branch_true: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2503:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2505:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2509:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2510:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2515:14: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2515:14: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2516:12: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2523:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2527:9: throw: if ‘tdb_traverse’ throws an exception...
samba-4.23.4/source3/nmbd/nmbd_winsserver.c:2527:9: danger: ‘fp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
# 2525|   	fprintf(fp,"VERSION %d %u\n", WINS_VERSION, 0);
# 2526|   
# 2527|-> 	tdb_traverse(wins_tdb, wins_writedb_traverse_fn, fp);
# 2528|   
# 2529|   	fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def911]
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:52:9: warning[-Wanalyzer-malloc-leak]: leak of ‘work’
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:68:28: enter_function: entry to ‘create_workgroup’
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:74:20: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:74:11: branch_false: following ‘false’ branch (when ‘work’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:78:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:80:9: call_function: calling ‘name_to_unstring’ from ‘create_workgroup’
#   50|   
#   51|   	errno = 0;
#   52|-> 	push_ascii_nstring(nname, name);
#   53|   	if (errno == E2BIG) {
#   54|   		unstring tname;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def912]
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:55:17: warning[-Wanalyzer-malloc-leak]: leak of ‘work’
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:68:28: enter_function: entry to ‘create_workgroup’
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:74:20: acquire_memory: allocated here
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:74:11: branch_false: following ‘false’ branch (when ‘work’ is non-NULL)...
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:78:9: branch_false: ...to here
samba-4.23.4/source3/nmbd/nmbd_workgroupdb.c:80:9: call_function: calling ‘name_to_unstring’ from ‘create_workgroup’
#   53|   	if (errno == E2BIG) {
#   54|   		unstring tname;
#   55|-> 		pull_ascii_nstring(tname, sizeof(tname), nname);
#   56|   		strlcpy(unname, tname, sizeof(nname));
#   57|   		DEBUG(0,("name_to_nstring: workgroup name %s is too long. Truncating to %s\n",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def913]
samba-4.23.4/source3/param/loadparm.c:352:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parm_ptr’
samba-4.23.4/source3/param/loadparm.c:391:13: enter_function: entry to ‘free_one_parameter_by_snum’
samba-4.23.4/source3/param/loadparm.c:395:12: branch_true: following ‘true’ branch (when ‘snum < 0’)...
samba-4.23.4/source3/param/loadparm.c:396:28: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:396:28: call_function: calling ‘lp_parm_ptr’ from ‘free_one_parameter_by_snum’
samba-4.23.4/source3/param/loadparm.c:396:28: return_function: returning to ‘free_one_parameter_by_snum’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:403:9: call_function: calling ‘free_one_parameter_common’ from ‘free_one_parameter_by_snum’
#  350|   		lpcfg_string_free((char**)parm_ptr);
#  351|   	} else if (parm.type == P_LIST || parm.type == P_CMDLIST) {
#  352|-> 		TALLOC_FREE(*((char***)parm_ptr));
#  353|   	}
#  354|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def914]
samba-4.23.4/source3/param/loadparm.c:3153:60: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/param/loadparm.c:3138:13: enter_function: entry to ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3142:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3143:33: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3147:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
samba-4.23.4/source3/param/loadparm.c:3150:25: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3154:64: call_function: calling ‘lp_parm_ptr’ from ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3154:64: return_function: returning to ‘lp_save_defaults’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:3153:60: danger: dereference of NULL ‘lp_parm_ptr(0, &parm_table[i])’
# 3151|   			case P_LIST:
# 3152|   			case P_CMDLIST:
# 3153|-> 				parm_table[i].def.lvalue = str_list_copy(
# 3154|   					NULL, *(const char ***)lp_parm_ptr(NULL, &parm_table[i]));
# 3155|   				break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def915]
samba-4.23.4/source3/param/loadparm.c:3158:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/param/loadparm.c:3138:13: enter_function: entry to ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3142:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3143:33: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3147:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
samba-4.23.4/source3/param/loadparm.c:3150:25: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3161:51: call_function: calling ‘lp_parm_ptr’ from ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3161:51: return_function: returning to ‘lp_save_defaults’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:3158:33: danger: dereference of NULL ‘lp_parm_ptr(0, &parm_table[i])’
# 3156|   			case P_STRING:
# 3157|   			case P_USTRING:
# 3158|-> 				lpcfg_string_set(
# 3159|   					Globals.ctx,
# 3160|   					&parm_table[i].def.svalue,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def916]
samba-4.23.4/source3/param/loadparm.c:3170:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/param/loadparm.c:3138:13: enter_function: entry to ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3142:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3143:33: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3147:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
samba-4.23.4/source3/param/loadparm.c:3150:25: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3170:50: call_function: calling ‘lp_parm_ptr’ from ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3170:50: return_function: returning to ‘lp_save_defaults’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:3170:41: danger: dereference of NULL ‘lp_parm_ptr(0, &parm_table[i])’
# 3168|   			case P_BOOLREV:
# 3169|   				parm_table[i].def.bvalue =
# 3170|-> 					*(bool *)lp_parm_ptr(NULL, &parm_table[i]);
# 3171|   				break;
# 3172|   			case P_CHAR:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def917]
samba-4.23.4/source3/param/loadparm.c:3174:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/param/loadparm.c:3138:13: enter_function: entry to ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3142:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3143:33: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3147:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
samba-4.23.4/source3/param/loadparm.c:3150:25: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3174:50: call_function: calling ‘lp_parm_ptr’ from ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3174:50: return_function: returning to ‘lp_save_defaults’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:3174:41: danger: dereference of NULL ‘lp_parm_ptr(0, &parm_table[i])’
# 3172|   			case P_CHAR:
# 3173|   				parm_table[i].def.cvalue =
# 3174|-> 					*(char *)lp_parm_ptr(NULL, &parm_table[i]);
# 3175|   				break;
# 3176|   			case P_INTEGER:

Error: GCC_ANALYZER_WARNING (CWE-476): [#def918]
samba-4.23.4/source3/param/loadparm.c:3181:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/param/loadparm.c:3138:13: enter_function: entry to ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3142:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3143:33: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3147:20: branch_false: following ‘false’ branch (when ‘i == 0’)...
samba-4.23.4/source3/param/loadparm.c:3150:25: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3181:49: call_function: calling ‘lp_parm_ptr’ from ‘lp_save_defaults’
samba-4.23.4/source3/param/loadparm.c:3181:49: return_function: returning to ‘lp_save_defaults’ from ‘lp_parm_ptr’
samba-4.23.4/source3/param/loadparm.c:3181:41: danger: dereference of NULL ‘lp_parm_ptr(0, &parm_table[i])’
# 3179|   			case P_BYTES:
# 3180|   				parm_table[i].def.ivalue =
# 3181|-> 					*(int *)lp_parm_ptr(NULL, &parm_table[i]);
# 3182|   				break;
# 3183|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def919]
samba-4.23.4/source3/param/loadparm.c:3429:13: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’
samba-4.23.4/source3/param/loadparm.c:3293:12: branch_false: following ‘false’ branch (when ‘numlines > 3’)...
samba-4.23.4/source3/param/loadparm.c:3297:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3308:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3312:40: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3313:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3316:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3322:38: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3323:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3326:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3329:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3333:39: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3333:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3337:12: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3375:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3383:12: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3418:14: acquire_memory: allocated here
samba-4.23.4/source3/param/loadparm.c:3420:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3429:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3429:13: throw: if ‘sys_stat’ throws an exception...
samba-4.23.4/source3/param/loadparm.c:3429:13: danger: ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’ leaks here; was allocated at [(17)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/16)
# 3427|   	   this directory. */
# 3428|   
# 3429|-> 	if (sys_stat(sharepath, &sbuf, false) == -1) {
# 3430|   		DEBUG(2,("parse_usershare_file: share %s : stat failed on path %s. %s\n",
# 3431|   			servicename, sharepath, strerror(errno) ));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def920]
samba-4.23.4/source3/param/loadparm.c:3430:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’
samba-4.23.4/source3/param/loadparm.c:3293:12: branch_false: following ‘false’ branch (when ‘numlines > 3’)...
samba-4.23.4/source3/param/loadparm.c:3297:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3308:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3312:40: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3313:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3316:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3322:38: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3323:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3326:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3329:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3333:39: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3333:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3337:12: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3375:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3383:12: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3418:14: acquire_memory: allocated here
samba-4.23.4/source3/param/loadparm.c:3420:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3429:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3429:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3430:17: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3430:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3430:17: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3430:17: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/param/loadparm.c:3430:17: danger: ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’ leaks here; was allocated at [(17)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/16)
# 3428|   
# 3429|   	if (sys_stat(sharepath, &sbuf, false) == -1) {
# 3430|-> 		DEBUG(2,("parse_usershare_file: share %s : stat failed on path %s. %s\n",
# 3431|   			servicename, sharepath, strerror(errno) ));
# 3432|   		closedir(dp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def921]
samba-4.23.4/source3/param/loadparm.c:3436:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’
samba-4.23.4/source3/param/loadparm.c:3293:12: branch_false: following ‘false’ branch (when ‘numlines > 3’)...
samba-4.23.4/source3/param/loadparm.c:3297:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3308:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3312:40: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3313:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3316:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3318:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3322:38: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3323:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3326:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3329:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3333:39: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3333:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/param/loadparm.c:3337:12: branch_true: ...to here
samba-4.23.4/source3/param/loadparm.c:3375:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3383:12: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3418:14: acquire_memory: allocated here
samba-4.23.4/source3/param/loadparm.c:3420:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3429:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3429:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3436:9: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3436:9: danger: ‘opendir(talloc_strdup(ctx,  lines[1] + 5))’ leaks here; was allocated at [(17)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/16)
# 3434|   	}
# 3435|   
# 3436|-> 	closedir(dp);
# 3437|   
# 3438|   	if (!S_ISDIR(sbuf.st_ex_mode)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def922]
samba-4.23.4/source3/param/loadparm.c:3868:31: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(usersharepath)’
samba-4.23.4/source3/param/loadparm.c:3807:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3811:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3823:13: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3823:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3860:14: acquire_memory: allocated here
samba-4.23.4/source3/param/loadparm.c:3861:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/param/loadparm.c:3861:12: branch_false: ...to here
samba-4.23.4/source3/param/loadparm.c:3868:31: throw: if ‘readdir’ throws an exception...
samba-4.23.4/source3/param/loadparm.c:3868:31: danger: ‘opendir(usersharepath)’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6)
# 3866|   
# 3867|   	for (num_dir_entries = 0, num_bad_dir_entries = 0, num_tmp_dir_entries = 0;
# 3868|-> 			(de = readdir(dp));
# 3869|   			num_dir_entries++ ) {
# 3870|   		int r;

Error: COMPILER_WARNING (CWE-704): [#def923]
samba-4.23.4/source3/param/util.c: scope_hint: In function ‘get_int_param’
samba-4.23.4/source3/param/util.c:30:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   30 |         p = strchr( param, '=' );
#      |           ^
#   28|   	char *p;
#   29|   
#   30|-> 	p = strchr( param, '=' );
#   31|   	if ( !p )
#   32|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def924]
samba-4.23.4/source3/param/util.c:30:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   28|   	char *p;
#   29|   
#   30|-> 	p = strchr( param, '=' );
#   31|   	if ( !p )
#   32|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def925]
samba-4.23.4/source3/param/util.c: scope_hint: In function ‘get_string_param’
samba-4.23.4/source3/param/util.c:45:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   45 |         p = strchr( param, '=' );
#      |           ^
#   43|   	char *p;
#   44|   
#   45|-> 	p = strchr( param, '=' );
#   46|   	if ( !p )
#   47|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def926]
samba-4.23.4/source3/param/util.c:45:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   43|   	char *p;
#   44|   
#   45|-> 	p = strchr( param, '=' );
#   46|   	if ( !p )
#   47|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def927]
samba-4.23.4/source3/passdb/machine_sid.c:98:14: warning[-Wanalyzer-malloc-leak]: leak of ‘sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:191:17: enter_function: entry to ‘get_global_sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:208:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:212:13: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:212:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:216:32: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:216:32: call_function: calling ‘pdb_generate_sam_sid’ from ‘get_global_sam_sid’
#   96|   		return NULL;
#   97|   
#   98|-> 	if ( IS_DC ) {
#   99|   		if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
#  100|   			sid_copy(sam_sid, &domain_sid);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def928]
samba-4.23.4/source3/passdb/machine_sid.c:99:21: warning[-Wanalyzer-malloc-leak]: leak of ‘sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:191:17: enter_function: entry to ‘get_global_sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:208:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:212:13: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:212:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:216:32: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:216:32: call_function: calling ‘pdb_generate_sam_sid’ from ‘get_global_sam_sid’
#   97|   
#   98|   	if ( IS_DC ) {
#   99|-> 		if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
#  100|   			sid_copy(sam_sid, &domain_sid);
#  101|   			return sam_sid;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def929]
samba-4.23.4/source3/passdb/machine_sid.c:100:25: warning[-Wanalyzer-malloc-leak]: leak of ‘sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:191:17: enter_function: entry to ‘get_global_sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:208:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:212:13: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:212:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:216:32: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:216:32: call_function: calling ‘pdb_generate_sam_sid’ from ‘get_global_sam_sid’
#   98|   	if ( IS_DC ) {
#   99|   		if (secrets_fetch_domain_sid(lp_workgroup(), &domain_sid)) {
#  100|-> 			sid_copy(sam_sid, &domain_sid);
#  101|   			return sam_sid;
#  102|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def930]
samba-4.23.4/source3/passdb/machine_sid.c:105:13: warning[-Wanalyzer-malloc-leak]: leak of ‘sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:191:17: enter_function: entry to ‘get_global_sam_sid’
samba-4.23.4/source3/passdb/machine_sid.c:208:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:212:13: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:212:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/machine_sid.c:216:32: branch_false: ...to here
samba-4.23.4/source3/passdb/machine_sid.c:216:32: call_function: calling ‘pdb_generate_sam_sid’ from ‘get_global_sam_sid’
#  103|   	}
#  104|   
#  105|-> 	if (secrets_fetch_domain_sid(lp_netbios_name(), sam_sid)) {
#  106|   
#  107|   		/* We got our sid. If not a pdc/bdc, we're done. */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def931]
samba-4.23.4/source3/passdb/passdb.c:1744:25: warning[-Wanalyzer-malloc-leak]: leak of ‘pw_hist’
samba-4.23.4/source3/passdb/passdb.c:1605:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/passdb.c:1613:15: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1649:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/passdb.c:1654:9: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1735:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1736:47: branch_true: ...to here
samba-4.23.4/source3/passdb/passdb.c:1736:47: acquire_memory: allocated here
samba-4.23.4/source3/passdb/passdb.c:1737:20: branch_false: following ‘false’ branch (when ‘pw_hist’ is non-NULL)...
samba-4.23.4/source3/passdb/passdb.c:1741:17: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1742:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1744:25: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1744:25: branch_true: ...to here
samba-4.23.4/source3/passdb/passdb.c:1744:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/passdb/passdb.c:1744:25: danger: ‘pw_hist’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1742|   		if (nt_pw_hist_ptr && nt_pw_hist_len) {
# 1743|   			int i;
# 1744|-> 			SMB_ASSERT((nt_pw_hist_len % PW_HISTORY_ENTRY_LEN) == 0);
# 1745|   			nt_pw_hist_len /= PW_HISTORY_ENTRY_LEN;
# 1746|   			for (i = 0; (i < pwHistLen) && (i < nt_pw_hist_len); i++) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def932]
samba-4.23.4/source3/passdb/passdb.c:1752:22: warning[-Wanalyzer-malloc-leak]: leak of ‘pw_hist’
samba-4.23.4/source3/passdb/passdb.c:1605:11: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/passdb.c:1613:15: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1649:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/passdb.c:1654:9: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1735:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1736:47: branch_true: ...to here
samba-4.23.4/source3/passdb/passdb.c:1736:47: acquire_memory: allocated here
samba-4.23.4/source3/passdb/passdb.c:1737:20: branch_false: following ‘false’ branch (when ‘pw_hist’ is non-NULL)...
samba-4.23.4/source3/passdb/passdb.c:1741:17: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1742:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1744:25: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/passdb.c:1745:40: branch_false: ...to here
samba-4.23.4/source3/passdb/passdb.c:1746:37: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/passdb.c:1752:22: throw: if ‘pdb_set_pw_history’ throws an exception...
samba-4.23.4/source3/passdb/passdb.c:1752:22: danger: ‘pw_hist’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 1750|   			}
# 1751|   		}
# 1752|-> 		if (!pdb_set_pw_history(sampass, pw_hist, pwHistLen, PDB_SET)) {
# 1753|   			SAFE_FREE(pw_hist);
# 1754|   			ret = False;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def933]
samba-4.23.4/source3/passdb/pdb_ldap.c:1515:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘attr_list’
samba-4.23.4/source3/passdb/pdb_ldap.c:1540:17: enter_function: entry to ‘ldapsam_getsampwnam’
samba-4.23.4/source3/passdb/pdb_ldap.c:1550:21: call_function: calling ‘get_userattr_list’ from ‘ldapsam_getsampwnam’
samba-4.23.4/source3/passdb/pdb_ldap.c:1550:21: return_function: returning to ‘ldapsam_getsampwnam’ from ‘get_userattr_list’
samba-4.23.4/source3/passdb/pdb_ldap.c:1551:9: call_function: calling ‘get_userattr_key2string’ from ‘ldapsam_getsampwnam’
samba-4.23.4/source3/passdb/pdb_ldap.c:1551:9: return_function: returning to ‘ldapsam_getsampwnam’ from ‘get_userattr_key2string’
samba-4.23.4/source3/passdb/pdb_ldap.c:1551:9: call_function: inlined call to ‘append_attr’ from ‘ldapsam_getsampwnam’
samba-4.23.4/source3/passdb/pdb_ldap.c:1554:9: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_ldap.c:1554:9: call_function: calling ‘ldapsam_add_unix_attributes’ from ‘ldapsam_getsampwnam’
# 1513|   	}
# 1514|   
# 1515|-> 	for (i=0; (*attr_list)[i] != NULL; i++) {
# 1516|   		;
# 1517|   	}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def934]
samba-4.23.4/source3/passdb/pdb_ldap.c:4398:29: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/passdb/pdb_ldap.c:4392:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_ldap.c:4396:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_ldap.c:4396:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/passdb/pdb_ldap.c:4397:19: branch_true: following ‘true’ branch (when ‘i < num’)...
samba-4.23.4/source3/passdb/pdb_ldap.c:4398:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_ldap.c:4398:29: throw: if ‘talloc_strdup’ throws an exception...
samba-4.23.4/source3/passdb/pdb_ldap.c:4398:29: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
# 4396|   	va_start(ap, mem_ctx);
# 4397|   	for (i=0; i<num; i++) {
# 4398|-> 		result[i] = talloc_strdup(result, va_arg(ap, const char*));
# 4399|   		if (result[i] == NULL) {
# 4400|   			talloc_free(result);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def935]
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:709:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:706:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:708:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:708:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:709:22: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:709:22: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  707|   
#  708|   	va_start(ap, exp_fmt);
#  709|-> 	expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
#  710|   	va_end(ap);
#  711|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def936]
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:949:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:946:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:948:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:948:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:949:22: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:949:22: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  947|   
#  948|   	va_start(ap, exp_fmt);
#  949|-> 	expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
#  950|   	va_end(ap);
#  951|   

Error: CPPCHECK_WARNING (CWE-457): [#def937]
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1086: error[uninitvar]: Uninitialized variable: id_map.sid
# 1084|   		return status;
# 1085|   	}
# 1086|-> 	status = pdb_samba_dsdb_getgrsid(m, map, *id_map.sid);
# 1087|   	talloc_free(tmp_ctx);
# 1088|   	return status;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def938]
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1932:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1927:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1931:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1931:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1932:22: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source3/passdb/pdb_samba_dsdb.c:1932:22: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1930|   
# 1931|   	va_start(ap, exp_fmt);
# 1932|-> 	expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
# 1933|   	va_end(ap);
# 1934|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def939]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:96:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#   94|   
#   95|   	gotalarm = 0;
#   96|-> 	oldsig_handler = CatchSignal(SIGALRM, gotalarm_sig);
#   97|   
#   98|   	lock.l_type = type;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def940]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:96:26: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#   94|   
#   95|   	gotalarm = 0;
#   96|-> 	oldsig_handler = CatchSignal(SIGALRM, gotalarm_sig);
#   97|   
#   98|   	lock.l_type = type;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def941]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:106:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  104|   	alarm(waitsecs);
#  105|   	/* Note we must *NOT* use sys_fcntl here ! JRA */
#  106|-> 	ret = fcntl(fd, F_SETLKW, &lock);
#  107|   	alarm(0);
#  108|   	CatchSignal(SIGALRM, oldsig_handler);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def942]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:106:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  104|   	alarm(waitsecs);
#  105|   	/* Note we must *NOT* use sys_fcntl here ! JRA */
#  106|-> 	ret = fcntl(fd, F_SETLKW, &lock);
#  107|   	alarm(0);
#  108|   	CatchSignal(SIGALRM, oldsig_handler);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def943]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:108:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  106|   	ret = fcntl(fd, F_SETLKW, &lock);
#  107|   	alarm(0);
#  108|-> 	CatchSignal(SIGALRM, oldsig_handler);
#  109|   
#  110|   	if (gotalarm && ret == -1) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def944]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:108:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  106|   	ret = fcntl(fd, F_SETLKW, &lock);
#  107|   	alarm(0);
#  108|-> 	CatchSignal(SIGALRM, oldsig_handler);
#  109|   
#  110|   	if (gotalarm && ret == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def945]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:111:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  109|   
#  110|   	if (gotalarm && ret == -1) {
#  111|-> 		DEBUG(0, ("do_file_lock: failed to %s file.\n",
#  112|   			type == F_UNLCK ? "unlock" : "lock"));
#  113|   		return False;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def946]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:111:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  109|   
#  110|   	if (gotalarm && ret == -1) {
#  111|-> 		DEBUG(0, ("do_file_lock: failed to %s file.\n",
#  112|   			type == F_UNLCK ? "unlock" : "lock"));
#  113|   		return False;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def947]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:131:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  129|   	if(*plock_depth == 0) {
#  130|   		if (!do_file_lock(fd, secs, type)) {
#  131|-> 			DEBUG(10,("pw_file_lock: locking file failed, error = %s.\n",
#  132|   				strerror(errno)));
#  133|   			return False;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def948]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:131:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:189:14: enter_function: entry to ‘startsmbfilepwent’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:265:22: call_function: calling ‘pw_file_lock’ from ‘startsmbfilepwent’
#  129|   	if(*plock_depth == 0) {
#  130|   		if (!do_file_lock(fd, secs, type)) {
#  131|-> 			DEBUG(10,("pw_file_lock: locking file failed, error = %s.\n",
#  132|   				strerror(errno)));
#  133|   			return False;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def949]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pfile, "a+")’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: danger: ‘fopen(pfile, "a+")’ leaks here; was opened at [(9)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/8)
#  248|   			if (errno == ENOENT) {
#  249|   				if ((fp = fopen(pfile, "a+")) != NULL) {
#  250|-> 					DEBUG(0, ("startsmbfilepwent_internal: file %s did not \
#  251|   exist. File successfully created.\n", pfile));
#  252|   				} else {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def950]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(pfile, "a+")’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:197:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:202:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:239:28: branch_true: following ‘true’ branch (when ‘race_loop != 5’)...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:240:17: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:242:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:29: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:248:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:43: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:249:36: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: following ‘true’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: branch_true: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: throw: if ‘dbghdrclass’ throws an exception...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:250:41: danger: ‘fopen(pfile, "a+")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/8)
#  248|   			if (errno == ENOENT) {
#  249|   				if ((fp = fopen(pfile, "a+")) != NULL) {
#  250|-> 					DEBUG(0, ("startsmbfilepwent_internal: file %s did not \
#  251|   exist. File successfully created.\n", pfile));
#  252|   				} else {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def951]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:796:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pfile, "r+")’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:754:13: enter_function: entry to ‘mod_smbfilepwd_entry’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:779:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:783:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:785:14: acquire_resource: opened here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:787:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:792:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:796:14: call_function: calling ‘pw_file_lock’ from ‘mod_smbfilepwd_entry’
#  794|   	lockfd = fileno(fp);
#  795|   
#  796|-> 	if (!pw_file_lock(lockfd, F_WRLCK, 5, &smbpasswd_state->pw_file_lock_depth)) {
#  797|   		DEBUG(0, ("mod_smbfilepwd_entry: unable to lock file %s\n", pfile));
#  798|   		fclose(fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def952]
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:796:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(pfile, "r+")’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:754:13: enter_function: entry to ‘mod_smbfilepwd_entry’
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:779:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:783:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:785:14: acquire_memory: allocated here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:787:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:792:9: branch_false: ...to here
samba-4.23.4/source3/passdb/pdb_smbpasswd.c:796:14: call_function: calling ‘pw_file_lock’ from ‘mod_smbfilepwd_entry’
#  794|   	lockfd = fileno(fp);
#  795|   
#  796|-> 	if (!pw_file_lock(lockfd, F_WRLCK, 5, &smbpasswd_state->pw_file_lock_depth)) {
#  797|   		DEBUG(0, ("mod_smbfilepwd_entry: unable to lock file %s\n", pfile));
#  798|   		fclose(fp);

Error: CPPCHECK_WARNING (CWE-457): [#def953]
samba-4.23.4/source3/passdb/pdb_tdb.c:802: error[uninitvar]: Uninitialized variable: data
#  800|   	/* copy the struct samu struct into a BYTE buffer for storage */
#  801|   
#  802|-> 	if ( (data.dsize=init_buffer_from_samu(&buf, newpwd, False)) == -1 ) {
#  803|   		DEBUG(0,("tdb_update_sam: ERROR - Unable to copy struct samu info BYTE buffer!\n"));
#  804|   		goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def954]
samba-4.23.4/source3/printing/nt_printing.c:323:31: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source3/printing/nt_printing.c:700:12: enter_function: entry to ‘get_file_version’
samba-4.23.4/source3/printing/nt_printing.c:709:21: acquire_memory: allocated here
samba-4.23.4/source3/printing/nt_printing.c:710:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source3/printing/nt_printing.c:717:22: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:717:22: call_function: calling ‘printing_pread_data’ from ‘get_file_version’
#  321|   
#  322|   	while (total < byte_count) {
#  323|-> 		ssize_t ret = read_file(fsp,
#  324|   					buf + total,
#  325|   					in_pos,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def955]
samba-4.23.4/source3/printing/nt_printing.c:407:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source3/printing/nt_printing.c:802:12: enter_function: entry to ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: call_function: calling ‘driver_unix_convert’ from ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: return_function: returning to ‘file_version_is_newer’ from ‘driver_unix_convert’
samba-4.23.4/source3/printing/nt_printing.c:828:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:832:18: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:852:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:862:15: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:862:15: call_function: calling ‘get_file_version’ from ‘file_version_is_newer’
#  405|   	byte_count = printing_pread_data(fsp, buf, &in_pos, section_table_bytes);
#  406|   	if (byte_count < section_table_bytes) {
#  407|-> 		DBG_NOTICE("PE file [%s] Section header too short, "
#  408|   			"bytes read = %lu\n",
#  409|   			fname,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def956]
samba-4.23.4/source3/printing/nt_printing.c:423:52: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
samba-4.23.4/source3/printing/nt_printing.c:802:12: enter_function: entry to ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: call_function: calling ‘driver_unix_convert’ from ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: return_function: returning to ‘file_version_is_newer’ from ‘driver_unix_convert’
samba-4.23.4/source3/printing/nt_printing.c:828:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:832:18: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:852:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:862:15: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:862:15: call_function: calling ‘get_file_version’ from ‘file_version_is_newer’
#  421|   		if (strcmp(".rsrc",
#  422|   			&buf[sec_offset+ PE_HEADER_SECT_NAME_OFFSET]) == 0) {
#  423|-> 			unsigned int section_pos = IVAL(buf,
#  424|   					sec_offset+
#  425|   					PE_HEADER_SECT_PTR_DATA_OFFSET);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def957]
samba-4.23.4/source3/printing/nt_printing.c:683:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source3/printing/nt_printing.c:802:12: enter_function: entry to ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: call_function: calling ‘driver_unix_convert’ from ‘file_version_is_newer’
samba-4.23.4/source3/printing/nt_printing.c:827:18: return_function: returning to ‘file_version_is_newer’ from ‘driver_unix_convert’
samba-4.23.4/source3/printing/nt_printing.c:828:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:832:18: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:852:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/nt_printing.c:862:15: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:862:15: call_function: calling ‘get_file_version’ from ‘file_version_is_newer’
#  681|   
#  682|   	/* Version info not found, fall back to origin date/time */
#  683|-> 	DBG_ERR("NE file [%s] Version info not found\n", fname);
#  684|   	ret = 0;
#  685|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def958]
samba-4.23.4/source3/printing/nt_printing.c:719:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source3/printing/nt_printing.c:700:12: enter_function: entry to ‘get_file_version’
samba-4.23.4/source3/printing/nt_printing.c:709:21: acquire_memory: allocated here
samba-4.23.4/source3/printing/nt_printing.c:710:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source3/printing/nt_printing.c:717:22: branch_false: ...to here
samba-4.23.4/source3/printing/nt_printing.c:717:22: call_function: calling ‘printing_pread_data’ from ‘get_file_version’
samba-4.23.4/source3/printing/nt_printing.c:717:22: return_function: returning to ‘get_file_version’ from ‘printing_pread_data’
samba-4.23.4/source3/printing/nt_printing.c:718:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/printing/nt_printing.c:719:17: branch_true: ...to here
samba-4.23.4/source3/printing/nt_printing.c:719:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/nt_printing.c:719:17: danger: ‘buf’ leaks here; was allocated at [(2)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/1)
#  717|   	byte_count = printing_pread_data(fsp, buf, &in_pos, DOS_HEADER_SIZE);
#  718|   	if (byte_count < DOS_HEADER_SIZE) {
#  719|-> 		DBG_NOTICE("File [%s] DOS header too short, bytes read = %lu\n",
#  720|   			 fname,
#  721|   			(unsigned long)byte_count);

Error: COMPILER_WARNING (CWE-704): [#def959]
samba-4.23.4/source3/printing/nt_printing.c: scope_hint: In function ‘clean_up_driver_struct_level’
samba-4.23.4/source3/printing/nt_printing.c:1179:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1179 |         if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
#      |                              ^
samba-4.23.4/source3/printing/nt_printing.c:1253:9: note: in expansion of macro ‘strip_driver_path’
# 1253 |         strip_driver_path(mem_ctx, *driver_path);
#      |         ^~~~~~~~~~~~~~~~~
# 1177|   
# 1178|   #define strip_driver_path(_mem_ctx, _element) do { \
# 1179|-> 	if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
# 1180|   		(_element) = talloc_asprintf((_mem_ctx), "%s", _p+1); \
# 1181|   		W_ERROR_HAVE_NO_MEMORY((_element)); \

Error: COMPILER_WARNING (CWE-704): [#def960]
samba-4.23.4/source3/printing/nt_printing.c:1253:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1251|   	/* using an intermediate string to not have overlapping memcpy()'s */
# 1252|   
# 1253|-> 	strip_driver_path(mem_ctx, *driver_path);
# 1254|   	strip_driver_path(mem_ctx, *data_file);
# 1255|   	if (*config_file) {

Error: COMPILER_WARNING (CWE-704): [#def961]
samba-4.23.4/source3/printing/nt_printing.c:1254:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1252|   
# 1253|   	strip_driver_path(mem_ctx, *driver_path);
# 1254|-> 	strip_driver_path(mem_ctx, *data_file);
# 1255|   	if (*config_file) {
# 1256|   		strip_driver_path(mem_ctx, *config_file);

Error: COMPILER_WARNING (CWE-704): [#def962]
samba-4.23.4/source3/printing/nt_printing.c:1256:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1254|   	strip_driver_path(mem_ctx, *data_file);
# 1255|   	if (*config_file) {
# 1256|-> 		strip_driver_path(mem_ctx, *config_file);
# 1257|   	}
# 1258|   	if (help_file) {

Error: COMPILER_WARNING (CWE-704): [#def963]
samba-4.23.4/source3/printing/nt_printing.c:1259:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1257|   	}
# 1258|   	if (help_file) {
# 1259|-> 		strip_driver_path(mem_ctx, *help_file);
# 1260|   	}
# 1261|   

Error: COMPILER_WARNING (CWE-704): [#def964]
samba-4.23.4/source3/printing/nt_printing.c:1264:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1262|   	if (dependent_files && dependent_files->string) {
# 1263|   		for (i=0; dependent_files->string[i]; i++) {
# 1264|-> 			strip_driver_path(mem_ctx, dependent_files->string[i]);
# 1265|   		}
# 1266|   	}

Error: COMPILER_WARNING (CWE-704): [#def965]
samba-4.23.4/source3/printing/nt_printing_migrate.c: scope_hint: In function ‘printing_tdb_migrate_printer’
samba-4.23.4/source3/printing/nt_printing_migrate.c:317:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  317 |                 valuename = strchr(keyname, '\\');
#      |                           ^
#  315|   
#  316|   		keyname = r.printer_data[j].name;
#  317|-> 		valuename = strchr(keyname, '\\');
#  318|   		if (valuename == NULL) {
#  319|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def966]
samba-4.23.4/source3/printing/nt_printing_migrate.c:317:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  315|   
#  316|   		keyname = r.printer_data[j].name;
#  317|-> 		valuename = strchr(keyname, '\\');
#  318|   		if (valuename == NULL) {
#  319|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def967]
samba-4.23.4/source3/printing/pcap.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/printing/pcap.c:54:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/pcap.c:57:19: acquire_memory: allocated here
samba-4.23.4/source3/printing/pcap.c:61:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/pcap.c:61:9: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   59|   	p->location = (location && *location) ? SMB_STRDUP(location) : NULL;
#   60|   
#   61|-> 	DEBUG(11,("pcap_cache_add_specific: Adding name %s info %s, location: %s\n",
#   62|   		p->name, p->comment ? p->comment : "",
#   63|   		p->location ? p->location : ""));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def968]
samba-4.23.4/source3/printing/pcap.c:61:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/source3/printing/pcap.c:54:12: branch_false: following ‘false’ branch (when ‘name’ is non-NULL)...
samba-4.23.4/source3/printing/pcap.c:54:35: branch_false: ...to here
samba-4.23.4/source3/printing/pcap.c:54:35: acquire_memory: allocated here
samba-4.23.4/source3/printing/pcap.c:54:13: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
samba-4.23.4/source3/printing/pcap.c:57:19: branch_false: ...to here
samba-4.23.4/source3/printing/pcap.c:61:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/pcap.c:61:9: danger: ‘p’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   59|   	p->location = (location && *location) ? SMB_STRDUP(location) : NULL;
#   60|   
#   61|-> 	DEBUG(11,("pcap_cache_add_specific: Adding name %s info %s, location: %s\n",
#   62|   		p->name, p->comment ? p->comment : "",
#   63|   		p->location ? p->location : ""));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def969]
samba-4.23.4/source3/printing/print_cups.c:113:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  111|   {
#  112|   	const struct loadparm_substitution *lp_sub =
#  113|-> 		loadparm_s3_global_substitution();
#  114|   	http_t *http = NULL;
#  115|   	char *server = NULL, *p = NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def970]
samba-4.23.4/source3/printing/print_cups.c:117:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  115|   	char *server = NULL, *p = NULL;
#  116|   	int port;
#  117|-> 	int timeout = lp_cups_connection_timeout();
#  118|   	size_t size;
#  119|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def971]
samba-4.23.4/source3/printing/print_cups.c:320:29: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  318|   static bool cups_cache_reload_async(int fd)
#  319|   {
#  320|-> 	TALLOC_CTX *frame = talloc_stackframe();
#  321|   	struct pcap_data pcap_data;
#  322|   	http_t		*http = NULL;		/* HTTP connection to server */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def972]
samba-4.23.4/source3/printing/print_cups.c:336:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  334|   	DATA_BLOB pcap_blob;
#  335|   
#  336|-> 	ZERO_STRUCT(pcap_data);
#  337|   	pcap_data.status = NT_STATUS_UNSUCCESSFUL;
#  338|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def973]
samba-4.23.4/source3/printing/print_cups.c:339:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  337|   	pcap_data.status = NT_STATUS_UNSUCCESSFUL;
#  338|   
#  339|-> 	DEBUG(5, ("reloading cups printcap cache\n"));
#  340|   
#  341|          /*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def974]
samba-4.23.4/source3/printing/print_cups.c:345:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:454:13: enter_function: entry to ‘cups_pcap_load_async’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:505:9: call_function: calling ‘cups_cache_reload_async’ from ‘cups_pcap_load_async’
#  343|   	*/
#  344|   
#  345|->         cupsSetPasswordCB(cups_passwd_cb);
#  346|   
#  347|   	if ((http = cups_connect(frame)) == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def975]
samba-4.23.4/source3/printing/print_cups.c:478:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source3/printing/print_cups.c:478:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:478:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:478:17: danger: ‘fds[0]’ leaks here
#  476|   	pid = fork();
#  477|   	if (pid == (pid_t)-1) {
#  478|-> 		DEBUG(10,("cups_pcap_load_async: fork failed %s\n",
#  479|   			strerror(errno) ));
#  480|   		close(fds[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def976]
samba-4.23.4/source3/printing/print_cups.c:478:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source3/printing/print_cups.c:478:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:478:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:478:17: danger: ‘fds[1]’ leaks here
#  476|   	pid = fork();
#  477|   	if (pid == (pid_t)-1) {
#  478|-> 		DEBUG(10,("cups_pcap_load_async: fork failed %s\n",
#  479|   			strerror(errno) ));
#  480|   		close(fds[0]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def977]
samba-4.23.4/source3/printing/print_cups.c:480:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source3/printing/print_cups.c:478:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:480:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:480:17: danger: ‘fds[0]’ leaks here
#  478|   		DEBUG(10,("cups_pcap_load_async: fork failed %s\n",
#  479|   			strerror(errno) ));
#  480|-> 		close(fds[0]);
#  481|   		close(fds[1]);
#  482|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def978]
samba-4.23.4/source3/printing/print_cups.c:480:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source3/printing/print_cups.c:478:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:480:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:480:17: danger: ‘fds[1]’ leaks here
#  478|   		DEBUG(10,("cups_pcap_load_async: fork failed %s\n",
#  479|   			strerror(errno) ));
#  480|-> 		close(fds[0]);
#  481|   		close(fds[1]);
#  482|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def979]
samba-4.23.4/source3/printing/print_cups.c:481:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source3/printing/print_cups.c:478:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:481:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:481:17: danger: ‘fds[1]’ leaks here
#  479|   			strerror(errno) ));
#  480|   		close(fds[0]);
#  481|-> 		close(fds[1]);
#  482|   		return false;
#  483|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def980]
samba-4.23.4/source3/printing/print_cups.c:486:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/printing/print_cups.c:486:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:486:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:486:17: danger: ‘fds[0]’ leaks here
#  484|   
#  485|   	if (pid) {
#  486|-> 		DEBUG(10,("cups_pcap_load_async: child pid = %u\n",
#  487|   			(unsigned int)pid ));
#  488|   		/* Parent. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def981]
samba-4.23.4/source3/printing/print_cups.c:486:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/printing/print_cups.c:486:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:486:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:486:17: danger: ‘fds[1]’ leaks here
#  484|   
#  485|   	if (pid) {
#  486|-> 		DEBUG(10,("cups_pcap_load_async: child pid = %u\n",
#  487|   			(unsigned int)pid ));
#  488|   		/* Parent. */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def982]
samba-4.23.4/source3/printing/print_cups.c:489:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/printing/print_cups.c:486:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:489:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:489:17: danger: ‘fds[0]’ leaks here
#  487|   			(unsigned int)pid ));
#  488|   		/* Parent. */
#  489|-> 		close(fds[1]);
#  490|   		*pfd = fds[0];
#  491|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def983]
samba-4.23.4/source3/printing/print_cups.c:489:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source3/printing/print_cups.c:486:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:489:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:489:17: danger: ‘fds[1]’ leaks here
#  487|   			(unsigned int)pid ));
#  488|   		/* Parent. */
#  489|-> 		close(fds[1]);
#  490|   		*pfd = fds[0];
#  491|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def984]
samba-4.23.4/source3/printing/print_cups.c:496:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:496:9: throw: if ‘close_all_print_db’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:496:9: danger: ‘fds[0]’ leaks here
#  494|   	/* Child. */
#  495|   
#  496|-> 	close_all_print_db();
#  497|   
#  498|   	status = reinit_after_fork(msg_ctx, ev, true);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def985]
samba-4.23.4/source3/printing/print_cups.c:496:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:496:9: throw: if ‘close_all_print_db’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:496:9: danger: ‘fds[1]’ leaks here
#  494|   	/* Child. */
#  495|   
#  496|-> 	close_all_print_db();
#  497|   
#  498|   	status = reinit_after_fork(msg_ctx, ev, true);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def986]
samba-4.23.4/source3/printing/print_cups.c:498:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:498:18: throw: if ‘reinit_after_fork’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:498:18: danger: ‘fds[0]’ leaks here
#  496|   	close_all_print_db();
#  497|   
#  498|-> 	status = reinit_after_fork(msg_ctx, ev, true);
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|   		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def987]
samba-4.23.4/source3/printing/print_cups.c:498:18: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:498:18: throw: if ‘reinit_after_fork’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:498:18: danger: ‘fds[1]’ leaks here
#  496|   	close_all_print_db();
#  497|   
#  498|-> 	status = reinit_after_fork(msg_ctx, ev, true);
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|   		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def988]
samba-4.23.4/source3/printing/print_cups.c:500:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/printing/print_cups.c:500:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:500:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:500:17: danger: ‘fds[0]’ leaks here
#  498|   	status = reinit_after_fork(msg_ctx, ev, true);
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|-> 		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
#  501|   		smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
#  502|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def989]
samba-4.23.4/source3/printing/print_cups.c:500:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/printing/print_cups.c:500:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:500:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:500:17: danger: ‘fds[1]’ leaks here
#  498|   	status = reinit_after_fork(msg_ctx, ev, true);
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|-> 		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
#  501|   		smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
#  502|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def990]
samba-4.23.4/source3/printing/print_cups.c:501:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/printing/print_cups.c:500:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:501:17: throw: if ‘smb_panic’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:501:17: danger: ‘fds[0]’ leaks here
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|   		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
#  501|-> 		smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
#  502|   	}
#  503|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def991]
samba-4.23.4/source3/printing/print_cups.c:501:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/printing/print_cups.c:500:17: branch_true: ...to here
samba-4.23.4/source3/printing/print_cups.c:501:17: throw: if ‘smb_panic’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:501:17: danger: ‘fds[1]’ leaks here
#  499|   	if (!NT_STATUS_IS_OK(status)) {
#  500|   		DEBUG(0,("cups_pcap_load_async: reinit_after_fork() failed\n"));
#  501|-> 		smb_panic("cups_pcap_load_async: reinit_after_fork() failed");
#  502|   	}
#  503|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def992]
samba-4.23.4/source3/printing/print_cups.c:504:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:504:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:504:9: danger: ‘fds[0]’ leaks here
#  502|   	}
#  503|   
#  504|-> 	close(fds[0]);
#  505|   	cups_cache_reload_async(fds[1]);
#  506|   	close(fds[1]);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def993]
samba-4.23.4/source3/printing/print_cups.c:504:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source3/printing/print_cups.c:464:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:470:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:472:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:476:15: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:477:12: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:485:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source3/printing/print_cups.c:496:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:499:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_cups.c:504:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_cups.c:504:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/print_cups.c:504:9: danger: ‘fds[1]’ leaks here
#  502|   	}
#  503|   
#  504|-> 	close(fds[0]);
#  505|   	cups_cache_reload_async(fds[1]);
#  506|   	close(fds[1]);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def994]
samba-4.23.4/source3/printing/print_generic.c:57:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/printing/print_generic.c:43:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/printing/print_generic.c:47:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:52:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:57:18: throw: if ‘talloc_strdup’ throws an exception...
samba-4.23.4/source3/printing/print_generic.c:57:18: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   55|   	}
#   56|   
#   57|-> 	syscmd = talloc_strdup(ctx, command);
#   58|   	if (!syscmd) {
#   59|   		va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def995]
samba-4.23.4/source3/printing/print_generic.c:63:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/printing/print_generic.c:43:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/printing/print_generic.c:47:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:52:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:58:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:63:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_generic.c:63:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/print_generic.c:63:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   61|   	}
#   62|   
#   63|-> 	DBG_DEBUG("Incoming command '%s'\n", syscmd);
#   64|   
#   65|   	while ((arg = va_arg(ap, char *))) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def996]
samba-4.23.4/source3/printing/print_generic.c:67:26: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/printing/print_generic.c:43:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/printing/print_generic.c:47:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:52:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:58:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_generic.c:63:9: branch_false: ...to here
samba-4.23.4/source3/printing/print_generic.c:65:16: branch_true: following ‘true’ branch (when ‘arg’ is non-NULL)...
samba-4.23.4/source3/printing/print_generic.c:66:23: branch_true: ...to here
samba-4.23.4/source3/printing/print_generic.c:67:26: throw: if ‘talloc_string_sub’ throws an exception...
samba-4.23.4/source3/printing/print_generic.c:67:26: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#   65|   	while ((arg = va_arg(ap, char *))) {
#   66|   		char *value = va_arg(ap,char *);
#   67|-> 		syscmd = talloc_string_sub(ctx, syscmd, arg, value);
#   68|   		if (!syscmd) {
#   69|   			va_end(ap);

Error: COMPILER_WARNING (CWE-704): [#def997]
samba-4.23.4/source3/printing/print_iprint.c: scope_hint: In function ‘iprint_get_server_version’
samba-4.23.4/source3/printing/print_iprint.c:170:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  170 |                 if ((ver = strstr(ippGetString(attr, 0, NULL),
#      |                          ^
#  168|   	if (((attr = ippFindAttribute(response, "server-version",
#  169|   	                              IPP_TAG_STRING)) != NULL)) {
#  170|-> 		if ((ver = strstr(ippGetString(attr, 0, NULL),
#  171|                                     NOVELL_SERVER_VERSION_STRING)) != NULL) {
#  172|   			ver += strlen(NOVELL_SERVER_VERSION_STRING);

Error: COMPILER_WARNING (CWE-704): [#def998]
samba-4.23.4/source3/printing/print_iprint.c:170:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  168|   	if (((attr = ippFindAttribute(response, "server-version",
#  169|   	                              IPP_TAG_STRING)) != NULL)) {
#  170|-> 		if ((ver = strstr(ippGetString(attr, 0, NULL),
#  171|                                     NOVELL_SERVER_VERSION_STRING)) != NULL) {
#  172|   			ver += strlen(NOVELL_SERVER_VERSION_STRING);

Error: COMPILER_WARNING (CWE-704): [#def999]
samba-4.23.4/source3/printing/print_iprint.c:186:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  186 |                 if ((os = strstr(ippGetString(attr, 0, NULL),
#      |                         ^
#  184|   		}
#  185|   
#  186|-> 		if ((os = strstr(ippGetString(attr, 0, NULL),
#  187|                                     NOVELL_SERVER_SYSNAME)) != NULL) {
#  188|   			os += strlen(NOVELL_SERVER_SYSNAME);

Error: COMPILER_WARNING (CWE-704): [#def1000]
samba-4.23.4/source3/printing/print_iprint.c:186:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  184|   		}
#  185|   
#  186|-> 		if ((os = strstr(ippGetString(attr, 0, NULL),
#  187|                                     NOVELL_SERVER_SYSNAME)) != NULL) {
#  188|   			os += strlen(NOVELL_SERVER_SYSNAME);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1001]
samba-4.23.4/source3/printing/print_standard.c:77:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(pcap_name, "r")’
samba-4.23.4/source3/printing/print_standard.c:71:26: acquire_resource: opened here
samba-4.23.4/source3/printing/print_standard.c:71:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_standard.c:71:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_standard.c:77:29: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/printing/print_standard.c:77:29: danger: ‘fopen(pcap_name, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   75|   	}
#   76|   
#   77|-> 	while ((pcap_line = fgets_slash(frame, NULL, 1024,
#   78|   					pcap_file)) != NULL) {
#   79|   		char *name = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1002]
samba-4.23.4/source3/printing/print_standard.c:77:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(pcap_name, "r")’
samba-4.23.4/source3/printing/print_standard.c:71:26: acquire_memory: allocated here
samba-4.23.4/source3/printing/print_standard.c:71:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/print_standard.c:71:12: branch_false: ...to here
samba-4.23.4/source3/printing/print_standard.c:77:29: throw: if ‘fgets_slash’ throws an exception...
samba-4.23.4/source3/printing/print_standard.c:77:29: danger: ‘fopen(pcap_name, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   75|   	}
#   76|   
#   77|-> 	while ((pcap_line = fgets_slash(frame, NULL, 1024,
#   78|   					pcap_file)) != NULL) {
#   79|   		char *name = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1003]
samba-4.23.4/source3/printing/printing.c:1149:16: warning[-Wanalyzer-malloc-leak]: leak of ‘malloc(data.dsize)’
samba-4.23.4/source3/printing/printing.c:1145:37: acquire_memory: allocated here
samba-4.23.4/source3/printing/printing.c:1145:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/printing.c:1149:16: branch_false: ...to here
samba-4.23.4/source3/printing/printing.c:1149:16: throw: if ‘tdb_pack’ throws an exception...
samba-4.23.4/source3/printing/printing.c:1149:16: danger: ‘malloc(data.dsize)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 1147|   
# 1148|           len = 0;
# 1149|-> 	len += tdb_pack(data.dptr + len, data.dsize - len, "d", qcount);
# 1150|   	for (i = 0; i < pts->qcount; i++) {
# 1151|   		if ( queue[i].status == LPQ_DELETED )

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1004]
samba-4.23.4/source3/printing/queue_process.c:371:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:371:24: danger: ‘ready_fds[0]’ leaks here
#  369|   	ret = pipe(ready_fds);
#  370|   	if (ret == -1) {
#  371|-> 		return -1;
#  372|   	}
#  373|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1005]
samba-4.23.4/source3/printing/queue_process.c:374:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:374:16: throw: if ‘_talloc_tos’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:374:16: danger: ‘ready_fds[0]’ leaks here
#  372|   	}
#  373|   
#  374|-> 	argv = str_list_make_empty(talloc_tos());
#  375|   	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1006]
samba-4.23.4/source3/printing/queue_process.c:374:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:374:16: throw: if ‘_talloc_tos’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:374:16: danger: ‘ready_fds[1]’ leaks here
#  372|   	}
#  373|   
#  374|-> 	argv = str_list_make_empty(talloc_tos());
#  375|   	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1007]
samba-4.23.4/source3/printing/queue_process.c:375:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:375:9: throw: if ‘get_dyn_SAMBA_LIBEXECDIR’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:375:9: danger: ‘ready_fds[0]’ leaks here
#  373|   
#  374|   	argv = str_list_make_empty(talloc_tos());
#  375|-> 	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());
#  377|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1008]
samba-4.23.4/source3/printing/queue_process.c:375:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:375:9: throw: if ‘get_dyn_SAMBA_LIBEXECDIR’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:375:9: danger: ‘ready_fds[1]’ leaks here
#  373|   
#  374|   	argv = str_list_make_empty(talloc_tos());
#  375|-> 	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());
#  377|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1009]
samba-4.23.4/source3/printing/queue_process.c:377:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:377:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:377:9: danger: ‘ready_fds[0]’ leaks here
#  375|   	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());
#  377|-> 	str_list_add_printf(
#  378|   		&argv, "--ready-signal-fd=%d", ready_fds[1]);
#  379|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1010]
samba-4.23.4/source3/printing/queue_process.c:377:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:377:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:377:9: danger: ‘ready_fds[1]’ leaks here
#  375|   	str_list_add_printf(
#  376|   		&argv, "%s/samba-bgqd", get_dyn_SAMBA_LIBEXECDIR());
#  377|-> 	str_list_add_printf(
#  378|   		&argv, "--ready-signal-fd=%d", ready_fds[1]);
#  379|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1011]
samba-4.23.4/source3/printing/queue_process.c:379:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:379:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:379:9: danger: ‘ready_fds[0]’ leaks here
#  377|   	str_list_add_printf(
#  378|   		&argv, "--ready-signal-fd=%d", ready_fds[1]);
#  379|-> 	str_list_add_printf(
#  380|   		&argv, "--parent-watch-fd=%d", 0);
#  381|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1012]
samba-4.23.4/source3/printing/queue_process.c:381:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:381:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:381:9: danger: ‘ready_fds[0]’ leaks here
#  379|   	str_list_add_printf(
#  380|   		&argv, "--parent-watch-fd=%d", 0);
#  381|-> 	str_list_add_printf(
#  382|   		&argv, "--debuglevel=%d", debuglevel_get_class(DBGC_RPC_SRV));
#  383|   	if (!is_default_dyn_CONFIGFILE()) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1013]
samba-4.23.4/source3/printing/queue_process.c:383:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:383:14: throw: if ‘is_default_dyn_CONFIGFILE’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:383:14: danger: ‘ready_fds[0]’ leaks here
#  381|   	str_list_add_printf(
#  382|   		&argv, "--debuglevel=%d", debuglevel_get_class(DBGC_RPC_SRV));
#  383|-> 	if (!is_default_dyn_CONFIGFILE()) {
#  384|   		str_list_add_printf(
#  385|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1014]
samba-4.23.4/source3/printing/queue_process.c:384:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:383:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:384:17: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:384:17: throw: if ‘get_dyn_CONFIGFILE’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:384:17: danger: ‘ready_fds[0]’ leaks here
#  382|   		&argv, "--debuglevel=%d", debuglevel_get_class(DBGC_RPC_SRV));
#  383|   	if (!is_default_dyn_CONFIGFILE()) {
#  384|-> 		str_list_add_printf(
#  385|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());
#  386|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1015]
samba-4.23.4/source3/printing/queue_process.c:387:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:387:14: throw: if ‘is_default_dyn_LOGFILEBASE’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:387:14: danger: ‘ready_fds[0]’ leaks here
#  385|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());
#  386|   	}
#  387|-> 	if (!is_default_dyn_LOGFILEBASE()) {
#  388|   		str_list_add_printf(
#  389|   			&argv, "--log-basename=%s", get_dyn_LOGFILEBASE());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1016]
samba-4.23.4/source3/printing/queue_process.c:388:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:387:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:388:17: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:388:17: throw: if ‘get_dyn_LOGFILEBASE’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:388:17: danger: ‘ready_fds[0]’ leaks here
#  386|   	}
#  387|   	if (!is_default_dyn_LOGFILEBASE()) {
#  388|-> 		str_list_add_printf(
#  389|   			&argv, "--log-basename=%s", get_dyn_LOGFILEBASE());
#  390|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1017]
samba-4.23.4/source3/printing/queue_process.c:391:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:391:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:391:9: danger: ‘ready_fds[0]’ leaks here
#  389|   			&argv, "--log-basename=%s", get_dyn_LOGFILEBASE());
#  390|   	}
#  391|-> 	str_list_add_printf(&argv, "-F");
#  392|   	if (argv == NULL) {
#  393|   		goto nomem;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1018]
samba-4.23.4/source3/printing/queue_process.c:396:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:392:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:396:15: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:396:15: throw: if ‘posix_spawn’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:396:15: danger: ‘ready_fds[0]’ leaks here
#  394|   	}
#  395|   
#  396|-> 	ret = posix_spawn(&pid, argv[0], NULL, NULL, argv, environ);
#  397|   	if (ret == -1) {
#  398|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1019]
samba-4.23.4/source3/printing/queue_process.c:402:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:392:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:396:15: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:397:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:400:9: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:400:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:402:9: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:402:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:402:9: danger: ‘ready_fds[0]’ leaks here
#  400|   	TALLOC_FREE(argv);
#  401|   
#  402|-> 	close(ready_fds[1]);
#  403|   
#  404|   	nread = sys_read(ready_fds[0], &pid, sizeof(pid));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1020]
samba-4.23.4/source3/printing/queue_process.c:404:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/printing/queue_process.c:370:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/printing/queue_process.c:374:16: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:392:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:396:15: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:397:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:400:9: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:400:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/printing/queue_process.c:402:9: branch_false: ...to here
samba-4.23.4/source3/printing/queue_process.c:404:17: throw: if ‘sys_read’ throws an exception...
samba-4.23.4/source3/printing/queue_process.c:404:17: danger: ‘ready_fds[0]’ leaks here
#  402|   	close(ready_fds[1]);
#  403|   
#  404|-> 	nread = sys_read(ready_fds[0], &pid, sizeof(pid));
#  405|   	close(ready_fds[0]);
#  406|   	if (nread != sizeof(pid)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1021]
samba-4.23.4/source3/registry/reg_api_util.c:53:23: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
samba-4.23.4/source3/registry/reg_api_util.c:42:22: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_api_util.c:42:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
samba-4.23.4/source3/registry/reg_api_util.c:46:13: branch_false: ...to here
samba-4.23.4/source3/registry/reg_api_util.c:48:12: branch_true: following ‘true’ branch (when ‘p’ is NULL)...
samba-4.23.4/source3/registry/reg_api_util.c:53:23: branch_true: ...to here
samba-4.23.4/source3/registry/reg_api_util.c:53:23: throw: if ‘reg_openhive’ throws an exception...
samba-4.23.4/source3/registry/reg_api_util.c:53:23: danger: ‘path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   51|   		 */
#   52|   
#   53|-> 		err = reg_openhive(mem_ctx, path, desired_access, token,
#   54|   				   &hive);
#   55|   		if (!W_ERROR_IS_OK(err)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1022]
samba-4.23.4/source3/registry/reg_api_util.c:66:15: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
samba-4.23.4/source3/registry/reg_api_util.c:42:22: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_api_util.c:42:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
samba-4.23.4/source3/registry/reg_api_util.c:46:13: branch_false: ...to here
samba-4.23.4/source3/registry/reg_api_util.c:48:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_api_util.c:66:15: throw: if ‘reg_openhive’ throws an exception...
samba-4.23.4/source3/registry/reg_api_util.c:66:15: danger: ‘path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   64|   	*p = '\0';
#   65|   
#   66|-> 	err = reg_openhive(mem_ctx, path, KEY_ENUMERATE_SUB_KEYS, token,
#   67|   			   &hive);
#   68|   	if (!W_ERROR_IS_OK(err)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1023]
samba-4.23.4/source3/registry/reg_api_util.c:73:15: warning[-Wanalyzer-malloc-leak]: leak of ‘path’
samba-4.23.4/source3/registry/reg_api_util.c:42:22: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_api_util.c:42:12: branch_false: following ‘false’ branch (when ‘path’ is non-NULL)...
samba-4.23.4/source3/registry/reg_api_util.c:46:13: branch_false: ...to here
samba-4.23.4/source3/registry/reg_api_util.c:48:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_api_util.c:68:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source3/registry/reg_api_util.c:73:42: branch_false: ...to here
samba-4.23.4/source3/registry/reg_api_util.c:73:15: throw: if ‘reg_openkey’ throws an exception...
samba-4.23.4/source3/registry/reg_api_util.c:73:15: danger: ‘path’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   71|   	}
#   72|   
#   73|-> 	err = reg_openkey(mem_ctx, hive, p+1, desired_access, &key);
#   74|   
#   75|   	TALLOC_FREE(hive);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1024]
samba-4.23.4/source3/registry/reg_backend_db.c:1084:16: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
samba-4.23.4/source3/registry/reg_backend_db.c:1055:12: branch_false: following ‘false’ branch (when ‘key’ is non-NULL)...
samba-4.23.4/source3/registry/reg_backend_db.c:1060:19: branch_false: ...to here
samba-4.23.4/source3/registry/reg_backend_db.c:1061:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_backend_db.c:1066:19: branch_false: ...to here
samba-4.23.4/source3/registry/reg_backend_db.c:1067:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_backend_db.c:1074:29: branch_false: ...to here
samba-4.23.4/source3/registry/reg_backend_db.c:1074:29: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_backend_db.c:1075:12: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)...
samba-4.23.4/source3/registry/reg_backend_db.c:1084:16: branch_false: ...to here
samba-4.23.4/source3/registry/reg_backend_db.c:1084:16: throw: if ‘tdb_pack’ throws an exception...
samba-4.23.4/source3/registry/reg_backend_db.c:1084:16: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
# 1082|   	/* store the number of subkeys */
# 1083|   
# 1084|-> 	len += tdb_pack(buffer+len, buflen-len, "d", num_subkeys);
# 1085|   
# 1086|   	/* pack all the strings */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1025]
samba-4.23.4/source3/registry/reg_format.c:803:17: warning[-Wanalyzer-file-leak]: leak of FILE
samba-4.23.4/source3/registry/reg_format.c:750:20: enter_function: entry to ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:764:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:769:15: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:769:15: call_function: calling ‘reg_format_file_opt’ from ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:769:15: return_function: returning to ‘reg_format_file’ from ‘reg_format_file_opt’
samba-4.23.4/source3/registry/reg_format.c:773:15: call_function: calling ‘reg_format_new’ from ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:773:15: return_function: returning to ‘reg_format_file’ from ‘reg_format_new’
samba-4.23.4/source3/registry/reg_format.c:775:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:781:9: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:783:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:789:14: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:789:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:794:29: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:796:25: acquire_resource: opened here
samba-4.23.4/source3/registry/reg_format.c:797:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:802:13: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:802:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:803:17: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:803:17: danger: leaks here; was opened at [(22)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/21)
#  801|   
#  802|   	if (setvbuf(fmt_ctx->file, NULL, _IOFBF, 64000) < 0) {
#  803|-> 		DEBUG(0, ("reg_format_file: setvbuf failed: %s\n", strerror(errno)));
#  804|   	}
#  805|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1026]
samba-4.23.4/source3/registry/reg_format.c:803:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/registry/reg_format.c:750:20: enter_function: entry to ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:764:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:769:15: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:769:15: call_function: calling ‘reg_format_file_opt’ from ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:769:15: return_function: returning to ‘reg_format_file’ from ‘reg_format_file_opt’
samba-4.23.4/source3/registry/reg_format.c:773:15: call_function: calling ‘reg_format_new’ from ‘reg_format_file’
samba-4.23.4/source3/registry/reg_format.c:773:15: return_function: returning to ‘reg_format_file’ from ‘reg_format_new’
samba-4.23.4/source3/registry/reg_format.c:775:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:781:9: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:783:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:789:14: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:789:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:794:29: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:796:25: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_format.c:797:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_format.c:802:13: branch_false: ...to here
samba-4.23.4/source3/registry/reg_format.c:802:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_format.c:803:17: branch_true: ...to here
samba-4.23.4/source3/registry/reg_format.c:803:17: danger: ‘<unknown>’ leaks here; was allocated at [(22)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/21)
#  801|   
#  802|   	if (setvbuf(fmt_ctx->file, NULL, _IOFBF, 64000) < 0) {
#  803|-> 		DEBUG(0, ("reg_format_file: setvbuf failed: %s\n", strerror(errno)));
#  804|   	}
#  805|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1027]
samba-4.23.4/source3/registry/reg_parse.c:755:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/source3/registry/reg_parse.c:1060:5: enter_function: entry to ‘reg_parse_file’
samba-4.23.4/source3/registry/reg_parse.c:1066:14: acquire_resource: opened here
samba-4.23.4/source3/registry/reg_parse.c:1067:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_parse.c:1073:15: branch_false: ...to here
samba-4.23.4/source3/registry/reg_parse.c:1073:15: call_function: calling ‘reg_parse_fd’ from ‘reg_parse_file’
#  753|   	char *key, *val;
#  754|   
#  755|-> 	if (options == NULL) {
#  756|   		goto done;
#  757|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1028]
samba-4.23.4/source3/registry/reg_parse.c:803:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/source3/registry/reg_parse.c:1060:5: enter_function: entry to ‘reg_parse_file’
samba-4.23.4/source3/registry/reg_parse.c:1066:14: acquire_resource: opened here
samba-4.23.4/source3/registry/reg_parse.c:1067:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_parse.c:1073:15: branch_false: ...to here
samba-4.23.4/source3/registry/reg_parse.c:1073:15: call_function: calling ‘reg_parse_fd’ from ‘reg_parse_file’
#  801|   int reg_parse_fd(int fd, const struct reg_parse_callback* cb, const char* opts)
#  802|   {
#  803|-> 	void* mem_ctx            = talloc_stackframe();
#  804|   	cbuf* line               = cbuf_new(mem_ctx);
#  805|   	smb_iconv_t cd           = (smb_iconv_t)-1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1029]
samba-4.23.4/source3/registry/reg_parse.c:804:36: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(fname, 0)’
samba-4.23.4/source3/registry/reg_parse.c:1060:5: enter_function: entry to ‘reg_parse_file’
samba-4.23.4/source3/registry/reg_parse.c:1066:14: acquire_resource: opened here
samba-4.23.4/source3/registry/reg_parse.c:1067:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_parse.c:1073:15: branch_false: ...to here
samba-4.23.4/source3/registry/reg_parse.c:1073:15: call_function: calling ‘reg_parse_fd’ from ‘reg_parse_file’
#  802|   {
#  803|   	void* mem_ctx            = talloc_stackframe();
#  804|-> 	cbuf* line               = cbuf_new(mem_ctx);
#  805|   	smb_iconv_t cd           = (smb_iconv_t)-1;
#  806|   	struct reg_parse* parser = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1030]
samba-4.23.4/source3/registry/reg_parse_internal.c:237:20: warning[-Wanalyzer-malloc-leak]: leak of ‘iconv_open(smbreg_get_charset(to), smbreg_get_charset(from))’
samba-4.23.4/source3/registry/reg_parse_internal.c:233:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_parse_internal.c:234:24: branch_true: ...to here
samba-4.23.4/source3/registry/reg_parse_internal.c:236:24: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_parse_internal.c:237:20: danger: ‘iconv_open(smbreg_get_charset(to), smbreg_get_charset(from))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  235|   		from = smbreg_get_charset(from);
#  236|   		cd   = smb_iconv_open(to, from);
#  237|-> 		if (cd == ((smb_iconv_t)-1)) {
#  238|   			return false;
#  239|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1031]
samba-4.23.4/source3/registry/reg_parse_internal.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘cd’
samba-4.23.4/source3/registry/reg_parse_internal.c:233:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_parse_internal.c:234:24: branch_true: ...to here
samba-4.23.4/source3/registry/reg_parse_internal.c:236:24: acquire_memory: allocated here
samba-4.23.4/source3/registry/reg_parse_internal.c:237:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/registry/reg_parse_internal.c:241:14: branch_false: ...to here
samba-4.23.4/source3/registry/reg_parse_internal.c:241:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/registry/reg_parse_internal.c:242:17: branch_true: ...to here
samba-4.23.4/source3/registry/reg_parse_internal.c:242:17: throw: if ‘iconv_close’ throws an exception...
samba-4.23.4/source3/registry/reg_parse_internal.c:242:17: danger: ‘cd’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  240|   	}
#  241|   	if ((*t != (smb_iconv_t)NULL) && (*t != (smb_iconv_t)-1)) {
#  242|-> 		smb_iconv_close(*t);
#  243|   	}
#  244|   	*t = cd;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1032]
samba-4.23.4/source3/rpc_client/local_np.c:107:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor
samba-4.23.4/source3/rpc_client/local_np.c:77:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:80:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:86:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:90:9: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:96:12: branch_false: following ‘false’ branch (when ‘len <= 107’)...
samba-4.23.4/source3/rpc_client/local_np.c:101:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:101:23: acquire_resource: stream socket created here
samba-4.23.4/source3/rpc_client/local_np.c:102:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:107:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:107:15: danger: leaks here
#  105|   	}
#  106|   
#  107|-> 	ret = set_blocking(state->sock, true);
#  108|   	if (ret == -1) {
#  109|   		tevent_req_error(req, errno);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1033]
samba-4.23.4/source3/rpc_client/local_np.c:354:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[0]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:354:14: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: danger: ‘ready_fds[0]’ leaks here
#  352|   	}
#  353|   
#  354|-> 	ok = smb_set_close_on_exec(ready_fds[0]);
#  355|   	if (!ok) {
#  356|   		ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1034]
samba-4.23.4/source3/rpc_client/local_np.c:354:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:354:14: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: danger: ‘ready_fds[1]’ leaks here
#  352|   	}
#  353|   
#  354|-> 	ok = smb_set_close_on_exec(ready_fds[0]);
#  355|   	if (!ok) {
#  356|   		ret = errno;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1035]
samba-4.23.4/source3/rpc_client/local_np.c:357:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:356:23: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:357:17: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:357:17: danger: ‘ready_fds[1]’ leaks here
#  355|   	if (!ok) {
#  356|   		ret = errno;
#  357|-> 		DBG_DEBUG("smb_set_close_on_exec failed: %s\n",
#  358|   			  strerror(ret));
#  359|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1036]
samba-4.23.4/source3/rpc_client/local_np.c:362:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:362:16: throw: if ‘str_list_make_empty’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: danger: ‘ready_fds[1]’ leaks here
#  360|   	}
#  361|   
#  362|-> 	argv = str_list_make_empty(mem_ctx);
#  363|   	str_list_add_printf(
#  364|   		&argv, "%s/samba-dcerpcd", get_dyn_SAMBA_LIBEXECDIR());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1037]
samba-4.23.4/source3/rpc_client/local_np.c:363:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:363:9: throw: if ‘get_dyn_SAMBA_LIBEXECDIR’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:363:9: danger: ‘ready_fds[1]’ leaks here
#  361|   
#  362|   	argv = str_list_make_empty(mem_ctx);
#  363|-> 	str_list_add_printf(
#  364|   		&argv, "%s/samba-dcerpcd", get_dyn_SAMBA_LIBEXECDIR());
#  365|   	if (!is_default_dyn_CONFIGFILE()) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1038]
samba-4.23.4/source3/rpc_client/local_np.c:365:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:365:14: throw: if ‘is_default_dyn_CONFIGFILE’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:365:14: danger: ‘ready_fds[1]’ leaks here
#  363|   	str_list_add_printf(
#  364|   		&argv, "%s/samba-dcerpcd", get_dyn_SAMBA_LIBEXECDIR());
#  365|-> 	if (!is_default_dyn_CONFIGFILE()) {
#  366|   		str_list_add_printf(
#  367|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1039]
samba-4.23.4/source3/rpc_client/local_np.c:366:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:365:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:366:17: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:366:17: throw: if ‘get_dyn_CONFIGFILE’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:366:17: danger: ‘ready_fds[1]’ leaks here
#  364|   		&argv, "%s/samba-dcerpcd", get_dyn_SAMBA_LIBEXECDIR());
#  365|   	if (!is_default_dyn_CONFIGFILE()) {
#  366|-> 		str_list_add_printf(
#  367|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());
#  368|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1040]
samba-4.23.4/source3/rpc_client/local_np.c:369:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:369:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:369:9: danger: ‘ready_fds[1]’ leaks here
#  367|   			&argv, "--configfile=%s", get_dyn_CONFIGFILE());
#  368|   	}
#  369|-> 	str_list_add_printf(&argv, "--libexec-rpcds");
#  370|   	str_list_add_printf(&argv, "--ready-signal-fd=%d", ready_fds[1]);
#  371|   	str_list_add_printf(&argv, "--np-helper");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1041]
samba-4.23.4/source3/rpc_client/local_np.c:370:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:362:16: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:370:9: throw: if ‘str_list_add_printf’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:370:9: danger: ‘ready_fds[1]’ leaks here
#  368|   	}
#  369|   	str_list_add_printf(&argv, "--libexec-rpcds");
#  370|-> 	str_list_add_printf(&argv, "--ready-signal-fd=%d", ready_fds[1]);
#  371|   	str_list_add_printf(&argv, "--np-helper");
#  372|   	str_list_add_printf(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1042]
samba-4.23.4/source3/rpc_client/local_np.c:407:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:356:23: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:406:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:407:17: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:407:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:407:17: danger: ‘ready_fds[1]’ leaks here
#  405|   fail:
#  406|   	if (ready_fds[0] != -1) {
#  407|-> 		close(ready_fds[0]);
#  408|   		ready_fds[0] = -1;
#  409|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1043]
samba-4.23.4/source3/rpc_client/local_np.c:411:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:356:23: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:410:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:411:17: branch_true: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:411:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:411:17: danger: ‘ready_fds[1]’ leaks here
#  409|   	}
#  410|   	if (ready_fds[1] != -1) {
#  411|-> 		close(ready_fds[1]);
#  412|   		ready_fds[1] = -1;
#  413|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1044]
samba-4.23.4/source3/rpc_client/local_np.c:415:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘ready_fds[1]’
samba-4.23.4/source3/rpc_client/local_np.c:343:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:347:15: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:348:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source3/rpc_client/local_np.c:354:14: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:356:23: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:410:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_client/local_np.c:414:9: branch_false: ...to here
samba-4.23.4/source3/rpc_client/local_np.c:415:16: throw: if ‘tevent_req_post’ throws an exception...
samba-4.23.4/source3/rpc_client/local_np.c:415:16: danger: ‘ready_fds[1]’ leaks here
#  413|   	}
#  414|   	tevent_req_error(req, ret);
#  415|-> 	return tevent_req_post(req, ev);
#  416|   }
#  417|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1045]
samba-4.23.4/source3/rpc_client/wsp_cli.c:887:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘vvalue.vt_bstr_v.vvector_data’
samba-4.23.4/source3/rpc_client/wsp_cli.c:818:12: branch_false: following ‘false’ branch (when ‘outval’ is non-NULL)...
samba-4.23.4/source3/rpc_client/wsp_cli.c:822:12: branch_false: ...to here
samba-4.23.4/source3/rpc_client/wsp_cli.c:822:12: branch_false: following ‘false’ branch (when ‘count == 0’)...
samba-4.23.4/source3/rpc_client/wsp_cli.c:859:9: branch_false: ...to here
samba-4.23.4/source3/rpc_client/wsp_cli.c:859:21: branch_false: following ‘false’ branch (when ‘i >= count’)...
samba-4.23.4/source3/rpc_client/wsp_cli.c:886:9: branch_false: ...to here
samba-4.23.4/source3/rpc_client/wsp_cli.c:887:9: danger: use of uninitialized value ‘vvalue.vt_bstr_v.vvector_data’ here
#  885|   	}
#  886|   	outval->vtype = vtype | VT_VECTOR;
#  887|-> 	outval->vvalue = vvalue;
#  888|   	return true;
#  889|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1046]
samba-4.23.4/source3/rpc_client/wsp_cli.c:1420:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘crestr’
samba-4.23.4/source3/rpc_client/wsp_cli.c:1460:13: enter_function: entry to ‘process_query_node’
samba-4.23.4/source3/rpc_client/wsp_cli.c:1464:34: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1464:48: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1465:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
samba-4.23.4/source3/rpc_client/wsp_cli.c:1468:17: branch_false: ...to here
samba-4.23.4/source3/rpc_client/wsp_cli.c:1483:14: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1483:14: call_function: calling ‘process_query_node’ from ‘process_query_node’
# 1418|   		&crestr->restriction.cnoderestriction;
# 1419|   
# 1420|-> 	crestr->weight = 1000;
# 1421|   
# 1422|   	if (node->type == eAND || node->type == eOR) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1047]
samba-4.23.4/source3/rpc_client/wsp_cli.c:1457:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘crestriction’
samba-4.23.4/source3/rpc_client/wsp_cli.c:1460:13: enter_function: entry to ‘process_query_node’
samba-4.23.4/source3/rpc_client/wsp_cli.c:1464:34: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1464:48: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1465:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
samba-4.23.4/source3/rpc_client/wsp_cli.c:1468:17: branch_false: ...to here
samba-4.23.4/source3/rpc_client/wsp_cli.c:1483:14: release_memory: ‘left’ is NULL
samba-4.23.4/source3/rpc_client/wsp_cli.c:1483:14: call_function: calling ‘process_query_node’ from ‘process_query_node’
# 1455|   			t_query *node)
# 1456|   {
# 1457|-> 	*crestriction = *node->restriction;
# 1458|   }
# 1459|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1048]
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:241:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘j’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:321:8: enter_function: entry to ‘_dfs_Enum’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:378:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:379:25: branch_true: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:381:25: call_function: calling ‘init_reply_dfs_info_1’ from ‘_dfs_Enum’
#  239|   static bool init_reply_dfs_info_1(TALLOC_CTX *mem_ctx, struct junction_map* j,struct dfs_Info1* dfs1)
#  240|   {
#  241|-> 	dfs1->path = talloc_asprintf(mem_ctx,
#  242|   				"\\\\%s\\%s\\%s", lp_netbios_name(),
#  243|   				j->service_name, j->volume_name);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1049]
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:253:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘j’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:321:8: enter_function: entry to ‘_dfs_Enum’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:378:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:379:25: branch_true: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:384:25: call_function: calling ‘init_reply_dfs_info_2’ from ‘_dfs_Enum’
#  251|   static bool init_reply_dfs_info_2(TALLOC_CTX *mem_ctx, struct junction_map* j, struct dfs_Info2* dfs2)
#  252|   {
#  253|-> 	dfs2->path = talloc_asprintf(mem_ctx,
#  254|   			"\\\\%s\\%s\\%s", lp_netbios_name(), j->service_name, j->volume_name);
#  255|   	if (dfs2->path == NULL)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1050]
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:266:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘j’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:321:8: enter_function: entry to ‘_dfs_Enum’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:378:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:379:25: branch_true: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:387:25: call_function: calling ‘init_reply_dfs_info_3’ from ‘_dfs_Enum’
#  264|   {
#  265|   	size_t ii;
#  266|-> 	if (j->volume_name[0] == '\0')
#  267|   		dfs3->path = talloc_asprintf(mem_ctx, "\\\\%s\\%s",
#  268|   			lp_netbios_name(), j->service_name);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1051]
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:308:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘stor’
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:273:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:276:25: branch_false: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:281:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:287:17: branch_false: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:287:17: release_memory: ‘*dfs3.stores’ is NULL
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:290:18: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:293:50: branch_true: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:293:50: release_memory: ‘*dfs3.stores’ is NULL
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:297:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:300:17: branch_false: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:302:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:306:17: branch_false: ...to here
samba-4.23.4/source3/rpc_server/dfs/srv_dfs_nt.c:308:17: danger: dereference of NULL ‘stor’
#  306|   		*p = '\0';
#  307|   		DBG_INFO("storage %zu: %s.%s\n",ii,path,p+1);
#  308|-> 		stor->state = 2; /* set all stores as ONLINE */
#  309|   		stor->server = talloc_strdup(mem_ctx, path);
#  310|   		stor->share = talloc_strdup(mem_ctx, p+1);

Error: COMPILER_WARNING (CWE-704): [#def1052]
samba-4.23.4/source3/rpc_server/rpc_host.c: scope_hint: In function ‘rpc_exe_parse_iface_line’
samba-4.23.4/source3/rpc_server/rpc_host.c:316:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  316 |         name = strchr(line, ' ');
#      |              ^
#  314|   	}
#  315|   
#  316|-> 	name = strchr(line, ' ');
#  317|   	if (name == NULL) {
#  318|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def1053]
samba-4.23.4/source3/rpc_server/rpc_host.c:316:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  314|   	}
#  315|   
#  316|-> 	name = strchr(line, ' ');
#  317|   	if (name == NULL) {
#  318|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1054]
samba-4.23.4/source3/rpc_server/rpc_host.c:1549:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘map’
samba-4.23.4/source3/rpc_server/rpc_host.c:1496:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/rpc_host.c:1496:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:1500:19: branch_true: following ‘true’ branch (when ‘i < num_ifaces’)...
samba-4.23.4/source3/rpc_server/rpc_host.c:1501:54: branch_true: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:1514:27: branch_false: following ‘false’ branch (when ‘j >= num_maps’)...
samba-4.23.4/source3/rpc_server/rpc_host.c:1521:20: branch_false: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:1521:20: branch_false: following ‘false’ branch (when ‘j != num_maps’)...
samba-4.23.4/source3/rpc_server/rpc_host.c:1549:21: branch_false: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:1549:21: danger: dereference of NULL ‘map’
# 1547|   		}
# 1548|   
# 1549|-> 		p = strv_find(map->bindings, binding_string);
# 1550|   		if (p == NULL) {
# 1551|   			int ret = strv_add(

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1055]
samba-4.23.4/source3/rpc_server/rpc_host.c:2151:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/rpc_server/rpc_host.c:2128:13: enter_function: entry to ‘rpc_host_endpoint_accept_got_bind’
samba-4.23.4/source3/rpc_server/rpc_host.c:2137:33: release_memory: ‘client’ is NULL
samba-4.23.4/source3/rpc_server/rpc_host.c:2142:15: call_function: calling ‘rpc_host_bind_read_recv’ from ‘rpc_host_endpoint_accept_got_bind’
samba-4.23.4/source3/rpc_server/rpc_host.c:2142:15: return_function: returning to ‘rpc_host_endpoint_accept_got_bind’ from ‘rpc_host_bind_read_recv’
samba-4.23.4/source3/rpc_server/rpc_host.c:2145:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/rpc_host.c:2151:57: branch_false: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:2151:27: release_memory: ‘client’ is NULL
samba-4.23.4/source3/rpc_server/rpc_host.c:2151:9: danger: dereference of NULL ‘client’
# 2149|   	}
# 2150|   
# 2151|-> 	client->binding = dcerpc_binding_string(client, endpoint->binding);
# 2152|   	if (client->binding == NULL) {
# 2153|   		DBG_WARNING("dcerpc_binding_string failed, dropping client\n");

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1056]
samba-4.23.4/source3/rpc_server/rpc_host.c:2538:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/rpc_server/rpc_host.c:2514:13: enter_function: entry to ‘rpc_host_server_setup_done’
samba-4.23.4/source3/rpc_server/rpc_host.c:2520:28: release_memory: ‘server’ is NULL
samba-4.23.4/source3/rpc_server/rpc_host.c:2525:18: call_function: calling ‘rpc_server_setup_recv’ from ‘rpc_host_server_setup_done’
samba-4.23.4/source3/rpc_server/rpc_host.c:2525:18: return_function: returning to ‘rpc_host_server_setup_done’ from ‘rpc_server_setup_recv’
samba-4.23.4/source3/rpc_server/rpc_host.c:2527:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/rpc_host.c:2538:32: branch_false: ...to here
samba-4.23.4/source3/rpc_server/rpc_host.c:2538:15: release_memory: ‘server’ is NULL
samba-4.23.4/source3/rpc_server/rpc_host.c:2538:9: danger: dereference of NULL ‘server’
# 2536|   	}
# 2537|   
# 2538|-> 	server->server_index = state->num_prepared;
# 2539|   	host->servers[state->num_prepared] = server;
# 2540|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1057]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: throw: if ‘opendir’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  115|   	}
#  116|   
#  117|-> 	dirp = opendir("/dev");
#  118|   	if (!dirp) {
#  119|   		SAFE_FREE(line);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1058]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: throw: if ‘readdirname’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  121|   	}
#  122|   
#  123|-> 	while ((dpname = readdirname(dirp)) != NULL) {
#  124|   		if (strncmp(dpname, "pty", 3) == 0 && strlen(dpname) == 5) {
#  125|   			DEBUG(3,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1059]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir("/dev")’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: throw: if ‘readdirname’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:26: danger: ‘opendir("/dev")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  121|   	}
#  122|   
#  123|-> 	while ((dpname = readdirname(dirp)) != NULL) {
#  124|   		if (strncmp(dpname, "pty", 3) == 0 && strlen(dpname) == 5) {
#  125|   			DEBUG(3,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1060]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:125:25: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:124:21: branch_true: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:125:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:125:25: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  123|   	while ((dpname = readdirname(dirp)) != NULL) {
#  124|   		if (strncmp(dpname, "pty", 3) == 0 && strlen(dpname) == 5) {
#  125|-> 			DEBUG(3,
#  126|   			      ("pty: try to open %s, line was %s\n", dpname,
#  127|   			       line));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1061]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:130:39: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:124:21: branch_true: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:130:39: throw: if ‘open’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:130:39: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  128|   			line[8] = dpname[3];
#  129|   			line[9] = dpname[4];
#  130|-> 			if ((master = open(line, O_RDWR, 0)) >= 0) {
#  131|   				DEBUG(3, ("pty: opened %s\n", line));
#  132|   				line[5] = 't';

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1062]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:131:33: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:123:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:124:21: branch_true: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:131:33: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:131:33: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  129|   			line[9] = dpname[4];
#  130|   			if ((master = open(line, O_RDWR, 0)) >= 0) {
#  131|-> 				DEBUG(3, ("pty: opened %s\n", line));
#  132|   				line[5] = 't';
#  133|   				*slave = line;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1063]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:139:9: warning[-Wanalyzer-malloc-leak]: leak of ‘line’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:90:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:112:16: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:113:12: branch_false: following ‘false’ branch (when ‘line’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:118:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:139:9: throw: if ‘closedir’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:139:9: danger: ‘line’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  137|   		}
#  138|   	}
#  139|-> 	closedir(dirp);
#  140|   	SAFE_FREE(line);
#  141|   	return (-1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1064]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:204:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(slavedev, 2, 0), 0)’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:153:12: branch_false: following ‘false’ branch (when ‘pass’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:160:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:166:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:22: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:185:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:204:13: acquire_resource: opened here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:204:12: danger: ‘dup2(open(slavedev, 2, 0), 0)’ leaks here; was opened at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
#  202|   	/* Make slave stdin/out/err of child. */
#  203|   
#  204|-> 	if (dup2(slave, STDIN_FILENO) != STDIN_FILENO)
#  205|   	{
#  206|   		DEBUG(3, ("Could not re-direct stdin\n"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1065]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(slavedev, 2, 0), 1)’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:153:12: branch_false: following ‘false’ branch (when ‘pass’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:160:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:166:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:22: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:185:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:204:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:13: acquire_resource: opened here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:12: danger: ‘dup2(open(slavedev, 2, 0), 1)’ leaks here; was opened at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8)
#  207|   		return (False);
#  208|   	}
#  209|-> 	if (dup2(slave, STDOUT_FILENO) != STDOUT_FILENO)
#  210|   	{
#  211|   		DEBUG(3, ("Could not re-direct stdout\n"));

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1066]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:214:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open(slavedev, 2, 0), 2)’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:153:12: branch_false: following ‘false’ branch (when ‘pass’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:160:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:166:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:22: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:185:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:204:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:209:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:214:13: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:214:13: acquire_resource: opened here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:214:12: danger: ‘dup2(open(slavedev, 2, 0), 2)’ leaks here; was opened at [(11)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/10)
#  212|   		return (False);
#  213|   	}
#  214|-> 	if (dup2(slave, STDERR_FILENO) != STDERR_FILENO)
#  215|   	{
#  216|   		DEBUG(3, ("Could not re-direct stderr\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1067]
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:310:33: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:281:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:285:27: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:295:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:300:31: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:305:45: acquire_memory: allocated here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:306:36: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:310:33: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:310:33: throw: if ‘trim_char’ throws an exception...
samba-4.23.4/source3/rpc_server/samr/srv_samr_chgpasswd.c:310:33: danger: ‘str’ leaks here; was allocated at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  308|   					return False;
#  309|   				}
#  310|-> 				trim_char(str, ' ', ' ');
#  311|   
#  312|   				if ((match = unix_wild_match(expected, str)) == True) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1068]
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2186:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘names’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2199:10: enter_function: entry to ‘_samr_LookupRids’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2215:17: call_function: calling ‘samr_policy_handle_find’ from ‘_samr_LookupRids’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2215:17: return_function: returning to ‘_samr_LookupRids’ from ‘samr_policy_handle_find’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2221:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2225:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2225:12: branch_false: following ‘false’ branch (when ‘num_rids <= 1000’)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2231:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2231:12: branch_false: following ‘false’ branch (when ‘num_rids == 0’)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2244:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2249:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2253:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2253:14: call_function: calling ‘make_samr_lookup_rids’ from ‘_samr_LookupRids’
# 2184|   
# 2185|   	for (i = 0; i < num_names; i++) {
# 2186|-> 		DEBUG(10, ("names[%d]:%s\n", i, names[i] && *names[i] ? names[i] : ""));
# 2187|   		init_lsa_String(&lsa_name_array[i], names[i]);
# 2188|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1069]
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2187:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘names’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2199:10: enter_function: entry to ‘_samr_LookupRids’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2215:17: call_function: calling ‘samr_policy_handle_find’ from ‘_samr_LookupRids’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2215:17: return_function: returning to ‘_samr_LookupRids’ from ‘samr_policy_handle_find’
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2221:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2225:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2225:12: branch_false: following ‘false’ branch (when ‘num_rids <= 1000’)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2231:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2231:12: branch_false: following ‘false’ branch (when ‘num_rids == 0’)...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2244:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2249:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2253:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/samr/srv_samr_nt.c:2253:14: call_function: calling ‘make_samr_lookup_rids’ from ‘_samr_LookupRids’
# 2185|   	for (i = 0; i < num_names; i++) {
# 2186|   		DEBUG(10, ("names[%d]:%s\n", i, names[i] && *names[i] ? names[i] : ""));
# 2187|-> 		init_lsa_String(&lsa_name_array[i], names[i]);
# 2188|   	}
# 2189|   

Error: COMPILER_WARNING (CWE-704): [#def1070]
samba-4.23.4/source3/rpc_server/spoolss/srv_spoolss_nt.c: scope_hint: In function ‘_spoolss_SetPrinterDataEx’
samba-4.23.4/source3/rpc_server/spoolss/srv_spoolss_nt.c:10167:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#10167 |         oid_string = strchr(r->in.value_name, ',');
#      |                    ^
#10165|   	/* check for OID in valuename */
#10166|   
#10167|-> 	oid_string = strchr(r->in.value_name, ',');
#10168|   	if (oid_string) {
#10169|   		*oid_string = '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1071]
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:218:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(talloc_asprintf(mem_ctx, "%s/%s/%s",  get_dyn_MODULESDIR(), "svcctl", servicename), "r")’
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:255:13: enter_function: entry to ‘svcctl_add_service’
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:279:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:283:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:297:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:302:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:302:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:310:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:316:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:321:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:321:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:327:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:338:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:338:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:344:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:350:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:355:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:361:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:367:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:396:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:397:49: branch_true: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:411:21: call_function: calling ‘read_init_file’ from ‘svcctl_add_service’
#  216|   		   comment starting with a '#' */
#  217|   
#  218|-> 		if (str[0] != '#') {
#  219|   			continue;
#  220|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1072]
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:218:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(talloc_asprintf(mem_ctx, "%s/%s/%s",  get_dyn_MODULESDIR(), "svcctl", servicename), "r")’
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:255:13: enter_function: entry to ‘svcctl_add_service’
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:279:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:283:9: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:297:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:302:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:302:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:310:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:316:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:321:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:321:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:327:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:338:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:338:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:344:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:350:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:355:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:355:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:361:18: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:367:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:14: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:372:12: branch_false: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:396:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:397:49: branch_true: ...to here
samba-4.23.4/source3/rpc_server/svcctl/srv_svcctl_reg.c:411:21: call_function: calling ‘read_init_file’ from ‘svcctl_add_service’
#  216|   		   comment starting with a '#' */
#  217|   
#  218|-> 		if (str[0] != '#') {
#  219|   			continue;
#  220|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1073]
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: warning[-Wanalyzer-malloc-leak]: leak of ‘in_data’
samba-4.23.4/source3/rpcclient/cmd_echo.c:60:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:65:16: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:66:35: acquire_memory: allocated here
samba-4.23.4/source3/rpcclient/cmd_echo.c:66:12: branch_false: following ‘false’ branch (when ‘in_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:36: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:12: branch_false: following ‘false’ branch (when ‘out_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:12: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: throw: if ‘dcerpc_echo_EchoData’ throws an exception...
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: danger: ‘in_data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   81|   	}
#   82|   
#   83|-> 	status = dcerpc_echo_EchoData(b, mem_ctx, size, in_data, out_data);
#   84|   	if (!NT_STATUS_IS_OK(status)) {
#   85|   		goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1074]
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: warning[-Wanalyzer-malloc-leak]: leak of ‘out_data’
samba-4.23.4/source3/rpcclient/cmd_echo.c:60:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:65:16: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:66:12: branch_false: following ‘false’ branch (when ‘in_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:36: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:36: acquire_memory: allocated here
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:12: branch_false: following ‘false’ branch (when ‘out_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:72:12: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: throw: if ‘dcerpc_echo_EchoData’ throws an exception...
samba-4.23.4/source3/rpcclient/cmd_echo.c:83:18: danger: ‘out_data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#   81|   	}
#   82|   
#   83|-> 	status = dcerpc_echo_EchoData(b, mem_ctx, size, in_data, out_data);
#   84|   	if (!NT_STATUS_IS_OK(status)) {
#   85|   		goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1075]
samba-4.23.4/source3/rpcclient/cmd_echo.c:126:18: warning[-Wanalyzer-malloc-leak]: leak of ‘out_data’
samba-4.23.4/source3/rpcclient/cmd_echo.c:112:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:117:16: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:118:36: acquire_memory: allocated here
samba-4.23.4/source3/rpcclient/cmd_echo.c:118:12: branch_false: following ‘false’ branch (when ‘out_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:126:18: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:126:18: throw: if ‘dcerpc_echo_SourceData’ throws an exception...
samba-4.23.4/source3/rpcclient/cmd_echo.c:126:18: danger: ‘out_data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  124|   	
#  125|   
#  126|-> 	status = dcerpc_echo_SourceData(b, mem_ctx, size, out_data);
#  127|   	if (!NT_STATUS_IS_OK(status)) {
#  128|   		goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1076]
samba-4.23.4/source3/rpcclient/cmd_echo.c:170:18: warning[-Wanalyzer-malloc-leak]: leak of ‘in_data’
samba-4.23.4/source3/rpcclient/cmd_echo.c:153:12: branch_false: following ‘false’ branch (when ‘argc == 2’)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:158:16: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:159:35: acquire_memory: allocated here
samba-4.23.4/source3/rpcclient/cmd_echo.c:159:12: branch_false: following ‘false’ branch (when ‘in_data’ is non-NULL)...
samba-4.23.4/source3/rpcclient/cmd_echo.c:159:12: branch_false: ...to here
samba-4.23.4/source3/rpcclient/cmd_echo.c:170:18: throw: if ‘dcerpc_echo_SinkData’ throws an exception...
samba-4.23.4/source3/rpcclient/cmd_echo.c:170:18: danger: ‘in_data’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  168|   	}
#  169|   
#  170|-> 	status = dcerpc_echo_SinkData(b, mem_ctx, size, in_data);
#  171|   	if (!NT_STATUS_IS_OK(status)) {
#  172|   		goto done;

Error: CPPCHECK_WARNING (CWE-457): [#def1077]
samba-4.23.4/source3/rpcclient/cmd_spotlight.c:224: error[uninitvar]: Uninitialized variable: share_path
#  222|   				    argv[2],
#  223|   				    argv[1],
#  224|-> 				    share_path,
#  225|   				    &share_handle);
#  226|   	if (!NT_STATUS_IS_OK(status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1078]
samba-4.23.4/source3/rpcclient/rpcclient.c:840:9: warning[-Wanalyzer-malloc-leak]: leak of ‘entry’
samba-4.23.4/source3/rpcclient/rpcclient.c:835:23: acquire_memory: allocated here
samba-4.23.4/source3/rpcclient/rpcclient.c:835:12: branch_false: following ‘false’ branch (when ‘entry’ is non-NULL)...
samba-4.23.4/source3/rpcclient/rpcclient.c:840:9: branch_false: ...to here
samba-4.23.4/source3/rpcclient/rpcclient.c:840:9: throw: if ‘rep_memset_s’ throws an exception...
samba-4.23.4/source3/rpcclient/rpcclient.c:840:9: danger: ‘entry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  838|   	}
#  839|   
#  840|-> 	ZERO_STRUCTP(entry);
#  841|   
#  842|   	entry->cmd_set = cmd_set;

Error: CPPCHECK_WARNING (CWE-768): [#def1079]
samba-4.23.4/source3/smbd/durable.c:537: error[unknownEvaluationOrder]: Expression '.pid={.pid=0,}' depends on order of evaluation of side effects
#  535|   	if (state->e->share_file_id == id) {
#  536|   		DBG_INFO("Found more than one entry, invalidating previous\n");
#  537|-> 		*state->e = (struct share_mode_entry) { .pid = { .pid = 0, }};
#  538|   		return true;	/* end the loop through share mode entries */
#  539|   	}

Error: COMPILER_WARNING (CWE-704): [#def1080]
samba-4.23.4/source3/smbd/filename.c: scope_hint: In function ‘get_original_lcomp’
samba-4.23.4/source3/smbd/filename.c:423:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  423 |         last_slash = strrchr(filename_in, '/');
#      |                    ^
#  421|   	NTSTATUS status;
#  422|   
#  423|-> 	last_slash = strrchr(filename_in, '/');
#  424|   	if (last_slash != NULL) {
#  425|   		orig_lcomp = talloc_strdup(ctx, last_slash+1);

Error: COMPILER_WARNING (CWE-704): [#def1081]
samba-4.23.4/source3/smbd/filename.c:423:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  421|   	NTSTATUS status;
#  422|   
#  423|-> 	last_slash = strrchr(filename_in, '/');
#  424|   	if (last_slash != NULL) {
#  425|   		orig_lcomp = talloc_strdup(ctx, last_slash+1);

Error: COMPILER_WARNING (CWE-704): [#def1082]
samba-4.23.4/source3/smbd/mangle_hash.c: scope_hint: In function ‘cache_mangled_name’
samba-4.23.4/source3/smbd/mangle_hash.c:818:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  818 |         if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#      |                       ^
#  816|   	 */
#  817|   	s1 = strrchr( mangled_name_key, '.' );
#  818|-> 	if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#  819|   		size_t i = 1;
#  820|   		while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )

Error: COMPILER_WARNING (CWE-704): [#def1083]
samba-4.23.4/source3/smbd/mangle_hash.c:818:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  816|   	 */
#  817|   	s1 = strrchr( mangled_name_key, '.' );
#  818|-> 	if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#  819|   		size_t i = 1;
#  820|   		while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1084]
samba-4.23.4/source3/smbd/mangle_hash.c:930:25: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:940:13: enter_function: entry to ‘to_8_3’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:958:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/mangle_hash.c:959:35: call_function: calling ‘strisnormal’ from ‘to_8_3’
#  928|   {
#  929|   	if (case_default == CASE_UPPER)
#  930|-> 		return(!strhaslower(s));
#  931|   
#  932|   	return(!strhasupper(s));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1085]
samba-4.23.4/source3/smbd/mangle_hash.c:932:17: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:940:13: enter_function: entry to ‘to_8_3’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:958:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/mangle_hash.c:959:35: call_function: calling ‘strisnormal’ from ‘to_8_3’
#  930|   		return(!strhaslower(s));
#  931|   
#  932|-> 	return(!strhasupper(s));
#  933|   }
#  934|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1086]
samba-4.23.4/source3/smbd/mangle_hash.c:963:32: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:958:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/mangle_hash.c:961:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/mangle_hash.c:963:32: throw: if ‘str_checksum’ throws an exception...
samba-4.23.4/source3/smbd/mangle_hash.c:963:32: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  961|   		if( all_normal && p[1] != 0 ) {
#  962|   			*p = 0;
#  963|-> 			csum = str_checksum( s );
#  964|   			*p = '.';
#  965|   		} else

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1087]
samba-4.23.4/source3/smbd/mangle_hash.c:966:32: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:958:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/mangle_hash.c:966:32: throw: if ‘str_checksum’ throws an exception...
samba-4.23.4/source3/smbd/mangle_hash.c:966:32: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  964|   			*p = '.';
#  965|   		} else
#  966|-> 			csum = str_checksum(s);
#  967|   	} else
#  968|   		csum = str_checksum(s);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1088]
samba-4.23.4/source3/smbd/mangle_hash.c:968:24: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:968:24: throw: if ‘str_checksum’ throws an exception...
samba-4.23.4/source3/smbd/mangle_hash.c:968:24: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  966|   			csum = str_checksum(s);
#  967|   	} else
#  968|-> 		csum = str_checksum(s);
#  969|   
#  970|   	if (!strupper_m( s )) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1089]
samba-4.23.4/source3/smbd/mangle_hash.c:970:14: warning[-Wanalyzer-malloc-leak]: leak of ‘s’
samba-4.23.4/source3/smbd/mangle_hash.c:948:19: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash.c:953:12: branch_false: following ‘false’ branch (when ‘s’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash.c:957:13: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash.c:970:14: throw: if ‘strupper_m’ throws an exception...
samba-4.23.4/source3/smbd/mangle_hash.c:970:14: danger: ‘s’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  968|   		csum = str_checksum(s);
#  969|   
#  970|-> 	if (!strupper_m( s )) {
#  971|   		SAFE_FREE(s);
#  972|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1090]
samba-4.23.4/source3/smbd/mangle_hash2.c:318:9: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
samba-4.23.4/source3/smbd/mangle_hash2.c:312:21: acquire_memory: allocated here
samba-4.23.4/source3/smbd/mangle_hash2.c:314:12: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
samba-4.23.4/source3/smbd/mangle_hash2.c:320:43: branch_false: ...to here
samba-4.23.4/source3/smbd/mangle_hash2.c:318:9: throw: if ‘data_blob_const’ throws an exception...
samba-4.23.4/source3/smbd/mangle_hash2.c:318:9: danger: ‘str’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  316|   	}
#  317|   
#  318|-> 	memcache_add(smbd_memcache(), MANGLE_HASH2_CACHE,
#  319|   		     data_blob_const(&hash, sizeof(hash)),
#  320|   		     data_blob_const(str, length+1));

Error: COMPILER_WARNING (CWE-704): [#def1091]
samba-4.23.4/source3/smbd/mangle_hash2.c: scope_hint: In function ‘is_8_3’
samba-4.23.4/source3/smbd/mangle_hash2.c:461:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  461 |         dot_p = strchr(name, '.');
#      |               ^
#  459|   	/* find the '.'. Note that once again we use the non-multibyte
#  460|              function */
#  461|-> 	dot_p = strchr(name, '.');
#  462|   
#  463|   	if (!dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def1092]
samba-4.23.4/source3/smbd/mangle_hash2.c:461:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  459|   	/* find the '.'. Note that once again we use the non-multibyte
#  460|              function */
#  461|-> 	dot_p = strchr(name, '.');
#  462|   
#  463|   	if (!dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def1093]
samba-4.23.4/source3/smbd/mangle_hash2.c: scope_hint: In function ‘hash2_name_to_8_3’
samba-4.23.4/source3/smbd/mangle_hash2.c:705:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  705 |         dot_p = strrchr(name, '.');
#      |               ^
#  703|   
#  704|   	/* find the '.' if any */
#  705|-> 	dot_p = strrchr(name, '.');
#  706|   
#  707|   	if (dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def1094]
samba-4.23.4/source3/smbd/mangle_hash2.c:705:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  703|   
#  704|   	/* find the '.' if any */
#  705|-> 	dot_p = strrchr(name, '.');
#  706|   
#  707|   	if (dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def1095]
samba-4.23.4/source3/smbd/msdfs.c: scope_hint: In function ‘parse_dfs_path_strict’
samba-4.23.4/source3/smbd/msdfs.c:136:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  136 |         p = strchr(servicename, '\\');
#      |           ^
#  134|   	 */
#  135|   
#  136|-> 	p = strchr(servicename, '\\');
#  137|   	if (p != NULL) {
#  138|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1096]
samba-4.23.4/source3/smbd/msdfs.c:136:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  134|   	 */
#  135|   
#  136|-> 	p = strchr(servicename, '\\');
#  137|   	if (p != NULL) {
#  138|   		*p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1097]
samba-4.23.4/source3/smbd/msdfs.c:750:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘parent_smb_fname’
samba-4.23.4/source3/smbd/msdfs.c:655:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/msdfs.c:661:9: branch_false: ...to here
samba-4.23.4/source3/smbd/msdfs.c:682:38: release_memory: ‘smb_fname_walk’ is NULL
samba-4.23.4/source3/smbd/msdfs.c:684:17: branch_false: following ‘false’ branch (when ‘parent_smb_fname’ is NULL)...
samba-4.23.4/source3/smbd/msdfs.c:692:25: branch_false: ...to here
samba-4.23.4/source3/smbd/msdfs.c:701:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/msdfs.c:704:17: branch_false: ...to here
samba-4.23.4/source3/smbd/msdfs.c:706:20: branch_true: following ‘true’ branch (when ‘<unknown> != 3221226071’)...
samba-4.23.4/source3/smbd/msdfs.c:880:1: branch_true: ...to here
samba-4.23.4/source3/smbd/msdfs.c:742:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/msdfs.c:750:13: branch_false: ...to here
samba-4.23.4/source3/smbd/msdfs.c:750:13: danger: dereference of NULL ‘parent_smb_fname’
#  748|   	}
#  749|   
#  750|-> 	if (parent_smb_fname->fsp == NULL) {
#  751|   		/* Unable to open parent. */
#  752|   		DBG_DEBUG("dfspath = %s. reqpath = %s. "

Error: CPPCHECK_WARNING (CWE-768): [#def1098]
samba-4.23.4/source3/smbd/open.c:2954: error[unknownEvaluationOrder]: Expression 'req,NULL,(struct timeval){.tv_usec=timeout_usecs},(struct timeval){.tv_usec=200000}' depends on order of evaluation of side effects
# 2952|   		req,
# 2953|   		NULL,
# 2954|-> 		(struct timeval) { .tv_usec = timeout_usecs },
# 2955|   		(struct timeval) { .tv_usec = 200000 });
# 2956|   	return ok;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1099]
samba-4.23.4/source3/smbd/oplock_linux.c:191:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 0)’
samba-4.23.4/source3/smbd/oplock_linux.c:188:14: acquire_resource: opened here
samba-4.23.4/source3/smbd/oplock_linux.c:189:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/oplock_linux.c:191:15: branch_false: ...to here
samba-4.23.4/source3/smbd/oplock_linux.c:191:15: throw: if ‘fcntl’ throws an exception...
samba-4.23.4/source3/smbd/oplock_linux.c:191:15: danger: ‘open("/dev/null", 0)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  189|   	if (fd == -1)
#  190|   		return False; /* uggh! */
#  191|-> 	ret = fcntl(fd, F_GETLEASE, 0);
#  192|   	close(fd);
#  193|   	return ret == F_UNLCK;

Error: CPPCHECK_WARNING (CWE-457): [#def1100]
samba-4.23.4/source3/smbd/server.c:388: error[uninitvar]: Uninitialized variable: buf
#  386|   		SIVAL(buf, 0, am_parent->num_children);
#  387|   		messaging_send_buf(ctx, srv_id, MSG_SMB_NUM_CHILDREN,
#  388|-> 				   buf, sizeof(buf));
#  389|   	}
#  390|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1101]
samba-4.23.4/source3/smbd/smb1_ipc.c:70:17: warning[-Wanalyzer-null-argument]: use of NULL ‘rdata’ where non-null expected
samba-4.23.4/source3/smbd/smb1_ipc.c:853:6: enter_function: entry to ‘reply_transs’
samba-4.23.4/source3/smbd/smb1_ipc.c:863:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:869:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:869:43: branch_true: following ‘true’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/source3/smbd/smb1_ipc.c:871:21: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:876:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:901:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:902:38: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:901:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:905:12: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:921:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:922:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:921:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:927:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:929:9: call_function: calling ‘handle_trans’ from ‘reply_transs’
#   68|   
#   69|   	if (param_len)
#   70|-> 		memcpy(copy_into, &rparam[param_offset], param_len);
#   71|   
#   72|   	copy_into += param_len;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1102]
samba-4.23.4/source3/smbd/smb1_ipc.c:80:17: warning[-Wanalyzer-null-argument]: use of NULL ‘rdata’ where non-null expected
samba-4.23.4/source3/smbd/smb1_ipc.c:853:6: enter_function: entry to ‘reply_transs’
samba-4.23.4/source3/smbd/smb1_ipc.c:863:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:869:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:869:43: branch_true: following ‘true’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/source3/smbd/smb1_ipc.c:871:21: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:876:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:901:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:902:38: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:901:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:905:12: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:921:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:922:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:921:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_ipc.c:927:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_ipc.c:929:9: call_function: calling ‘handle_trans’ from ‘reply_transs’
#   78|   
#   79|   	if (data_len )
#   80|-> 		memcpy(copy_into, &rdata[data_offset], data_len);
#   81|   }
#   82|   

Error: COMPILER_WARNING (CWE-704): [#def1103]
samba-4.23.4/source3/smbd/smb1_lanman.c: scope_hint: In function ‘strip_unc’
samba-4.23.4/source3/smbd/smb1_lanman.c:733:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  733 |         if ((p = strrchr(unc, '\\')) != NULL) {
#      |                ^
#  731|   	}
#  732|   
#  733|-> 	if ((p = strrchr(unc, '\\')) != NULL) {
#  734|   		return p+1;
#  735|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1104]
samba-4.23.4/source3/smbd/smb1_nttrans.c:217:25: warning[-Wanalyzer-null-argument]: use of NULL ‘pp’ where non-null expected
samba-4.23.4/source3/smbd/smb1_nttrans.c:2613:6: enter_function: entry to ‘reply_nttranss’
samba-4.23.4/source3/smbd/smb1_nttrans.c:2629:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2635:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2635:43: branch_true: following ‘true’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2637:21: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2642:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2668:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2669:38: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2668:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2672:12: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2688:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2689:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2688:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2694:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2694:9: call_function: calling ‘handle_nttrans’ from ‘reply_nttranss’
#  215|   				       alignment_offset);
#  216|   			}
#  217|-> 			memcpy((smb_buf(req->outbuf)+alignment_offset), pp,
#  218|   			       params_sent_thistime);
#  219|   		}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1105]
samba-4.23.4/source3/smbd/smb1_nttrans.c:2163:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
samba-4.23.4/source3/smbd/smb1_nttrans.c:2613:6: enter_function: entry to ‘reply_nttranss’
samba-4.23.4/source3/smbd/smb1_nttrans.c:2629:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2635:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2635:43: branch_true: following ‘true’ branch (when ‘state’ is non-NULL)...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2637:21: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2642:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2668:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2669:38: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2668:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2672:12: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2688:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2689:14: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2688:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_nttrans.c:2694:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_nttrans.c:2694:9: call_function: calling ‘handle_nttrans’ from ‘reply_nttranss’
# 2161|   	SIVAL(params, 0, data_len);
# 2162|   	pdata = nttrans_realloc(ppdata, data_len);
# 2163|-> 	memcpy(pdata, resp_data, data_len);
# 2164|   
# 2165|   	TALLOC_FREE(tmp_ctx);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1106]
samba-4.23.4/source3/smbd/smb1_process.c:2570:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2570:24: danger: ‘listener_pipe[0]’ leaks here
# 2568|   	if (res == -1) {
# 2569|   		DEBUG(1, ("pipe() failed: %s\n", strerror(errno)));
# 2570|-> 		return false;
# 2571|   	}
# 2572|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1107]
samba-4.23.4/source3/smbd/smb1_process.c:2570:24: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2570:24: danger: ‘listener_pipe[1]’ leaks here
# 2568|   	if (res == -1) {
# 2569|   		DEBUG(1, ("pipe() failed: %s\n", strerror(errno)));
# 2570|-> 		return false;
# 2571|   	}
# 2572|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1108]
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: throw: if ‘tdb_runtime_check_for_robust_mutexes’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: danger: ‘listener_pipe[0]’ leaks here
# 2572|   
# 2573|   #ifdef HAVE_ROBUST_MUTEXES
# 2574|-> 	use_mutex = tdb_runtime_check_for_robust_mutexes();
# 2575|   
# 2576|   	if (use_mutex) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1109]
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: throw: if ‘tdb_runtime_check_for_robust_mutexes’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: danger: ‘listener_pipe[1]’ leaks here
# 2572|   
# 2573|   #ifdef HAVE_ROBUST_MUTEXES
# 2574|-> 	use_mutex = tdb_runtime_check_for_robust_mutexes();
# 2575|   
# 2576|   	if (use_mutex) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1110]
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: throw: if ‘anonymous_shared_allocate’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: danger: ‘listener_pipe[0]’ leaks here
# 2578|   
# 2579|   		xconn->smb1.echo_handler.socket_mutex =
# 2580|-> 			anonymous_shared_allocate(sizeof(pthread_mutex_t));
# 2581|   		if (xconn->smb1.echo_handler.socket_mutex == NULL) {
# 2582|   			DEBUG(1, ("Could not create mutex shared memory: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1111]
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: throw: if ‘anonymous_shared_allocate’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: danger: ‘listener_pipe[1]’ leaks here
# 2578|   
# 2579|   		xconn->smb1.echo_handler.socket_mutex =
# 2580|-> 			anonymous_shared_allocate(sizeof(pthread_mutex_t));
# 2581|   		if (xconn->smb1.echo_handler.socket_mutex == NULL) {
# 2582|   			DEBUG(1, ("Could not create mutex shared memory: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1112]
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: danger: ‘listener_pipe[0]’ leaks here
# 2580|   			anonymous_shared_allocate(sizeof(pthread_mutex_t));
# 2581|   		if (xconn->smb1.echo_handler.socket_mutex == NULL) {
# 2582|-> 			DEBUG(1, ("Could not create mutex shared memory: %s\n",
# 2583|   				  strerror(errno)));
# 2584|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1113]
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2582:25: danger: ‘listener_pipe[1]’ leaks here
# 2580|   			anonymous_shared_allocate(sizeof(pthread_mutex_t));
# 2581|   		if (xconn->smb1.echo_handler.socket_mutex == NULL) {
# 2582|-> 			DEBUG(1, ("Could not create mutex shared memory: %s\n",
# 2583|   				  strerror(errno)));
# 2584|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1114]
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: danger: ‘listener_pipe[0]’ leaks here
# 2587|   		res = pthread_mutexattr_init(&a);
# 2588|   		if (res != 0) {
# 2589|-> 			DEBUG(1, ("pthread_mutexattr_init failed: %s\n",
# 2590|   				  strerror(res)));
# 2591|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1115]
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2589:25: danger: ‘listener_pipe[1]’ leaks here
# 2587|   		res = pthread_mutexattr_init(&a);
# 2588|   		if (res != 0) {
# 2589|-> 			DEBUG(1, ("pthread_mutexattr_init failed: %s\n",
# 2590|   				  strerror(res)));
# 2591|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1116]
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: danger: ‘listener_pipe[0]’ leaks here
# 2593|   		res = pthread_mutexattr_settype(&a, PTHREAD_MUTEX_ERRORCHECK);
# 2594|   		if (res != 0) {
# 2595|-> 			DEBUG(1, ("pthread_mutexattr_settype failed: %s\n",
# 2596|   				  strerror(res)));
# 2597|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1117]
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2595:25: danger: ‘listener_pipe[1]’ leaks here
# 2593|   		res = pthread_mutexattr_settype(&a, PTHREAD_MUTEX_ERRORCHECK);
# 2594|   		if (res != 0) {
# 2595|-> 			DEBUG(1, ("pthread_mutexattr_settype failed: %s\n",
# 2596|   				  strerror(res)));
# 2597|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1118]
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: danger: ‘listener_pipe[0]’ leaks here
# 2600|   		res = pthread_mutexattr_setpshared(&a, PTHREAD_PROCESS_SHARED);
# 2601|   		if (res != 0) {
# 2602|-> 			DEBUG(1, ("pthread_mutexattr_setpshared failed: %s\n",
# 2603|   				  strerror(res)));
# 2604|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1119]
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2602:25: danger: ‘listener_pipe[1]’ leaks here
# 2600|   		res = pthread_mutexattr_setpshared(&a, PTHREAD_PROCESS_SHARED);
# 2601|   		if (res != 0) {
# 2602|-> 			DEBUG(1, ("pthread_mutexattr_setpshared failed: %s\n",
# 2603|   				  strerror(res)));
# 2604|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1120]
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2607:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2608:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: danger: ‘listener_pipe[0]’ leaks here
# 2607|   		res = pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST);
# 2608|   		if (res != 0) {
# 2609|-> 			DEBUG(1, ("pthread_mutexattr_setrobust failed: "
# 2610|   				  "%s\n", strerror(res)));
# 2611|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1121]
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2607:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2608:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2609:25: danger: ‘listener_pipe[1]’ leaks here
# 2607|   		res = pthread_mutexattr_setrobust(&a, PTHREAD_MUTEX_ROBUST);
# 2608|   		if (res != 0) {
# 2609|-> 			DEBUG(1, ("pthread_mutexattr_setrobust failed: "
# 2610|   				  "%s\n", strerror(res)));
# 2611|   			pthread_mutexattr_destroy(&a);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1122]
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2607:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2608:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2614:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2617:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: danger: ‘listener_pipe[0]’ leaks here
# 2616|   		pthread_mutexattr_destroy(&a);
# 2617|   		if (res != 0) {
# 2618|-> 			DEBUG(1, ("pthread_mutex_init failed: %s\n",
# 2619|   				  strerror(res)));
# 2620|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1123]
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2580:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2581:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2587:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2588:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2593:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2594:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2600:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2601:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2607:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2608:20: branch_false: following ‘false’ branch (when ‘res == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2614:23: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2617:20: branch_true: following ‘true’ branch (when ‘res != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2618:25: danger: ‘listener_pipe[1]’ leaks here
# 2616|   		pthread_mutexattr_destroy(&a);
# 2617|   		if (res != 0) {
# 2618|-> 			DEBUG(1, ("pthread_mutex_init failed: %s\n",
# 2619|   				  strerror(res)));
# 2620|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1124]
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: throw: if ‘lp_lock_directory’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: danger: ‘listener_pipe[0]’ leaks here
# 2625|   	if (!use_mutex) {
# 2626|   		xconn->smb1.echo_handler.socket_lock_fd =
# 2627|-> 			create_unlink_tmp(lp_lock_directory());
# 2628|   		if (xconn->smb1.echo_handler.socket_lock_fd == -1) {
# 2629|   			DEBUG(1, ("Could not create lock fd: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1125]
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: throw: if ‘lp_lock_directory’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: danger: ‘listener_pipe[1]’ leaks here
# 2625|   	if (!use_mutex) {
# 2626|   		xconn->smb1.echo_handler.socket_lock_fd =
# 2627|-> 			create_unlink_tmp(lp_lock_directory());
# 2628|   		if (xconn->smb1.echo_handler.socket_lock_fd == -1) {
# 2629|   			DEBUG(1, ("Could not create lock fd: %s\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1126]
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: danger: ‘listener_pipe[0]’ leaks here
# 2627|   			create_unlink_tmp(lp_lock_directory());
# 2628|   		if (xconn->smb1.echo_handler.socket_lock_fd == -1) {
# 2629|-> 			DEBUG(1, ("Could not create lock fd: %s\n",
# 2630|   				  strerror(errno)));
# 2631|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1127]
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2576:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2627:25: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: danger: ‘listener_pipe[1]’ leaks here
# 2627|   			create_unlink_tmp(lp_lock_directory());
# 2628|   		if (xconn->smb1.echo_handler.socket_lock_fd == -1) {
# 2629|-> 			DEBUG(1, ("Could not create lock fd: %s\n",
# 2630|   				  strerror(errno)));
# 2631|   			goto fail;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1128]
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2635:17: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2636:12: branch_true: following ‘true’ branch (when ‘child == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: danger: ‘listener_pipe[0]’ leaks here
# 2637|   		NTSTATUS status;
# 2638|   
# 2639|-> 		close(listener_pipe[0]);
# 2640|   		set_blocking(listener_pipe[1], false);
# 2641|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1129]
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2635:17: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2636:12: branch_true: following ‘true’ branch (when ‘child == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: danger: ‘listener_pipe[1]’ leaks here
# 2637|   		NTSTATUS status;
# 2638|   
# 2639|-> 		close(listener_pipe[0]);
# 2640|   		set_blocking(listener_pipe[1], false);
# 2641|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1130]
samba-4.23.4/source3/smbd/smb1_process.c:2640:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2635:17: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2636:12: branch_true: following ‘true’ branch (when ‘child == 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2639:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2640:17: throw: if ‘set_blocking’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2640:17: danger: ‘listener_pipe[1]’ leaks here
# 2638|   
# 2639|   		close(listener_pipe[0]);
# 2640|-> 		set_blocking(listener_pipe[1], false);
# 2641|   
# 2642|   		status = smbd_reinit_after_fork(xconn->client->msg_ctx,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1131]
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2635:17: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2636:12: branch_false: following ‘false’ branch (when ‘child != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: danger: ‘listener_pipe[0]’ leaks here
# 2653|   		exit(0);
# 2654|   	}
# 2655|-> 	close(listener_pipe[1]);
# 2656|   	listener_pipe[1] = -1;
# 2657|   	xconn->smb1.echo_handler.trusted_fd = listener_pipe[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1132]
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2635:17: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2636:12: branch_false: following ‘false’ branch (when ‘child != 0’)...
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2655:9: danger: ‘listener_pipe[1]’ leaks here
# 2653|   		exit(0);
# 2654|   	}
# 2655|-> 	close(listener_pipe[1]);
# 2656|   	listener_pipe[1] = -1;
# 2657|   	xconn->smb1.echo_handler.trusted_fd = listener_pipe[0];

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1133]
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: danger: ‘listener_pipe[0]’ leaks here
# 2679|   fail:
# 2680|   	if (listener_pipe[0] != -1) {
# 2681|-> 		close(listener_pipe[0]);
# 2682|   	}
# 2683|   	if (listener_pipe[1] != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1134]
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2681:17: danger: ‘listener_pipe[1]’ leaks here
# 2679|   fail:
# 2680|   	if (listener_pipe[0] != -1) {
# 2681|-> 		close(listener_pipe[0]);
# 2682|   	}
# 2683|   	if (listener_pipe[1] != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1135]
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: danger: ‘listener_pipe[0]’ leaks here
# 2682|   	}
# 2683|   	if (listener_pipe[1] != -1) {
# 2684|-> 		close(listener_pipe[1]);
# 2685|   	}
# 2686|   	if (xconn->smb1.echo_handler.socket_lock_fd != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1136]
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2684:17: danger: ‘listener_pipe[1]’ leaks here
# 2682|   	}
# 2683|   	if (listener_pipe[1] != -1) {
# 2684|-> 		close(listener_pipe[1]);
# 2685|   	}
# 2686|   	if (xconn->smb1.echo_handler.socket_lock_fd != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1137]
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2686:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: danger: ‘listener_pipe[0]’ leaks here
# 2685|   	}
# 2686|   	if (xconn->smb1.echo_handler.socket_lock_fd != -1) {
# 2687|-> 		close(xconn->smb1.echo_handler.socket_lock_fd);
# 2688|   	}
# 2689|   #ifdef HAVE_ROBUST_MUTEXES

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1138]
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2686:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2687:17: danger: ‘listener_pipe[1]’ leaks here
# 2685|   	}
# 2686|   	if (xconn->smb1.echo_handler.socket_lock_fd != -1) {
# 2687|-> 		close(xconn->smb1.echo_handler.socket_lock_fd);
# 2688|   	}
# 2689|   #ifdef HAVE_ROBUST_MUTEXES

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1139]
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[0]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2690:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2691:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: throw: if ‘anonymous_shared_free’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: danger: ‘listener_pipe[0]’ leaks here
# 2690|   	if (xconn->smb1.echo_handler.socket_mutex != NULL) {
# 2691|   		pthread_mutex_destroy(xconn->smb1.echo_handler.socket_mutex);
# 2692|-> 		anonymous_shared_free(xconn->smb1.echo_handler.socket_mutex);
# 2693|   	}
# 2694|   #endif

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1140]
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘listener_pipe[1]’
samba-4.23.4/source3/smbd/smb1_process.c:2568:12: branch_false: following ‘false’ branch (when ‘res != -1’)...
samba-4.23.4/source3/smbd/smb1_process.c:2574:21: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2628:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2629:25: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2680:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2683:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2683:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2686:13: branch_false: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2690:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb1_process.c:2691:17: branch_true: ...to here
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: throw: if ‘anonymous_shared_free’ throws an exception...
samba-4.23.4/source3/smbd/smb1_process.c:2692:17: danger: ‘listener_pipe[1]’ leaks here
# 2690|   	if (xconn->smb1.echo_handler.socket_mutex != NULL) {
# 2691|   		pthread_mutex_destroy(xconn->smb1.echo_handler.socket_mutex);
# 2692|-> 		anonymous_shared_free(xconn->smb1.echo_handler.socket_mutex);
# 2693|   	}
# 2694|   #endif

Error: CPPCHECK_WARNING (CWE-457): [#def1141]
samba-4.23.4/source3/smbd/smb2_create.c:1791: error[uninitvar]: Uninitialized variable: p
# 1789|   			uint8_t p[8];
# 1790|   			uint32_t max_access_granted;
# 1791|-> 			DATA_BLOB blob = data_blob_const(p, sizeof(p));
# 1792|   
# 1793|   			status = smbd_calculate_access_mask_fsp(

Error: CPPCHECK_WARNING (CWE-457): [#def1142]
samba-4.23.4/source3/smbd/smb2_create.c:1901: error[uninitvar]: Uninitialized variable: p
# 1899|   			&state->result->fsp_name->st;
# 1900|   		uint64_t file_id = SMB_VFS_FS_FILE_ID(conn, base_sp);
# 1901|-> 		DATA_BLOB blob = data_blob_const(p, sizeof(p));
# 1902|   
# 1903|   		ZERO_STRUCT(p);

Error: GCC_ANALYZER_WARNING (CWE-465): [#def1143]
samba-4.23.4/source3/smbd/smb2_ioctl_filesys.c:490:42: warning[-Wanalyzer-deref-before-check]: check of ‘((struct files_struct)*((files_struct *)fsp)).conn’ for NULL after already dereferencing it
samba-4.23.4/source3/smbd/smb2_ioctl_filesys.c:732:20: enter_function: entry to ‘smb2_ioctl_filesys’
samba-4.23.4/source3/smbd/smb2_ioctl_filesys.c:758:26: call_function: calling ‘fsctl_zero_data’ from ‘smb2_ioctl_filesys’
#  488|   	}
#  489|   
#  490|-> 	if (!fsp->fsp_flags.is_sparse && lp_strict_allocate(SNUM(fsp->conn))) {
#  491|   		/*
#  492|   		 * File marked non-sparse and "strict allocate" is enabled -

Error: GCC_ANALYZER_WARNING (CWE-465): [#def1144]
samba-4.23.4/source3/smbd/smb2_read.c:238:25: warning[-Wanalyzer-deref-before-check]: check of ‘*fsp.conn’ for NULL after already dereferencing it
samba-4.23.4/source3/smbd/smb2_read.c:227:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb2_read.c:228:31: branch_true: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:233:20: branch_false: following ‘false’ branch (when ‘saved_errno != 38’)...
samba-4.23.4/source3/smbd/smb2_read.c:237:20: branch_false: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:237:20: branch_true: following ‘true’ branch (when ‘saved_errno == 95’)...
samba-4.23.4/source3/smbd/smb2_read.c:238:42: branch_true: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:238:25: danger: pointer ‘*fsp.conn’ is checked for NULL here but it was already dereferenced at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  236|   
#  237|   		if (errno == ENOTSUP) {
#  238|-> 			set_use_sendfile(SNUM(fsp->conn), false);
#  239|   			DBG_WARNING("Disabling sendfile use as sendfile is "
#  240|   				    "not supported by the system\n");

Error: GCC_ANALYZER_WARNING (CWE-465): [#def1145]
samba-4.23.4/source3/smbd/smb2_read.c:250:25: warning[-Wanalyzer-deref-before-check]: check of ‘*fsp.conn’ for NULL after already dereferencing it
samba-4.23.4/source3/smbd/smb2_read.c:227:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/smbd/smb2_read.c:228:31: branch_true: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:233:20: branch_false: following ‘false’ branch (when ‘saved_errno != 38’)...
samba-4.23.4/source3/smbd/smb2_read.c:237:20: branch_false: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:237:20: branch_false: following ‘false’ branch (when ‘saved_errno != 95’)...
samba-4.23.4/source3/smbd/smb2_read.c:244:20: branch_false: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:244:20: branch_true: following ‘true’ branch (when ‘saved_errno == 4’)...
samba-4.23.4/source3/smbd/smb2_read.c:250:42: branch_true: ...to here
samba-4.23.4/source3/smbd/smb2_read.c:250:25: danger: pointer ‘*fsp.conn’ is checked for NULL here but it was already dereferenced at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  248|   			 * Fake this up by doing read/write calls.
#  249|   			 */
#  250|-> 			set_use_sendfile(SNUM(fsp->conn), false);
#  251|   			nread = fake_sendfile(xconn, fsp, in_offset, in_length);
#  252|   			if (nread == -1) {

Error: CPPCHECK_WARNING (CWE-457): [#def1146]
samba-4.23.4/source3/smbd/smbXsrv_session.c:122: warning[uninitvar]: Uninitialized variable: key_buf
#  120|   	RSIVAL(key_buf, 0, id);
#  121|   
#  122|-> 	key = make_tdb_data(key_buf, SMBXSRV_SESSION_GLOBAL_TDB_KEY_SIZE);
#  123|   
#  124|   	return key;

Error: CPPCHECK_WARNING (CWE-457): [#def1147]
samba-4.23.4/source3/smbd/smbXsrv_session.c:153: warning[uninitvar]: Uninitialized variable: key_buf
#  151|   	RSIVAL(key_buf, 0, id);
#  152|   
#  153|-> 	key = make_tdb_data(key_buf, SMBXSRV_SESSION_LOCAL_TDB_KEY_SIZE);
#  154|   
#  155|   	return key;

Error: CPPCHECK_WARNING (CWE-457): [#def1148]
samba-4.23.4/source3/smbd/smbXsrv_tcon.c:102: warning[uninitvar]: Uninitialized variable: key_buf
#  100|   	RSIVAL(key_buf, 0, id);
#  101|   
#  102|-> 	key = make_tdb_data(key_buf, SMBXSRV_TCON_GLOBAL_TDB_KEY_SIZE);
#  103|   
#  104|   	return key;

Error: CPPCHECK_WARNING (CWE-457): [#def1149]
samba-4.23.4/source3/smbd/smbXsrv_tcon.c:133: warning[uninitvar]: Uninitialized variable: key_buf
#  131|   	RSIVAL(key_buf, 0, id);
#  132|   
#  133|-> 	key = make_tdb_data(key_buf, SMBXSRV_TCON_LOCAL_TDB_KEY_SIZE);
#  134|   
#  135|   	return key;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1150]
samba-4.23.4/source3/smbd/vfs.c:1267:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_fds[0]’
samba-4.23.4/source3/smbd/vfs.c:1263:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/source3/smbd/vfs.c:1267:9: branch_false: ...to here
samba-4.23.4/source3/smbd/vfs.c:1267:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/vfs.c:1267:9: danger: ‘pipe_fds[0]’ leaks here
# 1265|   	}
# 1266|   
# 1267|-> 	close(pipe_fds[1]);
# 1268|   	return pipe_fds[0];
# 1269|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1151]
samba-4.23.4/source3/smbd/vfs.c:1267:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipe_fds[1]’
samba-4.23.4/source3/smbd/vfs.c:1263:12: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/source3/smbd/vfs.c:1267:9: branch_false: ...to here
samba-4.23.4/source3/smbd/vfs.c:1267:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source3/smbd/vfs.c:1267:9: danger: ‘pipe_fds[1]’ leaks here
# 1265|   	}
# 1266|   
# 1267|-> 	close(pipe_fds[1]);
# 1268|   	return pipe_fds[0];
# 1269|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1152]
samba-4.23.4/source3/smbd/vfs.c:2063:18: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/smbd/vfs.c:2060:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/smbd/vfs.c:2060:9: branch_false: ...to here
samba-4.23.4/source3/smbd/vfs.c:2062:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/smbd/vfs.c:2063:18: throw: if the called function throws an exception...
samba-4.23.4/source3/smbd/vfs.c:2063:18: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 2061|   
# 2062|   	va_start(cmd_arg, cmd);
# 2063|-> 	result = handle->fns->fcntl_fn(handle, fsp, cmd, cmd_arg);
# 2064|   	va_end(cmd_arg);
# 2065|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1153]
samba-4.23.4/source3/utils/interact.c:123:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(&fname, "r")’
samba-4.23.4/source3/utils/interact.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:95:17: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:96:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
samba-4.23.4/source3/utils/interact.c:104:9: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:108:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:115:16: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:115:16: acquire_resource: opened here
samba-4.23.4/source3/utils/interact.c:116:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:116:12: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:122:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/interact.c:123:23: branch_true: ...to here
samba-4.23.4/source3/utils/interact.c:123:23: throw: if ‘talloc_strdup_append’ throws an exception...
samba-4.23.4/source3/utils/interact.c:123:23: danger: ‘fopen(&fname, "r")’ leaks here; was opened at [(7)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/6)
#  121|   	}
#  122|   	while ( fgets(buf, sizeof(buf), file) ) {
#  123|-> 		ret = talloc_strdup_append(ret, buf);
#  124|   	}
#  125|   	fclose(file);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1154]
samba-4.23.4/source3/utils/interact.c:123:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(&fname, "r")’
samba-4.23.4/source3/utils/interact.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:95:17: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:96:12: branch_false: following ‘false’ branch (when ‘file’ is non-NULL)...
samba-4.23.4/source3/utils/interact.c:104:9: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:108:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:115:16: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:115:16: acquire_memory: allocated here
samba-4.23.4/source3/utils/interact.c:116:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/interact.c:116:12: branch_false: ...to here
samba-4.23.4/source3/utils/interact.c:122:17: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/interact.c:123:23: branch_true: ...to here
samba-4.23.4/source3/utils/interact.c:123:23: throw: if ‘talloc_strdup_append’ throws an exception...
samba-4.23.4/source3/utils/interact.c:123:23: danger: ‘fopen(&fname, "r")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  121|   	}
#  122|   	while ( fgets(buf, sizeof(buf), file) ) {
#  123|-> 		ret = talloc_strdup_append(ret, buf);
#  124|   	}
#  125|   	fclose(file);

Error: CPPCHECK_WARNING (CWE-476): [#def1155]
samba-4.23.4/source3/utils/log2pcaphex.c:144: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: data
#  142|   	p.len = length;
#  143|   	fwrite(&p, sizeof(struct tcpdump_packet), 1, out);
#  144|-> 	fwrite(data, sizeof(unsigned char), caplen, out);
#  145|   }
#  146|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1156]
samba-4.23.4/source3/utils/log2pcaphex.c:173:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘newdata’
samba-4.23.4/source3/utils/log2pcaphex.c:167:36: acquire_memory: this call could return NULL
samba-4.23.4/source3/utils/log2pcaphex.c:173:9: danger: ‘newdata’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  171|   	HDR_TCP.source_port = HDR_TCP.dest_port = htons(139);
#  172|   
#  173|-> 	memcpy(newdata+offset, &HDR_IP, sizeof(HDR_IP));offset+=sizeof(HDR_IP);
#  174|   	memcpy(newdata+offset, &HDR_TCP, sizeof(HDR_TCP));offset+=sizeof(HDR_TCP);
#  175|   	memcpy(newdata+offset,data,length);

Error: CPPCHECK_WARNING (CWE-682): [#def1157]
samba-4.23.4/source3/utils/log2pcaphex.c:174: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  172|   
#  173|   	memcpy(newdata+offset, &HDR_IP, sizeof(HDR_IP));offset+=sizeof(HDR_IP);
#  174|-> 	memcpy(newdata+offset, &HDR_TCP, sizeof(HDR_TCP));offset+=sizeof(HDR_TCP);
#  175|   	memcpy(newdata+offset,data,length);
#  176|   

Error: CPPCHECK_WARNING (CWE-682): [#def1158]
samba-4.23.4/source3/utils/log2pcaphex.c:175: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  173|   	memcpy(newdata+offset, &HDR_IP, sizeof(HDR_IP));offset+=sizeof(HDR_IP);
#  174|   	memcpy(newdata+offset, &HDR_TCP, sizeof(HDR_TCP));offset+=sizeof(HDR_TCP);
#  175|-> 	memcpy(newdata+offset,data,length);
#  176|   
#  177|   	print_pcap_packet(out, newdata, newlen, actual_length+offset);

Error: CPPCHECK_WARNING (CWE-476): [#def1159]
samba-4.23.4/source3/utils/log2pcaphex.c:217: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  215|   	assert(fscanf(in, " size=%hu\n", buffersize)); line_num++;
#  216|   	buffer = (unsigned char *)malloc(*buffersize+4); /* +4 for NBSS Header */
#  217|-> 	memset(buffer, 0, *buffersize+4);
#  218|   	/* NetBIOS Session Service */
#  219|   	buffer[0] = 0x00;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1160]
samba-4.23.4/source3/utils/log2pcaphex.c:217:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
samba-4.23.4/source3/utils/log2pcaphex.c:215:9: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:215:56: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:216:35: acquire_memory: this call could return NULL
samba-4.23.4/source3/utils/log2pcaphex.c:217:9: danger: argument 1 (‘buffer’) from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
#  215|   	assert(fscanf(in, " size=%hu\n", buffersize)); line_num++;
#  216|   	buffer = (unsigned char *)malloc(*buffersize+4); /* +4 for NBSS Header */
#  217|-> 	memset(buffer, 0, *buffersize+4);
#  218|   	/* NetBIOS Session Service */
#  219|   	buffer[0] = 0x00;

Error: CPPCHECK_WARNING (CWE-476): [#def1161]
samba-4.23.4/source3/utils/log2pcaphex.c:219: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  217|   	memset(buffer, 0, *buffersize+4);
#  218|   	/* NetBIOS Session Service */
#  219|-> 	buffer[0] = 0x00;
#  220|   	buffer[1] = 0x00;
#  221|   	memcpy(buffer+2, &buffersize, 2); /* TODO: need to copy as little-endian regardless of platform */

Error: CPPCHECK_WARNING (CWE-476): [#def1162]
samba-4.23.4/source3/utils/log2pcaphex.c:220: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  218|   	/* NetBIOS Session Service */
#  219|   	buffer[0] = 0x00;
#  220|-> 	buffer[1] = 0x00;
#  221|   	memcpy(buffer+2, &buffersize, 2); /* TODO: need to copy as little-endian regardless of platform */
#  222|   	/* SMB Packet */

Error: CPPCHECK_WARNING (CWE-682): [#def1163]
samba-4.23.4/source3/utils/log2pcaphex.c:221: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  219|   	buffer[0] = 0x00;
#  220|   	buffer[1] = 0x00;
#  221|-> 	memcpy(buffer+2, &buffersize, 2); /* TODO: need to copy as little-endian regardless of platform */
#  222|   	/* SMB Packet */
#  223|   	buffer[4] = 0xFF;

Error: CPPCHECK_WARNING (CWE-476): [#def1164]
samba-4.23.4/source3/utils/log2pcaphex.c:223: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  221|   	memcpy(buffer+2, &buffersize, 2); /* TODO: need to copy as little-endian regardless of platform */
#  222|   	/* SMB Packet */
#  223|-> 	buffer[4] = 0xFF;
#  224|   	buffer[5] = 'S';
#  225|   	buffer[6] = 'M';

Error: CPPCHECK_WARNING (CWE-476): [#def1165]
samba-4.23.4/source3/utils/log2pcaphex.c:224: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  222|   	/* SMB Packet */
#  223|   	buffer[4] = 0xFF;
#  224|-> 	buffer[5] = 'S';
#  225|   	buffer[6] = 'M';
#  226|   	buffer[7] = 'B';

Error: CPPCHECK_WARNING (CWE-476): [#def1166]
samba-4.23.4/source3/utils/log2pcaphex.c:225: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  223|   	buffer[4] = 0xFF;
#  224|   	buffer[5] = 'S';
#  225|-> 	buffer[6] = 'M';
#  226|   	buffer[7] = 'B';
#  227|   	assert(fscanf(in, "  smb_com=0x%x\n", &tmp)); buffer[smb_com] = tmp; line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1167]
samba-4.23.4/source3/utils/log2pcaphex.c:226: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  224|   	buffer[5] = 'S';
#  225|   	buffer[6] = 'M';
#  226|-> 	buffer[7] = 'B';
#  227|   	assert(fscanf(in, "  smb_com=0x%x\n", &tmp)); buffer[smb_com] = tmp; line_num++;
#  228|   	assert(fscanf(in, "  smb_rcls=%d\n", &tmp)); buffer[smb_rcls] = tmp; line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1168]
samba-4.23.4/source3/utils/log2pcaphex.c:227: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  225|   	buffer[6] = 'M';
#  226|   	buffer[7] = 'B';
#  227|-> 	assert(fscanf(in, "  smb_com=0x%x\n", &tmp)); buffer[smb_com] = tmp; line_num++;
#  228|   	assert(fscanf(in, "  smb_rcls=%d\n", &tmp)); buffer[smb_rcls] = tmp; line_num++;
#  229|   	assert(fscanf(in, "  smb_reh=%d\n", &tmp)); buffer[smb_reh] = tmp; line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1169]
samba-4.23.4/source3/utils/log2pcaphex.c:228: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  226|   	buffer[7] = 'B';
#  227|   	assert(fscanf(in, "  smb_com=0x%x\n", &tmp)); buffer[smb_com] = tmp; line_num++;
#  228|-> 	assert(fscanf(in, "  smb_rcls=%d\n", &tmp)); buffer[smb_rcls] = tmp; line_num++;
#  229|   	assert(fscanf(in, "  smb_reh=%d\n", &tmp)); buffer[smb_reh] = tmp; line_num++;
#  230|   	assert(fscanf(in, "  smb_err=%d\n", &tmp)); memcpy(buffer+smb_err, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1170]
samba-4.23.4/source3/utils/log2pcaphex.c:229: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  227|   	assert(fscanf(in, "  smb_com=0x%x\n", &tmp)); buffer[smb_com] = tmp; line_num++;
#  228|   	assert(fscanf(in, "  smb_rcls=%d\n", &tmp)); buffer[smb_rcls] = tmp; line_num++;
#  229|-> 	assert(fscanf(in, "  smb_reh=%d\n", &tmp)); buffer[smb_reh] = tmp; line_num++;
#  230|   	assert(fscanf(in, "  smb_err=%d\n", &tmp)); memcpy(buffer+smb_err, &tmp, 2); line_num++;
#  231|   	assert(fscanf(in, "  smb_flg=%d\n", &tmp)); buffer[smb_flg] = tmp; line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1171]
samba-4.23.4/source3/utils/log2pcaphex.c:230: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  228|   	assert(fscanf(in, "  smb_rcls=%d\n", &tmp)); buffer[smb_rcls] = tmp; line_num++;
#  229|   	assert(fscanf(in, "  smb_reh=%d\n", &tmp)); buffer[smb_reh] = tmp; line_num++;
#  230|-> 	assert(fscanf(in, "  smb_err=%d\n", &tmp)); memcpy(buffer+smb_err, &tmp, 2); line_num++;
#  231|   	assert(fscanf(in, "  smb_flg=%d\n", &tmp)); buffer[smb_flg] = tmp; line_num++;
#  232|   	assert(fscanf(in, "  smb_flg2=%d\n", &tmp)); memcpy(buffer+smb_flg2, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1172]
samba-4.23.4/source3/utils/log2pcaphex.c:231: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  229|   	assert(fscanf(in, "  smb_reh=%d\n", &tmp)); buffer[smb_reh] = tmp; line_num++;
#  230|   	assert(fscanf(in, "  smb_err=%d\n", &tmp)); memcpy(buffer+smb_err, &tmp, 2); line_num++;
#  231|-> 	assert(fscanf(in, "  smb_flg=%d\n", &tmp)); buffer[smb_flg] = tmp; line_num++;
#  232|   	assert(fscanf(in, "  smb_flg2=%d\n", &tmp)); memcpy(buffer+smb_flg2, &tmp, 2); line_num++;
#  233|   	assert(fscanf(in, "  smb_tid=%d\n", &tmp)); memcpy(buffer+smb_tid, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1173]
samba-4.23.4/source3/utils/log2pcaphex.c:232: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  230|   	assert(fscanf(in, "  smb_err=%d\n", &tmp)); memcpy(buffer+smb_err, &tmp, 2); line_num++;
#  231|   	assert(fscanf(in, "  smb_flg=%d\n", &tmp)); buffer[smb_flg] = tmp; line_num++;
#  232|-> 	assert(fscanf(in, "  smb_flg2=%d\n", &tmp)); memcpy(buffer+smb_flg2, &tmp, 2); line_num++;
#  233|   	assert(fscanf(in, "  smb_tid=%d\n", &tmp)); memcpy(buffer+smb_tid, &tmp, 2); line_num++;
#  234|   	assert(fscanf(in, "  smb_pid=%d\n", &tmp)); memcpy(buffer+smb_pid, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1174]
samba-4.23.4/source3/utils/log2pcaphex.c:233: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  231|   	assert(fscanf(in, "  smb_flg=%d\n", &tmp)); buffer[smb_flg] = tmp; line_num++;
#  232|   	assert(fscanf(in, "  smb_flg2=%d\n", &tmp)); memcpy(buffer+smb_flg2, &tmp, 2); line_num++;
#  233|-> 	assert(fscanf(in, "  smb_tid=%d\n", &tmp)); memcpy(buffer+smb_tid, &tmp, 2); line_num++;
#  234|   	assert(fscanf(in, "  smb_pid=%d\n", &tmp)); memcpy(buffer+smb_pid, &tmp, 2); line_num++;
#  235|   	assert(fscanf(in, "  smb_uid=%d\n", &tmp)); memcpy(buffer+smb_uid, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1175]
samba-4.23.4/source3/utils/log2pcaphex.c:234: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  232|   	assert(fscanf(in, "  smb_flg2=%d\n", &tmp)); memcpy(buffer+smb_flg2, &tmp, 2); line_num++;
#  233|   	assert(fscanf(in, "  smb_tid=%d\n", &tmp)); memcpy(buffer+smb_tid, &tmp, 2); line_num++;
#  234|-> 	assert(fscanf(in, "  smb_pid=%d\n", &tmp)); memcpy(buffer+smb_pid, &tmp, 2); line_num++;
#  235|   	assert(fscanf(in, "  smb_uid=%d\n", &tmp)); memcpy(buffer+smb_uid, &tmp, 2); line_num++;
#  236|   	assert(fscanf(in, "  smb_mid=%d\n", &tmp)); memcpy(buffer+smb_mid, &tmp, 2); line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1176]
samba-4.23.4/source3/utils/log2pcaphex.c:235: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  233|   	assert(fscanf(in, "  smb_tid=%d\n", &tmp)); memcpy(buffer+smb_tid, &tmp, 2); line_num++;
#  234|   	assert(fscanf(in, "  smb_pid=%d\n", &tmp)); memcpy(buffer+smb_pid, &tmp, 2); line_num++;
#  235|-> 	assert(fscanf(in, "  smb_uid=%d\n", &tmp)); memcpy(buffer+smb_uid, &tmp, 2); line_num++;
#  236|   	assert(fscanf(in, "  smb_mid=%d\n", &tmp)); memcpy(buffer+smb_mid, &tmp, 2); line_num++;
#  237|   	assert(fscanf(in, "  smt_wct=%d\n", &tmp)); buffer[smb_wct] = tmp; line_num++;

Error: CPPCHECK_WARNING (CWE-682): [#def1177]
samba-4.23.4/source3/utils/log2pcaphex.c:236: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  234|   	assert(fscanf(in, "  smb_pid=%d\n", &tmp)); memcpy(buffer+smb_pid, &tmp, 2); line_num++;
#  235|   	assert(fscanf(in, "  smb_uid=%d\n", &tmp)); memcpy(buffer+smb_uid, &tmp, 2); line_num++;
#  236|-> 	assert(fscanf(in, "  smb_mid=%d\n", &tmp)); memcpy(buffer+smb_mid, &tmp, 2); line_num++;
#  237|   	assert(fscanf(in, "  smt_wct=%d\n", &tmp)); buffer[smb_wct] = tmp; line_num++;
#  238|   	for(i = 0; i < buffer[smb_wct]; i++) {

Error: CPPCHECK_WARNING (CWE-476): [#def1178]
samba-4.23.4/source3/utils/log2pcaphex.c:237: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  235|   	assert(fscanf(in, "  smb_uid=%d\n", &tmp)); memcpy(buffer+smb_uid, &tmp, 2); line_num++;
#  236|   	assert(fscanf(in, "  smb_mid=%d\n", &tmp)); memcpy(buffer+smb_mid, &tmp, 2); line_num++;
#  237|-> 	assert(fscanf(in, "  smt_wct=%d\n", &tmp)); buffer[smb_wct] = tmp; line_num++;
#  238|   	for(i = 0; i < buffer[smb_wct]; i++) {
#  239|   		assert(fscanf(in, "  smb_vwv[%*3d]=%*5d (0x%X)\n", &tmp)); line_num++;

Error: CPPCHECK_WARNING (CWE-476): [#def1179]
samba-4.23.4/source3/utils/log2pcaphex.c:238: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  236|   	assert(fscanf(in, "  smb_mid=%d\n", &tmp)); memcpy(buffer+smb_mid, &tmp, 2); line_num++;
#  237|   	assert(fscanf(in, "  smt_wct=%d\n", &tmp)); buffer[smb_wct] = tmp; line_num++;
#  238|-> 	for(i = 0; i < buffer[smb_wct]; i++) {
#  239|   		assert(fscanf(in, "  smb_vwv[%*3d]=%*5d (0x%X)\n", &tmp)); line_num++;
#  240|   		memcpy(buffer+smb_vwv+i*2, &tmp, 2);

Error: CPPCHECK_WARNING (CWE-682): [#def1180]
samba-4.23.4/source3/utils/log2pcaphex.c:240: error[nullPointerArithmeticOutOfMemory]: If memory allocation fails: pointer addition with NULL pointer.
#  238|   	for(i = 0; i < buffer[smb_wct]; i++) {
#  239|   		assert(fscanf(in, "  smb_vwv[%*3d]=%*5d (0x%X)\n", &tmp)); line_num++;
#  240|-> 		memcpy(buffer+smb_vwv+i*2, &tmp, 2);
#  241|   	}
#  242|   

Error: CPPCHECK_WARNING (CWE-476): [#def1181]
samba-4.23.4/source3/utils/log2pcaphex.c:243: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  241|   	}
#  242|   
#  243|-> 	*data_offset = smb_vwv+buffer[smb_wct]*2;
#  244|   	assert(fscanf(in, "  smb_bcc=%ld\n", data_length)); buffer[(*data_offset)] = *data_length; line_num++;
#  245|   	(*data_offset)+=2;

Error: CPPCHECK_WARNING (CWE-476): [#def1182]
samba-4.23.4/source3/utils/log2pcaphex.c:244: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buffer
#  242|   
#  243|   	*data_offset = smb_vwv+buffer[smb_wct]*2;
#  244|-> 	assert(fscanf(in, "  smb_bcc=%ld\n", data_length)); buffer[(*data_offset)] = *data_length; line_num++;
#  245|   	(*data_offset)+=2;
#  246|   	*_buffer = buffer;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1183]
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: warning[-Wanalyzer-file-leak]: leak of FILE ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_resource: opened here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: throw: if ‘poptGetArg’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: danger: ‘in’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  354|   	} else in = stdin;
#  355|   
#  356|-> 	outfile = poptGetArg(pc);
#  357|   
#  358|   	if(outfile) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1184]
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: warning[-Wanalyzer-malloc-leak]: leak of ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_memory: allocated here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: throw: if ‘poptGetArg’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: danger: ‘in’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  354|   	} else in = stdin;
#  355|   
#  356|-> 	outfile = poptGetArg(pc);
#  357|   
#  358|   	if(outfile) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1185]
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_resource: opened here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: throw: if ‘perror’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: danger: ‘in’ leaks here; was opened at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  359|   		out = fopen(outfile, "w+");
#  360|   		if(!out) {
#  361|-> 			perror("fopen");
#  362|   			fprintf(stderr, "Can't find %s, using stdout...\n", outfile);
#  363|   			poptFreeContext(pc);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1186]
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: warning[-Wanalyzer-malloc-leak]: leak of ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_memory: allocated here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: throw: if ‘perror’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: danger: ‘in’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  359|   		out = fopen(outfile, "w+");
#  360|   		if(!out) {
#  361|-> 			perror("fopen");
#  362|   			fprintf(stderr, "Can't find %s, using stdout...\n", outfile);
#  363|   			poptFreeContext(pc);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1187]
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_resource: opened here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: danger: ‘in’ leaks here; was opened at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  361|   			perror("fopen");
#  362|   			fprintf(stderr, "Can't find %s, using stdout...\n", outfile);
#  363|-> 			poptFreeContext(pc);
#  364|   			return 1;
#  365|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1188]
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: warning[-Wanalyzer-malloc-leak]: leak of ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_memory: allocated here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:361:25: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:363:25: danger: ‘in’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  361|   			perror("fopen");
#  362|   			fprintf(stderr, "Can't find %s, using stdout...\n", outfile);
#  363|-> 			poptFreeContext(pc);
#  364|   			return 1;
#  365|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1189]
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_resource: opened here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:402:13: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: danger: ‘in’ leaks here; was opened at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  404|   	}
#  405|   
#  406|-> 	poptFreeContext(pc);
#  407|   	return 0;
#  408|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1190]
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘out’
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: acquire_resource: opened here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:370:12: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:402:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: danger: ‘out’ leaks here; was opened at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  404|   	}
#  405|   
#  406|-> 	poptFreeContext(pc);
#  407|   	return 0;
#  408|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1191]
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: warning[-Wanalyzer-malloc-leak]: leak of ‘in’
samba-4.23.4/source3/utils/log2pcaphex.c:347:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:348:23: acquire_memory: allocated here
samba-4.23.4/source3/utils/log2pcaphex.c:349:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:356:19: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:402:13: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: danger: ‘in’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  404|   	}
#  405|   
#  406|-> 	poptFreeContext(pc);
#  407|   	return 0;
#  408|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1192]
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: warning[-Wanalyzer-malloc-leak]: leak of ‘out’
samba-4.23.4/source3/utils/log2pcaphex.c:358:11: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: branch_true: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:359:23: acquire_memory: allocated here
samba-4.23.4/source3/utils/log2pcaphex.c:360:19: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:370:12: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:402:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: branch_false: ...to here
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: throw: if ‘poptFreeContext’ throws an exception...
samba-4.23.4/source3/utils/log2pcaphex.c:406:9: danger: ‘out’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  404|   	}
#  405|   
#  406|-> 	poptFreeContext(pc);
#  407|   	return 0;
#  408|   }

Error: CPPCHECK_WARNING (CWE-476): [#def1193]
samba-4.23.4/source3/utils/net_rap.c:247: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: sharename
#  245|   
#  246|   	sharename = SMB_STRDUP(argv[0]);
#  247|-> 	p = strchr(sharename, '=');
#  248|   	if (p == NULL) {
#  249|   		d_printf(_("Server path not specified\n"));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1194]
samba-4.23.4/source3/utils/net_rap.c:249:17: warning[-Wanalyzer-malloc-leak]: leak of ‘sharename’
samba-4.23.4/source3/utils/net_rap.c:243:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rap.c:246:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:246:21: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rap.c:248:12: branch_true: following ‘true’ branch (when ‘p’ is NULL)...
samba-4.23.4/source3/utils/net_rap.c:249:26: branch_true: ...to here
samba-4.23.4/source3/utils/net_rap.c:249:17: throw: if ‘d_printf’ throws an exception...
samba-4.23.4/source3/utils/net_rap.c:249:17: danger: ‘sharename’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  247|   	p = strchr(sharename, '=');
#  248|   	if (p == NULL) {
#  249|-> 		d_printf(_("Server path not specified\n"));
#  250|   		SAFE_FREE(sharename);
#  251|   		return net_rap_share_usage(c, argc, argv);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1195]
samba-4.23.4/source3/utils/net_rap.c:257:42: warning[-Wanalyzer-malloc-leak]: leak of ‘sharename’
samba-4.23.4/source3/utils/net_rap.c:243:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rap.c:246:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:246:21: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rap.c:248:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
samba-4.23.4/source3/utils/net_rap.c:253:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:257:25: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rap.c:257:42: branch_true: ...to here
samba-4.23.4/source3/utils/net_rap.c:257:42: throw: if ‘smb_xstrdup’ throws an exception...
samba-4.23.4/source3/utils/net_rap.c:257:42: danger: ‘sharename’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  255|   	sinfo.reserved1 = '\0';
#  256|   	sinfo.share_type = 0;
#  257|-> 	sinfo.comment = c->opt_comment ? smb_xstrdup(c->opt_comment) : "";
#  258|   	sinfo.perms = 0;
#  259|   	sinfo.maximum_users = c->opt_maxusers;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1196]
samba-4.23.4/source3/utils/net_rap.c:265:15: warning[-Wanalyzer-malloc-leak]: leak of ‘sharename’
samba-4.23.4/source3/utils/net_rap.c:243:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rap.c:246:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:246:21: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rap.c:248:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
samba-4.23.4/source3/utils/net_rap.c:253:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:257:25: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rap.c:257:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rap.c:265:15: throw: if ‘cli_NetShareAdd’ throws an exception...
samba-4.23.4/source3/utils/net_rap.c:265:15: danger: ‘sharename’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  263|   	sinfo.reserved2 = '\0';
#  264|   
#  265|-> 	ret = cli_NetShareAdd(cli, &sinfo);
#  266|   	cli_shutdown(cli);
#  267|   	SAFE_FREE(sharename);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1197]
samba-4.23.4/source3/utils/net_registry_check.c:377:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ctx’
samba-4.23.4/source3/utils/net_registry_check.c:1261:5: enter_function: entry to ‘net_registry_check_db’
samba-4.23.4/source3/utils/net_registry_check.c:1265:33: call_function: calling ‘check_ctx_create’ from ‘net_registry_check_db’
samba-4.23.4/source3/utils/net_registry_check.c:1265:33: return_function: returning to ‘net_registry_check_db’ from ‘check_ctx_create’
samba-4.23.4/source3/utils/net_registry_check.c:1266:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_registry_check.c:1267:17: branch_true: ...to here
samba-4.23.4/source3/utils/net_registry_check.c:1316:9: call_function: calling ‘check_ctx_transaction_stop’ from ‘net_registry_check_db’
#  375|   
#  376|   static void check_ctx_transaction_stop(struct check_ctx *ctx, bool ok) {
#  377|-> 	if (!ctx->transaction) {
#  378|   		return;
#  379|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1198]
samba-4.23.4/source3/utils/net_rpc.c:3670:26: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4212:18: call_function: calling ‘get_share_info’ from ‘rpc_share_migrate_files_internals’
# 3668|   		info_ctr->level = level;
# 3669|   
# 3670|-> 		status = dcerpc_srvsvc_NetShareEnumAll(b, mem_ctx,
# 3671|   						       pipe_hnd->desthost,
# 3672|   						       info_ctr,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1199]
samba-4.23.4/source3/utils/net_rpc.c:3678:32: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4212:18: call_function: calling ‘get_share_info’ from ‘rpc_share_migrate_files_internals’
# 3676|   						       &result);
# 3677|   		if (!NT_STATUS_IS_OK(status)) {
# 3678|-> 			return ntstatus_to_werror(status);
# 3679|   		}
# 3680|   		return result;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1200]
samba-4.23.4/source3/utils/net_rpc.c:3684:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4212:18: call_function: calling ‘get_share_info’ from ‘rpc_share_migrate_files_internals’
# 3682|   
# 3683|   	/* request just one share */
# 3684|-> 	status = dcerpc_srvsvc_NetShareGetInfo(b, mem_ctx,
# 3685|   					       pipe_hnd->desthost,
# 3686|   					       argv[0],

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1201]
samba-4.23.4/source3/utils/net_rpc.c:3692:26: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4212:18: call_function: calling ‘get_share_info’ from ‘rpc_share_migrate_files_internals’
# 3690|   
# 3691|   	if (!NT_STATUS_IS_OK(status)) {
# 3692|-> 		result = ntstatus_to_werror(status);
# 3693|   		goto done;
# 3694|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1202]
samba-4.23.4/source3/utils/net_rpc.c:3701:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4212:18: call_function: calling ‘get_share_info’ from ‘rpc_share_migrate_files_internals’
# 3699|   
# 3700|   	/* construct ctr */
# 3701|-> 	ZERO_STRUCTP(info_ctr);
# 3702|   
# 3703|   	info_ctr->level = level;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1203]
samba-4.23.4/source3/utils/net_rpc.c:3806:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3804|   	NTSTATUS status;
# 3805|   
# 3806|-> 	status = cli_tree_connect(cli, netname, "A:", NULL);
# 3807|   	if (!NT_STATUS_IS_OK(status)) {
# 3808|   		d_printf(_("skipping   [%s]: not a file share.\n"), netname);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1204]
samba-4.23.4/source3/utils/net_rpc.c:3808:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3806|   	status = cli_tree_connect(cli, netname, "A:", NULL);
# 3807|   	if (!NT_STATUS_IS_OK(status)) {
# 3808|-> 		d_printf(_("skipping   [%s]: not a file share.\n"), netname);
# 3809|   		return false;
# 3810|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1205]
samba-4.23.4/source3/utils/net_rpc.c:3812:18: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3810|   	}
# 3811|   
# 3812|-> 	status = cli_tdis(cli);
# 3813|   	if (!NT_STATUS_IS_OK(status)) {
# 3814|   		d_printf(_("cli_tdis returned %s\n"), nt_errstr(status));

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1206]
samba-4.23.4/source3/utils/net_rpc.c:3814:17: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3812|   	status = cli_tdis(cli);
# 3813|   	if (!NT_STATUS_IS_OK(status)) {
# 3814|-> 		d_printf(_("cli_tdis returned %s\n"), nt_errstr(status));
# 3815|   		return false;
# 3816|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1207]
samba-4.23.4/source3/utils/net_rpc.c:3833:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3831|   	/* skip builtin shares */
# 3832|   	/* FIXME: should print$ be added too ? */
# 3833|-> 	if (strequal(netname,"IPC$") || strequal(netname,"ADMIN$") ||
# 3834|   	    strequal(netname,"global"))
# 3835|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1208]
samba-4.23.4/source3/utils/net_rpc.c:3833:41: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3831|   	/* skip builtin shares */
# 3832|   	/* FIXME: should print$ be added too ? */
# 3833|-> 	if (strequal(netname,"IPC$") || strequal(netname,"ADMIN$") ||
# 3834|   	    strequal(netname,"global"))
# 3835|   		return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1209]
samba-4.23.4/source3/utils/net_rpc.c:3834:13: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3832|   	/* FIXME: should print$ be added too ? */
# 3833|   	if (strequal(netname,"IPC$") || strequal(netname,"ADMIN$") ||
# 3834|-> 	    strequal(netname,"global"))
# 3835|   		return false;
# 3836|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1210]
samba-4.23.4/source3/utils/net_rpc.c:3837:31: warning[-Wanalyzer-malloc-leak]: leak of ‘dst’
samba-4.23.4/source3/utils/net_rpc.c:4186:17: enter_function: entry to ‘rpc_share_migrate_files_internals’
samba-4.23.4/source3/utils/net_rpc.c:4206:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc.c:4207:12: branch_false: following ‘false’ branch (when ‘dst’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc.c:4212:18: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4215:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4218:21: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc.c:4221:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc.c:4223:22: call_function: calling ‘check_share_sanity’ from ‘rpc_share_migrate_files_internals’
# 3835|   		return false;
# 3836|   
# 3837|-> 	if (c->opt_exclude && in_list(netname, c->opt_exclude, false)) {
# 3838|   		printf(_("excluding  [%s]\n"), netname);
# 3839|   		return false;

Error: COMPILER_WARNING (CWE-704): [#def1211]
samba-4.23.4/source3/utils/net_rpc.c: scope_hint: In function ‘get_user_tokens’
samba-4.23.4/source3/utils/net_rpc.c:5047:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5047 |                 p = strchr(users[i], *lp_winbind_separator());
#      |                   ^
# 5045|   		fstrcpy(result[i].name, users[i]);
# 5046|   
# 5047|-> 		p = strchr(users[i], *lp_winbind_separator());
# 5048|   
# 5049|   		DEBUG(3, ("%s\n", users[i]));

Error: COMPILER_WARNING (CWE-704): [#def1212]
samba-4.23.4/source3/utils/net_rpc.c:5047:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5045|   		fstrcpy(result[i].name, users[i]);
# 5046|   
# 5047|-> 		p = strchr(users[i], *lp_winbind_separator());
# 5048|   
# 5049|   		DEBUG(3, ("%s\n", users[i]));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1213]
samba-4.23.4/source3/utils/net_rpc_conf.c:1244:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘services’
samba-4.23.4/source3/utils/net_rpc_conf.c:1141:17: enter_function: entry to ‘rpc_conf_import_internal’
samba-4.23.4/source3/utils/net_rpc_conf.c:1161:34: release_memory: ‘services’ is NULL
samba-4.23.4/source3/utils/net_rpc_conf.c:1173:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1179:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1187:28: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1194:25: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1202:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1207:15: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1208:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1214:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1219:12: branch_true: following ‘true’ branch (when ‘servicename’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc_conf.c:1220:23: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1223:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1227:17: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1239:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1240:20: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1240:20: branch_true: following ‘true’ branch (when ‘servicename’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc_conf.c:1241:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1241:25: call_function: inlined call to ‘rpc_conf_print_shares’ from ‘rpc_conf_import_internal’
samba-4.23.4/source3/utils/net_rpc_conf.c:1241:25: call_function: inlined call to ‘rpc_conf_print_shares’ from ‘rpc_conf_import_internal’
samba-4.23.4/source3/utils/net_rpc_conf.c:1243:29: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_conf.c:1244:58: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_conf.c:1244:58: release_memory: ‘services’ is NULL
samba-4.23.4/source3/utils/net_rpc_conf.c:1244:25: danger: dereference of NULL ‘services + (long unsigned int)i * 8’
# 1242|   		}
# 1243|   		for (i = 0; i < num_shares; i++) {
# 1244|-> 			rpc_conf_print_shares(1, services[i]);
# 1245|   		}
# 1246|   		goto error;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1214]
samba-4.23.4/source3/utils/net_rpc_printer.c:370:17: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
samba-4.23.4/source3/utils/net_rpc_printer.c:320:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:323:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:323:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:327:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:336:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:344:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:344:12: branch_true: following ‘true’ branch (when ‘is_file != 0’)...
samba-4.23.4/source3/utils/net_rpc_printer.c:347:17: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:351:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:358:38: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:358:38: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc_printer.c:358:20: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc_printer.c:368:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:368:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:370:17: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:370:17: throw: if ‘smbXcli_conn_remote_name’ throws an exception...
samba-4.23.4/source3/utils/net_rpc_printer.c:370:17: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  368|   	if (c->opt_verbose) {
#  369|   
#  370|-> 		d_printf(_("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] "
#  371|   			   "%s ACLs and %s DOS Attributes %s\n"),
#  372|   			smbXcli_conn_remote_name(cli_share_src->conn),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1215]
samba-4.23.4/source3/utils/net_rpc_printer.c:387:29: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
samba-4.23.4/source3/utils/net_rpc_printer.c:320:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:323:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:323:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:327:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:336:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:344:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:344:12: branch_true: following ‘true’ branch (when ‘is_file != 0’)...
samba-4.23.4/source3/utils/net_rpc_printer.c:347:17: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:351:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_printer.c:358:38: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:358:38: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc_printer.c:358:20: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
samba-4.23.4/source3/utils/net_rpc_printer.c:368:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:382:16: branch_true: following ‘true’ branch (when ‘is_file != 0’)...
samba-4.23.4/source3/utils/net_rpc_printer.c:387:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_printer.c:387:29: throw: if ‘cli_read’ throws an exception...
samba-4.23.4/source3/utils/net_rpc_printer.c:387:29: danger: ‘data’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  385|   		size_t n;
#  386|   
#  387|-> 		nt_status = cli_read(cli_share_src, fnum_src, data, nread,
#  388|   				     read_size, &n);
#  389|   		if (!NT_STATUS_IS_OK(nt_status)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1216]
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/utils/net_rpc_shell.c:52:12: branch_false: following ‘false’ branch (when ‘start == 0’)...
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:58:34: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:59:31: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:61:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc_shell.c:58:34: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:59:31: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:61:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#   60|   
#   61|   		if (match) {
#   62|-> 			ADD_TO_MALLOC_ARRAY(char *, SMB_STRDUP(c->name),
#   63|   					    &cmds, &n_cmds);
#   64|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1217]
samba-4.23.4/source3/utils/net_rpc_shell.c:69:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source3/utils/net_rpc_shell.c:52:12: branch_false: following ‘false’ branch (when ‘start == 0’)...
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:56:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:58:34: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:59:31: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:61:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc_shell.c:58:34: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:59:31: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:61:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:62:25: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_rpc_shell.c:58:34: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_rpc_shell.c:67:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:67:12: branch_true: following ‘true’ branch (when ‘n_cmds == 2’)...
samba-4.23.4/source3/utils/net_rpc_shell.c:68:17: branch_true: ...to here
samba-4.23.4/source3/utils/net_rpc_shell.c:69:17: danger: ‘<unknown>’ leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
#   67|   	if (n_cmds == 2) {
#   68|   		SAFE_FREE(cmds[0]);
#   69|-> 		cmds[0] = cmds[1];
#   70|   		n_cmds -= 1;
#   71|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1218]
samba-4.23.4/source3/utils/net_usershare.c:235:21: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(get_basepath(ctx))’
samba-4.23.4/source3/utils/net_usershare.c:223:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:226:14: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:226:14: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_usershare.c:227:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:227:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:235:21: throw: if ‘readdir’ throws an exception...
samba-4.23.4/source3/utils/net_usershare.c:235:21: danger: ‘opendir(get_basepath(ctx))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  233|   	}
#  234|   
#  235|-> 	while((de = readdir(dp)) != 0) {
#  236|   		SMB_STRUCT_STAT sbuf;
#  237|   		char *path;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1219]
samba-4.23.4/source3/utils/net_usershare.c:578:21: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(get_basepath(_talloc_tos("../../source3/utils/net_usershare.c:562")))’
samba-4.23.4/source3/utils/net_usershare.c:565:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:569:14: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:569:14: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_usershare.c:570:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:570:12: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:578:21: throw: if ‘readdir’ throws an exception...
samba-4.23.4/source3/utils/net_usershare.c:578:21: danger: ‘opendir(get_basepath(_talloc_tos("../../source3/utils/net_usershare.c:562")))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  576|   	}
#  577|   
#  578|-> 	while((de = readdir(dp)) != 0) {
#  579|   		SMB_STRUCT_STAT sbuf;
#  580|   		char *path;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1220]
samba-4.23.4/source3/utils/net_usershare.c:1170:9: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(lp_usershare_path(_talloc_tos("../../source3/utils/net_usershare.c:1151"), loadparm_s3_global_substitution()))’
samba-4.23.4/source3/utils/net_usershare.c:1144:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:1151:22: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:1151:14: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_usershare.c:1152:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_usershare.c:1170:9: branch_false: ...to here
samba-4.23.4/source3/utils/net_usershare.c:1170:9: danger: ‘opendir(lp_usershare_path(_talloc_tos("../../source3/utils/net_usershare.c:1151"), loadparm_s3_global_substitution()))’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 1168|   		return -1;
# 1169|   	}
# 1170|-> 	closedir(dp);
# 1171|   
# 1172|   	return net_run_function(c, argc, argv, "net usershare", func);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1221]
samba-4.23.4/source3/utils/net_util.c:114:36: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:217:10: enter_function: entry to ‘connect_dst_pipe’
samba-4.23.4/source3/utils/net_util.c:222:29: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:226:12: branch_false: following ‘false’ branch (when ‘server_name’ is non-NULL)...
samba-4.23.4/source3/utils/net_util.c:230:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:230:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:238:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:238:21: call_function: calling ‘connect_to_ipc’ from ‘connect_dst_pipe’
#  112|   			    const char *service_type)
#  113|   {
#  114|-> 	struct smb_transports ts = smbsock_transports_from_port(c->opt_port);
#  115|   	NTSTATUS nt_status;
#  116|   	int flags = 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1222]
samba-4.23.4/source3/utils/net_util.c:118:13: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:217:10: enter_function: entry to ‘connect_dst_pipe’
samba-4.23.4/source3/utils/net_util.c:222:29: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:226:12: branch_false: following ‘false’ branch (when ‘server_name’ is non-NULL)...
samba-4.23.4/source3/utils/net_util.c:230:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:230:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:238:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:238:21: call_function: calling ‘connect_to_ipc’ from ‘connect_dst_pipe’
#  116|   	int flags = 0;
#  117|   
#  118|-> 	if (strequal(service_type, "IPC")) {
#  119|   		flags |= CLI_FULL_CONNECTION_IPC;
#  120|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1223]
samba-4.23.4/source3/utils/net_util.c:122:21: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:217:10: enter_function: entry to ‘connect_dst_pipe’
samba-4.23.4/source3/utils/net_util.c:222:29: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:226:12: branch_false: following ‘false’ branch (when ‘server_name’ is non-NULL)...
samba-4.23.4/source3/utils/net_util.c:230:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:230:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:238:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:238:21: call_function: calling ‘connect_to_ipc’ from ‘connect_dst_pipe’
#  120|   	}
#  121|   
#  122|-> 	nt_status = cli_full_connection_creds(c,
#  123|   					      cli_ctx,
#  124|   					      NULL,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1224]
samba-4.23.4/source3/utils/net_util.c:133:17: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:217:10: enter_function: entry to ‘connect_dst_pipe’
samba-4.23.4/source3/utils/net_util.c:222:29: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:226:12: branch_false: following ‘false’ branch (when ‘server_name’ is non-NULL)...
samba-4.23.4/source3/utils/net_util.c:230:13: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:230:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:238:21: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:238:21: call_function: calling ‘connect_to_ipc’ from ‘connect_dst_pipe’
#  131|   					      flags);
#  132|   	if (!NT_STATUS_IS_OK(nt_status)) {
#  133|-> 		d_fprintf(stderr, _("Could not connect to server %s\n"),
#  134|   			  server_name);
#  135|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1225]
samba-4.23.4/source3/utils/net_util.c:179:36: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:407:31: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:407:31: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:411:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:412:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:412:29: call_function: calling ‘connect_to_ipc_anonymous’ from ‘net_make_ipc_connection_ex’
#  177|   				const char *server_name)
#  178|   {
#  179|-> 	struct smb_transports ts = smbsock_transports_from_port(c->opt_port);
#  180|   	NTSTATUS nt_status;
#  181|   	struct cli_credentials *anon_creds = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1226]
samba-4.23.4/source3/utils/net_util.c:183:22: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:407:31: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:407:31: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:411:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:412:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:412:29: call_function: calling ‘connect_to_ipc_anonymous’ from ‘net_make_ipc_connection_ex’
#  181|   	struct cli_credentials *anon_creds = NULL;
#  182|   
#  183|-> 	anon_creds = cli_credentials_init_anon(c);
#  184|   	if (anon_creds == NULL) {
#  185|   		DBG_ERR("cli_credentials_init_anon() failed\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1227]
samba-4.23.4/source3/utils/net_util.c:185:17: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:407:31: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:407:31: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:411:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:412:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:412:29: call_function: calling ‘connect_to_ipc_anonymous’ from ‘net_make_ipc_connection_ex’
#  183|   	anon_creds = cli_credentials_init_anon(c);
#  184|   	if (anon_creds == NULL) {
#  185|-> 		DBG_ERR("cli_credentials_init_anon() failed\n");
#  186|   		return NT_STATUS_NO_MEMORY;
#  187|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1228]
samba-4.23.4/source3/utils/net_util.c:189:21: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:407:31: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:407:31: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:411:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:412:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:412:29: call_function: calling ‘connect_to_ipc_anonymous’ from ‘net_make_ipc_connection_ex’
#  187|   	}
#  188|   
#  189|-> 	nt_status = cli_full_connection_creds(c,
#  190|   					      cli_ctx,
#  191|   					      c->opt_requester_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1229]
samba-4.23.4/source3/utils/net_util.c:203:17: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/net_util.c:407:31: branch_false: ...to here
samba-4.23.4/source3/utils/net_util.c:407:31: acquire_memory: allocated here
samba-4.23.4/source3/utils/net_util.c:411:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:412:29: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:412:29: call_function: calling ‘connect_to_ipc_anonymous’ from ‘net_make_ipc_connection_ex’
#  201|   		return nt_status;
#  202|   	} else {
#  203|-> 		DEBUG(1,("Cannot connect to server (anonymously).  Error was %s\n", nt_errstr(nt_status)));
#  204|   		return nt_status;
#  205|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1230]
samba-4.23.4/source3/utils/net_util.c:301:22: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:399:22: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:399:22: call_function: calling ‘net_find_server’ from ‘net_make_ipc_connection_ex’
#  299|   	} else if (*server_name) {
#  300|   		/* resolve the IP address */
#  301|-> 		if (!resolve_name(*server_name, server_ss, 0x20, false))  {
#  302|   			DEBUG(1,("Unable to resolve server name\n"));
#  303|   			return false;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1231]
samba-4.23.4/source3/utils/net_util.c:302:25: warning[-Wanalyzer-malloc-leak]: leak of ‘server_name’
samba-4.23.4/source3/utils/net_util.c:388:10: enter_function: entry to ‘net_make_ipc_connection_ex’
samba-4.23.4/source3/utils/net_util.c:398:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/net_util.c:399:22: branch_true: ...to here
samba-4.23.4/source3/utils/net_util.c:399:22: call_function: calling ‘net_find_server’ from ‘net_make_ipc_connection_ex’
#  300|   		/* resolve the IP address */
#  301|   		if (!resolve_name(*server_name, server_ss, 0x20, false))  {
#  302|-> 			DEBUG(1,("Unable to resolve server name\n"));
#  303|   			return false;
#  304|   		}

Error: COMPILER_WARNING (CWE-704): [#def1232]
samba-4.23.4/source3/utils/ntlm_auth.c: scope_hint: In function ‘parse_ntlm_auth_domain_user’
samba-4.23.4/source3/utils/ntlm_auth.c:389:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  389 |         char *p = strchr(domuser,winbind_separator());
#      |                   ^~~~~~
#  387|   {
#  388|   
#  389|-> 	char *p = strchr(domuser,winbind_separator());
#  390|   
#  391|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def1233]
samba-4.23.4/source3/utils/ntlm_auth.c:389:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  387|   {
#  388|   
#  389|-> 	char *p = strchr(domuser,winbind_separator());
#  390|   
#  391|   	if (!p) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1234]
samba-4.23.4/source3/utils/ntlm_auth.c:2792:27: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
samba-4.23.4/source3/utils/ntlm_auth.c:2722:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2728:14: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2790:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: acquire_memory: allocated here
samba-4.23.4/source3/utils/ntlm_auth.c:2792:27: throw: if ‘strchr_m’ throws an exception...
samba-4.23.4/source3/utils/ntlm_auth.c:2792:27: danger: ‘domain’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
# 2790|   	if (opt_username) {
# 2791|   		char *domain = SMB_STRDUP(opt_username);
# 2792|-> 		char *p = strchr_m(domain, *lp_winbind_separator());
# 2793|   		if (p) {
# 2794|   			opt_username = p+1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1235]
samba-4.23.4/source3/utils/ntlm_auth.c:2792:45: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
samba-4.23.4/source3/utils/ntlm_auth.c:2722:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2728:14: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2790:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: acquire_memory: allocated here
samba-4.23.4/source3/utils/ntlm_auth.c:2792:45: throw: if ‘lp_winbind_separator’ throws an exception...
samba-4.23.4/source3/utils/ntlm_auth.c:2792:45: danger: ‘domain’ leaks here; was allocated at [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
# 2790|   	if (opt_username) {
# 2791|   		char *domain = SMB_STRDUP(opt_username);
# 2792|-> 		char *p = strchr_m(domain, *lp_winbind_separator());
# 2793|   		if (p) {
# 2794|   			opt_username = p+1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1236]
samba-4.23.4/source3/utils/ntlm_auth.c:2796:44: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
samba-4.23.4/source3/utils/ntlm_auth.c:2722:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2728:14: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2790:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: acquire_memory: allocated here
samba-4.23.4/source3/utils/ntlm_auth.c:2793:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2794:40: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2796:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2796:44: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2796:44: throw: if ‘strequal’ throws an exception...
samba-4.23.4/source3/utils/ntlm_auth.c:2796:44: danger: ‘domain’ leaks here; was allocated at [(7)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/6)
# 2794|   			opt_username = p+1;
# 2795|   			*p = '\0';
# 2796|-> 			if (opt_domain && !strequal(opt_domain, domain)) {
# 2797|   				fprintf(stderr, "Domain specified in username (%s) "
# 2798|   					"doesn't match specified domain (%s)!\n\n",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1237]
samba-4.23.4/source3/utils/ntlm_auth.c:2800:33: warning[-Wanalyzer-malloc-leak]: leak of ‘domain’
samba-4.23.4/source3/utils/ntlm_auth.c:2722:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2728:14: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2733:12: branch_false: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2790:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2791:32: acquire_memory: allocated here
samba-4.23.4/source3/utils/ntlm_auth.c:2793:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2794:40: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2796:28: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2796:44: branch_true: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2796:29: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/ntlm_auth.c:2797:33: branch_false: ...to here
samba-4.23.4/source3/utils/ntlm_auth.c:2800:33: throw: if ‘poptPrintHelp’ throws an exception...
samba-4.23.4/source3/utils/ntlm_auth.c:2800:33: danger: ‘domain’ leaks here; was allocated at [(7)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/6)
# 2798|   					"doesn't match specified domain (%s)!\n\n",
# 2799|   					domain, opt_domain);
# 2800|-> 				poptPrintHelp(pc, stderr, 0);
# 2801|   				exit(1);
# 2802|   			}

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1238]
samba-4.23.4/source3/utils/regedit_dialog.c:82:22: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/utils/regedit_dialog.c:1836:5: enter_function: entry to ‘dialog_input_long’
samba-4.23.4/source3/utils/regedit_dialog.c:1842:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/utils/regedit_dialog.c:1843:14: call_function: calling ‘dialog_input_internal’ from ‘dialog_input_long’
#   80|   	talloc_set_destructor(dia, dialog_free);
#   81|   
#   82|-> 	dia->title = talloc_strdup(dia, title);
#   83|   	if (dia->title == NULL) {
#   84|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1239]
samba-4.23.4/source3/utils/regedit_dialog.c:102:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dia’
samba-4.23.4/source3/utils/regedit_dialog.c:1766:12: enter_function: entry to ‘dialog_input_internal’
samba-4.23.4/source3/utils/regedit_dialog.c:1788:9: call_function: calling ‘dialog_set_submit_cb’ from ‘dialog_input_internal’
#  100|   void dialog_set_submit_cb(struct dialog *dia, dialog_submit_cb cb, void *arg)
#  101|   {
#  102|-> 	dia->submit = cb;
#  103|   	dia->submit_arg = arg;
#  104|   }

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1240]
samba-4.23.4/source3/utils/regedit_dialog.c:625:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/utils/regedit_dialog.c:655:24: enter_function: entry to ‘dialog_section_label_new’
samba-4.23.4/source3/utils/regedit_dialog.c:661:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/utils/regedit_dialog.c:662:14: call_function: calling ‘dialog_section_label_new_va’ from ‘dialog_section_label_new’
#  623|   	}
#  624|   	talloc_set_destructor(label, label_free);
#  625|-> 	tmp = talloc_vasprintf(label, msg, ap);
#  626|   	if (tmp == NULL) {
#  627|   		goto fail;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1241]
samba-4.23.4/source3/utils/regedit_treeview.c:113:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘left’
samba-4.23.4/source3/utils/regedit_treeview.c:121:6: enter_function: entry to ‘tree_node_append_last’
samba-4.23.4/source3/utils/regedit_treeview.c:123:9: call_function: calling ‘tree_node_append’ from ‘tree_node_append_last’
#  111|   void tree_node_append(struct tree_node *left, struct tree_node *right)
#  112|   {
#  113|-> 	if (left->next) {
#  114|   		right->next = left->next;
#  115|   		left->next->previous = right;

Error: CPPCHECK_WARNING (CWE-457): [#def1242]
samba-4.23.4/source3/utils/regedit_treeview.c:312: warning[uninitvar]: Uninitialized variable: rv.w
#  310|   	talloc_free(array);
#  311|   
#  312|-> 	return rv;
#  313|   }
#  314|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1243]
samba-4.23.4/source3/utils/regedit_treeview.c:312:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘rv.w’
samba-4.23.4/source3/utils/regedit_treeview.c:263:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/regedit_treeview.c:266:20: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:267:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/regedit_treeview.c:270:17: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:271:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/regedit_treeview.c:271:12: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:275:32: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/regedit_treeview.c:296:12: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:296:12: branch_false: following ‘false’ branch (when ‘count == 0’)...
samba-4.23.4/source3/utils/regedit_treeview.c:309:1: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:312:16: danger: use of uninitialized value ‘rv.w’ here
#  310|   	talloc_free(array);
#  311|   
#  312|-> 	return rv;
#  313|   }
#  314|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1244]
samba-4.23.4/source3/utils/regedit_treeview.c:696:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘path’
samba-4.23.4/source3/utils/regedit_treeview.c:684:12: branch_false: following ‘false’ branch (when ‘node’ is non-NULL)...
samba-4.23.4/source3/utils/regedit_treeview.c:687:9: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:690:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/regedit_treeview.c:693:17: branch_false: ...to here
samba-4.23.4/source3/utils/regedit_treeview.c:696:16: danger: dereference of NULL ‘path’
#  694|   	path = tree_node_get_path(frame, node->parent);
#  695|   
#  696|-> 	while (*path) {
#  697|   		len += strlen(*path) + 1;
#  698|   		wprintw(label, "%s/", *path);

Error: CPPCHECK_WARNING (CWE-457): [#def1245]
samba-4.23.4/source3/utils/regedit_valuelist.c:378: warning[uninitvar]: Uninitialized variable: rv.w
#  376|   	vl->values = new_items;
#  377|   
#  378|-> 	return rv;
#  379|   }
#  380|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1246]
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:118:25: warning[-Wanalyzer-malloc-leak]: leak of ‘svc’
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:547:12: enter_function: entry to ‘export_profile_persvc’
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:555:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:556:12: branch_false: following ‘false’ branch (when ‘svc’ is non-NULL)...
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:561:15: branch_false: ...to here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:562:12: branch_false: following ‘false’ branch (when ‘sep’ is NULL)...
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:566:9: branch_false: ...to here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:566:9: call_function: calling ‘export_profile_persvc_stats’ from ‘export_profile_persvc’
#  116|   
#  117|   		if (!state->sent_help_smb1_request_total) {
#  118|-> 			evbuffer_add_printf(
#  119|   				state->buf,
#  120|   				"# HELP smb_smb1_request_total Number of "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1247]
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:126:17: warning[-Wanalyzer-malloc-leak]: leak of ‘svc’
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:547:12: enter_function: entry to ‘export_profile_persvc’
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:555:15: acquire_memory: allocated here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:556:12: branch_false: following ‘false’ branch (when ‘svc’ is non-NULL)...
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:561:15: branch_false: ...to here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:562:12: branch_false: following ‘false’ branch (when ‘sep’ is NULL)...
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:566:9: branch_false: ...to here
samba-4.23.4/source3/utils/smb_prometheus_endpoint.c:566:9: call_function: calling ‘export_profile_persvc_stats’ from ‘export_profile_persvc’
#  124|   		}
#  125|   
#  126|-> 		evbuffer_add_printf(state->buf,
#  127|   				    "smb_smb1_request_total { "
#  128|   				    "share=\"%s\",operation=\"%s\" } "

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1248]
samba-4.23.4/source3/utils/smbget.c:218:26: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpname’
samba-4.23.4/source3/utils/smbget.c:754:5: enter_function: entry to ‘main’
samba-4.23.4/source3/utils/smbget.c:894:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/smbget.c:899:9: branch_true: ...to here
samba-4.23.4/source3/utils/smbget.c:909:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:914:17: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:938:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:944:12: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:944:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:951:13: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:964:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:969:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:972:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:977:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:981:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:984:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:1059:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/smbget.c:1060:21: branch_true: ...to here
samba-4.23.4/source3/utils/smbget.c:1060:20: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:1064:30: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:1064:30: call_function: calling ‘smb_download_dir’ from ‘main’
#  216|   	tmpname = SMB_STRDUP(name);
#  217|   
#  218|-> 	while ((dirent = smbc_readdir(dirhandle))) {
#  219|   		char *newname;
#  220|   		if (!strcmp(dirent->name, ".") || !strcmp(dirent->name, "..")) {

Error: CPPCHECK_WARNING (CWE-476): [#def1249]
samba-4.23.4/source3/utils/smbget.c:354: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: filename
#  352|   	}
#  353|   
#  354|-> 	fprintf(stderr, "\r[%s] %s", filename, status);
#  355|   
#  356|   	free(filename);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1250]
samba-4.23.4/source3/utils/smbget.c:674:29: warning[-Wanalyzer-malloc-leak]: leak of ‘readbuf’
samba-4.23.4/source3/utils/smbget.c:754:5: enter_function: entry to ‘main’
samba-4.23.4/source3/utils/smbget.c:894:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/smbget.c:899:9: branch_true: ...to here
samba-4.23.4/source3/utils/smbget.c:909:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:914:17: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:938:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:944:12: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:944:13: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:951:13: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:964:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:969:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:972:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:977:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:981:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/utils/smbget.c:984:9: branch_false: ...to here
samba-4.23.4/source3/utils/smbget.c:1059:16: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/smbget.c:1060:21: branch_true: ...to here
samba-4.23.4/source3/utils/smbget.c:1060:20: branch_true: following ‘true’ branch...
samba-4.23.4/source3/utils/smbget.c:1061:30: branch_true: ...to here
samba-4.23.4/source3/utils/smbget.c:1061:30: call_function: calling ‘smb_download_file’ from ‘main’
#  672|   		}
#  673|   
#  674|-> 		bytesread = smbc_read(remotehandle, readbuf, opt.blocksize);
#  675|   		if (opt.limit_rate > 0) {
#  676|   			bytes_in_bucket += bytesread;

Error: CPPCHECK_WARNING (CWE-476): [#def1251]
samba-4.23.4/source3/winbindd/idmap.c:182: error[ctunullpointer]: Null pointer dereference: buf
#  180|   static int idmap_config_name(const char *domname, char *buf, size_t buflen)
#  181|   {
#  182|-> 	int len = snprintf(buf, buflen, "idmap config %s", domname);
#  183|   	SMB_ASSERT(len > 0);
#  184|   	return len + 1;

Error: CPPCHECK_WARNING (CWE-476): [#def1252]
samba-4.23.4/source3/winbindd/idmap.c:182: warning[nullPointer]: Possible null pointer dereference: buf
#  180|   static int idmap_config_name(const char *domname, char *buf, size_t buflen)
#  181|   {
#  182|-> 	int len = snprintf(buf, buflen, "idmap config %s", domname);
#  183|   	SMB_ASSERT(len > 0);
#  184|   	return len + 1;

Error: COMPILER_WARNING (CWE-704): [#def1253]
samba-4.23.4/source3/winbindd/idmap_nss.c: scope_hint: In function ‘idmap_nss_unixids_to_sids’
samba-4.23.4/source3/winbindd/idmap_nss.c:248:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  248 |                         p = strstr(name, lp_winbind_separator());
#      |                           ^
#  246|   			const char *domuser = NULL;
#  247|   
#  248|-> 			p = strstr(name, lp_winbind_separator());
#  249|   			if (p != NULL) {
#  250|   				*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1254]
samba-4.23.4/source3/winbindd/idmap_nss.c:248:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  246|   			const char *domuser = NULL;
#  247|   
#  248|-> 			p = strstr(name, lp_winbind_separator());
#  249|   			if (p != NULL) {
#  250|   				*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1255]
samba-4.23.4/source3/winbindd/idmap_nss.c:255:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  255 |                                 p = strchr(name, '@');
#      |                                   ^
#  253|   				domuser = p + 1;
#  254|   			} else {
#  255|-> 				p = strchr(name, '@');
#  256|   				if (p != NULL) {
#  257|   					*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1256]
samba-4.23.4/source3/winbindd/idmap_nss.c:255:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  253|   				domuser = p + 1;
#  254|   			} else {
#  255|-> 				p = strchr(name, '@');
#  256|   				if (p != NULL) {
#  257|   					*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1257]
samba-4.23.4/source3/winbindd/idmap_tdb.c: scope_hint: In function ‘convert_fn’
samba-4.23.4/source3/winbindd/idmap_tdb.c:78:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   78 |         p = strchr((const char *)key.dptr, '/');
#      |           ^
#   76|   	DEBUG(10,("Converting %s\n", (const char *)key.dptr));
#   77|   
#   78|-> 	p = strchr((const char *)key.dptr, '/');
#   79|   	if (!p)
#   80|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def1258]
samba-4.23.4/source3/winbindd/idmap_tdb.c:78:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   76|   	DEBUG(10,("Converting %s\n", (const char *)key.dptr));
#   77|   
#   78|-> 	p = strchr((const char *)key.dptr, '/');
#   79|   	if (!p)
#   80|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1259]
samba-4.23.4/source3/winbindd/idmap_tdb2.c:269:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source3/winbindd/idmap_tdb2.c:266:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:268:9: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:268:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:269:15: throw: if ‘talloc_vasprintf_append’ throws an exception...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:269:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  267|   
#  268|   	va_start(ap, fmt);
#  269|-> 	cmd = talloc_vasprintf_append(cmd, fmt, ap);
#  270|   	va_end(ap);
#  271|   	NT_STATUS_HAVE_NO_MEMORY(cmd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1260]
samba-4.23.4/source3/winbindd/idmap_tdb2.c:280:17: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(talloc_vasprintf_append(talloc_asprintf(ctx, "%s ", *ctx.script), fmt, & ap), "r")’
samba-4.23.4/source3/winbindd/idmap_tdb2.c:266:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:268:9: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:271:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:273:13: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:273:13: acquire_memory: allocated here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:279:13: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:279:12: branch_true: following ‘true’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:280:17: branch_true: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:280:17: danger: ‘popen(talloc_vasprintf_append(talloc_asprintf(ctx, "%s ", *ctx.script), fmt, & ap), "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  278|   
#  279|   	if (fgets(line, sizeof(line)-1, p) == NULL) {
#  280|-> 		pclose(p);
#  281|   		return NT_STATUS_NONE_MAPPED;
#  282|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1261]
samba-4.23.4/source3/winbindd/idmap_tdb2.c:283:9: warning[-Wanalyzer-malloc-leak]: leak of ‘popen(talloc_vasprintf_append(talloc_asprintf(ctx, "%s ", *ctx.script), fmt, & ap), "r")’
samba-4.23.4/source3/winbindd/idmap_tdb2.c:266:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:268:9: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:271:9: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:273:13: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:273:13: acquire_memory: allocated here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:275:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:279:13: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:279:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/idmap_tdb2.c:283:9: branch_false: ...to here
samba-4.23.4/source3/winbindd/idmap_tdb2.c:283:9: danger: ‘popen(talloc_vasprintf_append(talloc_asprintf(ctx, "%s ", *ctx.script), fmt, & ap), "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  281|   		return NT_STATUS_NONE_MAPPED;
#  282|   	}
#  283|-> 	pclose(p);
#  284|   
#  285|   	DEBUG(10,("idmap script gave: %s\n", line));

Error: COMPILER_WARNING (CWE-704): [#def1262]
samba-4.23.4/source3/winbindd/nss_info.c: scope_hint: In function ‘parse_nss_parm’
samba-4.23.4/source3/winbindd/nss_info.c:100:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  100 |         p = strchr( config, ':' );
#      |           ^
#   98|   		return False;
#   99|   
#  100|-> 	p = strchr( config, ':' );
#  101|   
#  102|   	/* if no : then the string must be the backend name only */

Error: COMPILER_WARNING (CWE-704): [#def1263]
samba-4.23.4/source3/winbindd/nss_info.c:100:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   98|   		return False;
#   99|   
#  100|-> 	p = strchr( config, ':' );
#  101|   
#  102|   	/* if no : then the string must be the backend name only */

Error: CPPCHECK_WARNING (CWE-457): [#def1264]
samba-4.23.4/source3/winbindd/winbindd_cache.c:527: error[uninitvar]: Uninitialized variable: buf
#  525|   	SIVAL(buf, 4, last_seq_check);
#  526|   
#  527|-> 	ret = tdb_store(wcache->tdb, key, make_tdb_data(buf, sizeof(buf)),
#  528|   			TDB_REPLACE);
#  529|   	if (ret != 0) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1265]
samba-4.23.4/source3/winbindd/winbindd_dual.c:1224:51: warning[-Wanalyzer-null-argument]: use of NULL ‘s’ where non-null expected
samba-4.23.4/source3/winbindd/winbindd_dual.c:1177:12: branch_false: following ‘false’ branch...
samba-4.23.4/source3/winbindd/winbindd_dual.c:1181:13: branch_false: ...to here
samba-4.23.4/source3/winbindd/winbindd_dual.c:1208:35: branch_false: following ‘false’ branch (when ‘dom’ is NULL)...
samba-4.23.4/source3/winbindd/winbindd_dual.c:1224:51: branch_false: ...to here
samba-4.23.4/source3/winbindd/winbindd_dual.c:1224:51: danger: argument 1 (‘s’) NULL where non-null expected
# 1222|   	status = messaging_send_buf(msg_ctx, server_id,
# 1223|   				    MSG_WINBIND_DUMP_DOMAIN_LIST,
# 1224|-> 				    (uint8_t *)s, strlen(s) + 1);
# 1225|   	if (!NT_STATUS_IS_OK(status)) {
# 1226|   		DEBUG(0,("failed to send message: %s\n",

Error: COMPILER_WARNING (CWE-704): [#def1266]
samba-4.23.4/source3/winbindd/winbindd_pam.c: scope_hint: In function ‘generate_krb5_ccache’
samba-4.23.4/source3/winbindd/winbindd_pam.c:672:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  672 |                         p = strchr(type, '%');
#      |                           ^
#  670|   			char *p;
#  671|   
#  672|-> 			p = strchr(type, '%');
#  673|   			if (p != NULL) {
#  674|   

Error: COMPILER_WARNING (CWE-704): [#def1267]
samba-4.23.4/source3/winbindd/winbindd_pam.c:672:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  670|   			char *p;
#  671|   
#  672|-> 			p = strchr(type, '%');
#  673|   			if (p != NULL) {
#  674|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1268]
samba-4.23.4/source3/winbindd/winbindd_rpc.c:358:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source3/winbindd/winbindd_rpc.c:354:25: release_memory: ‘sid_array.sids’ is NULL
samba-4.23.4/source3/winbindd/winbindd_rpc.c:358:25: release_memory: ‘sid_array.sids’ is NULL
samba-4.23.4/source3/winbindd/winbindd_rpc.c:358:25: danger: dereference of NULL ‘sid_array.sids + (long unsigned int)i * 8’
#  356|   
#  357|   		for (i = 0; i < num_query_sids; i++) {
#  358|-> 			sid_array.sids[i].sid = dom_sid_dup(mem_ctx, &sids[total_sids++]);
#  359|   			if (sid_array.sids[i].sid == NULL) {
#  360|   				return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def1269]
samba-4.23.4/source3/winbindd/winbindd_util.c: scope_hint: In function ‘parse_domain_user’
samba-4.23.4/source3/winbindd/winbindd_util.c:1995:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1995 |         p = strchr(domuser, *lp_winbind_separator());
#      |           ^
# 1993|   	}
# 1994|   
# 1995|-> 	p = strchr(domuser, *lp_winbind_separator());
# 1996|   	if (p != NULL) {
# 1997|   		user = talloc_strdup(ctx, p + 1);

Error: COMPILER_WARNING (CWE-704): [#def1270]
samba-4.23.4/source3/winbindd/winbindd_util.c:1995:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1993|   	}
# 1994|   
# 1995|-> 	p = strchr(domuser, *lp_winbind_separator());
# 1996|   	if (p != NULL) {
# 1997|   		user = talloc_strdup(ctx, p + 1);

Error: COMPILER_WARNING (CWE-704): [#def1271]
samba-4.23.4/source3/winbindd/winbindd_util.c:2016:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2016 |                 p = strchr(domuser, '@');
#      |                   ^
# 2014|   			goto fail;
# 2015|   		}
# 2016|-> 		p = strchr(domuser, '@');
# 2017|   		if (p != NULL) {
# 2018|   			/* upn */

Error: COMPILER_WARNING (CWE-704): [#def1272]
samba-4.23.4/source3/winbindd/winbindd_util.c:2016:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2014|   			goto fail;
# 2015|   		}
# 2016|-> 		p = strchr(domuser, '@');
# 2017|   		if (p != NULL) {
# 2018|   			/* upn */

Error: COMPILER_WARNING: [#def1273]
samba-4.23.4/source3/winbindd/winbindd_varlink.c: scope_hint: In function ‘wb_vl_fake_cli_state’
samba-4.23.4/source3/winbindd/winbindd_varlink.c:110:9: warning[-Wstringop-truncation]: ‘strncpy’ specified bound 32 equals destination size
#  110 |         strncpy(cli->client_name, service, sizeof(cli->client_name));
#      |         ^
#  108|   	cli->pid = pid;
#  109|   
#  110|-> 	strncpy(cli->client_name, service, sizeof(cli->client_name));
#  111|   
#  112|   	return NT_STATUS_OK;

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1274]
samba-4.23.4/source4/client/cifsdd.c:157:21: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’
#  155|   
#  156|   	for (i = 0; i < ARRAY_SIZE(args); ++i) {
#  157|-> 		if (strwicmp(arg, args[i].arg_name) == 0) {
#  158|   			return(&args[i]);
#  159|   		}

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1275]
samba-4.23.4/source4/client/cifsdd.c:241:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘long unsigned int’ but received ‘int’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:634:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:635:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:635:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:636:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:636:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:638:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:638:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:639:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:639:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:640:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:640:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:642:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:642:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:643:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:643:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:645:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  239|   		case ARG_NUMERIC:
#  240|   		case ARG_SIZE:
#  241|-> 			arg->arg_val.nval = va_arg(ap, uint64_t);
#  242|   			break;
#  243|   		case ARG_BOOL:

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1276]
samba-4.23.4/source4/client/cifsdd.c:241:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘long unsigned int’ but received ‘void *’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:634:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:635:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:635:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:636:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:636:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:638:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:638:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:639:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:639:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:640:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:640:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:642:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  239|   		case ARG_NUMERIC:
#  240|   		case ARG_SIZE:
#  241|-> 			arg->arg_val.nval = va_arg(ap, uint64_t);
#  242|   			break;
#  243|   		case ARG_BOOL:

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1277]
samba-4.23.4/source4/client/cifsdd.c:244:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘int’ but received ‘long unsigned int’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  242|   			break;
#  243|   		case ARG_BOOL:
#  244|-> 			arg->arg_val.bval = va_arg(ap, int);
#  245|   			break;
#  246|   		case ARG_PATHNAME:

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1278]
samba-4.23.4/source4/client/cifsdd.c:244:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘int’ but received ‘void *’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:634:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:635:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:635:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:636:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:636:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:638:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:638:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:639:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:639:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:640:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:640:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:642:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  242|   			break;
#  243|   		case ARG_BOOL:
#  244|-> 			arg->arg_val.bval = va_arg(ap, int);
#  245|   			break;
#  246|   		case ARG_PATHNAME:

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1279]
samba-4.23.4/source4/client/cifsdd.c:247:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘char *’ but received ‘int’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:634:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:635:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:635:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:636:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:636:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:638:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:638:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:639:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:639:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:640:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:640:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:642:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:642:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:643:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
samba-4.23.4/source4/client/cifsdd.c:643:9: return_function: returning to ‘main’ from ‘set_arg_val’
samba-4.23.4/source4/client/cifsdd.c:645:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  245|   			break;
#  246|   		case ARG_PATHNAME:
#  247|-> 			arg->arg_val.pval = va_arg(ap, char *);
#  248|   			if (arg->arg_val.pval) {
#  249|   				arg->arg_val.pval = strdup(arg->arg_val.pval);

Error: GCC_ANALYZER_WARNING (CWE-686): [#def1280]
samba-4.23.4/source4/client/cifsdd.c:247:45: warning[-Wanalyzer-va-arg-type-mismatch]: ‘va_arg’ expected ‘char *’ but received ‘long unsigned int’ for variadic argument 1 of ‘ap’
samba-4.23.4/source4/client/cifsdd.c:609:5: enter_function: entry to ‘main’
samba-4.23.4/source4/client/cifsdd.c:634:9: call_function: calling ‘set_arg_val’ from ‘main’ with 1 variadic argument
#  245|   			break;
#  246|   		case ARG_PATHNAME:
#  247|-> 			arg->arg_val.pval = va_arg(ap, char *);
#  248|   			if (arg->arg_val.pval) {
#  249|   				arg->arg_val.pval = strdup(arg->arg_val.pval);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1281]
samba-4.23.4/source4/client/client.c:768:25: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
samba-4.23.4/source4/client/client.c:715:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:720:13: branch_false: ...to here
samba-4.23.4/source4/client/client.c:738:12: branch_false: following ‘false’ branch (when ‘handle >= 0’)...
samba-4.23.4/source4/client/client.c:744:13: branch_false: ...to here
samba-4.23.4/source4/client/client.c:758:32: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:758:11: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
samba-4.23.4/source4/client/client.c:758:11: branch_false: ...to here
samba-4.23.4/source4/client/client.c:768:25: throw: if ‘smbcli_read’ throws an exception...
samba-4.23.4/source4/client/client.c:768:25: danger: ‘data’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  766|   
#  767|   	while (1) {
#  768|-> 		int n = smbcli_read(ctx->cli->tree, fnum, data, nread + start, read_size);
#  769|   
#  770|   		if (n <= 0) break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1282]
samba-4.23.4/source4/client/client.c:1157:21: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(lname, "r")’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_resource: opened here
samba-4.23.4/source4/client/client.c:1157:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1158:29: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1158:29: throw: if ‘fseek’ throws an exception...
samba-4.23.4/source4/client/client.c:1157:21: danger: ‘fopen(lname, "r")’ leaks here; was opened at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
# 1155|   	} else {
# 1156|   		f = fopen(lname, "r");
# 1157|-> 		if (f && reput) {
# 1158|   			if (fseek(f, start, SEEK_SET) == -1) {
# 1159|   				d_printf("Error seeking local file\n");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1283]
samba-4.23.4/source4/client/client.c:1157:21: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(lname, "r")’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1157:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1158:29: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1158:29: throw: if ‘fseek’ throws an exception...
samba-4.23.4/source4/client/client.c:1157:21: danger: ‘fopen(lname, "r")’ leaks here; was allocated at [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
# 1155|   	} else {
# 1156|   		f = fopen(lname, "r");
# 1157|-> 		if (f && reput) {
# 1158|   			if (fseek(f, start, SEEK_SET) == -1) {
# 1159|   				d_printf("Error seeking local file\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1284]
samba-4.23.4/source4/client/client.c:1172:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_resource: opened here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1172:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source4/client/client.c:1172:9: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
# 1170|   
# 1171|   
# 1172|-> 	DEBUG(1,("putting file %s as %s ",lname,
# 1173|   		 rname));
# 1174|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1285]
samba-4.23.4/source4/client/client.c:1172:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1172:9: throw: if ‘debuglevel_get_class’ throws an exception...
samba-4.23.4/source4/client/client.c:1172:9: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4)
# 1170|   
# 1171|   
# 1172|-> 	DEBUG(1,("putting file %s as %s ",lname,
# 1173|   		 rname));
# 1174|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1286]
samba-4.23.4/source4/client/client.c:1177:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_resource: opened here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
samba-4.23.4/source4/client/client.c:1177:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1177:17: throw: if ‘d_printf’ throws an exception...
samba-4.23.4/source4/client/client.c:1177:17: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
# 1175|   	buf = (uint8_t *)malloc(maxwrite);
# 1176|   	if (!buf) {
# 1177|-> 		d_printf("ERROR: Not enough memory!\n");
# 1178|   		fclose(f);
# 1179|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1287]
samba-4.23.4/source4/client/client.c:1177:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_true: following ‘true’ branch (when ‘buf’ is NULL)...
samba-4.23.4/source4/client/client.c:1177:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1177:17: throw: if ‘d_printf’ throws an exception...
samba-4.23.4/source4/client/client.c:1177:17: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
# 1175|   	buf = (uint8_t *)malloc(maxwrite);
# 1176|   	if (!buf) {
# 1177|-> 		d_printf("ERROR: Not enough memory!\n");
# 1178|   		fclose(f);
# 1179|   		return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1288]
samba-4.23.4/source4/client/client.c:1189:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source4/client/client.c:1153:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1175:26: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1186:27: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1189:25: throw: if ‘d_printf’ throws an exception...
samba-4.23.4/source4/client/client.c:1189:25: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6)
# 1187|   				break; /* Empty local file. */
# 1188|   
# 1189|-> 			d_printf("Error reading local file: %s\n", strerror(errno));
# 1190|   			rc = 1;
# 1191|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1289]
samba-4.23.4/source4/client/client.c:1194:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_resource: opened here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1194:23: throw: if ‘smbcli_write’ throws an exception...
samba-4.23.4/source4/client/client.c:1194:23: danger: ‘f’ leaks here; was opened at [(6)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/5)
# 1192|   		}
# 1193|   
# 1194|-> 		ret = smbcli_write(ctx->cli->tree, fnum, 0, buf, nread + start, n);
# 1195|   
# 1196|   		if (n != ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1290]
samba-4.23.4/source4/client/client.c:1194:23: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source4/client/client.c:1153:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1175:26: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1194:23: throw: if ‘smbcli_write’ throws an exception...
samba-4.23.4/source4/client/client.c:1194:23: danger: ‘buf’ leaks here; was allocated at [(8)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/7)
# 1192|   		}
# 1193|   
# 1194|-> 		ret = smbcli_write(ctx->cli->tree, fnum, 0, buf, nread + start, n);
# 1195|   
# 1196|   		if (n != ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1291]
samba-4.23.4/source4/client/client.c:1194:23: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1194:23: throw: if ‘smbcli_write’ throws an exception...
samba-4.23.4/source4/client/client.c:1194:23: danger: ‘f’ leaks here; was allocated at [(6)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/5)
# 1192|   		}
# 1193|   
# 1194|-> 		ret = smbcli_write(ctx->cli->tree, fnum, 0, buf, nread + start, n);
# 1195|   
# 1196|   		if (n != ret) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1292]
samba-4.23.4/source4/client/client.c:1197:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_resource: opened here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1196:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1197:76: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1197:25: throw: if ‘smbcli_errstr’ throws an exception...
samba-4.23.4/source4/client/client.c:1197:25: danger: ‘f’ leaks here; was opened at [(6)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/5)
# 1195|   
# 1196|   		if (n != ret) {
# 1197|-> 			d_printf("Error writing file: %s\n", smbcli_errstr(ctx->cli->tree));
# 1198|   			rc = 1;
# 1199|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1293]
samba-4.23.4/source4/client/client.c:1197:25: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source4/client/client.c:1153:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1175:26: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1196:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1197:76: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1197:25: throw: if ‘smbcli_errstr’ throws an exception...
samba-4.23.4/source4/client/client.c:1197:25: danger: ‘buf’ leaks here; was allocated at [(8)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/7)
# 1195|   
# 1196|   		if (n != ret) {
# 1197|-> 			d_printf("Error writing file: %s\n", smbcli_errstr(ctx->cli->tree));
# 1198|   			rc = 1;
# 1199|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1294]
samba-4.23.4/source4/client/client.c:1197:25: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/client/client.c:1115:12: enter_function: entry to ‘do_put’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_false: following ‘false’ branch (when the strings are non-equal)...
samba-4.23.4/source4/client/client.c:1156:21: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1156:21: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1181:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1185:26: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1185:26: call_function: calling ‘readfile’ from ‘do_put’
samba-4.23.4/source4/client/client.c:1185:26: return_function: returning to ‘do_put’ from ‘readfile’
samba-4.23.4/source4/client/client.c:1185:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1194:23: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1196:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1197:76: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1197:25: throw: if ‘smbcli_errstr’ throws an exception...
samba-4.23.4/source4/client/client.c:1197:25: danger: ‘f’ leaks here; was allocated at [(6)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/5)
# 1195|   
# 1196|   		if (n != ret) {
# 1197|-> 			d_printf("Error writing file: %s\n", smbcli_errstr(ctx->cli->tree));
# 1198|   			rc = 1;
# 1199|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1295]
samba-4.23.4/source4/client/client.c:1205:13: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source4/client/client.c:1153:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1175:26: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1205:13: throw: if ‘smbcli_close’ throws an exception...
samba-4.23.4/source4/client/client.c:1205:13: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/6)
# 1203|   	}
# 1204|   
# 1205|-> 	if (NT_STATUS_IS_ERR(smbcli_close(ctx->cli->tree, fnum))) {
# 1206|   		d_printf("%s closing remote file %s\n",smbcli_errstr(ctx->cli->tree),rname);
# 1207|   		fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1296]
samba-4.23.4/source4/client/client.c:1206:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/client/client.c:1142:12: branch_false: following ‘false’ branch (when ‘fnum != -1’)...
samba-4.23.4/source4/client/client.c:1152:14: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1152:12: branch_true: following ‘true’ branch (when the strings are equal)...
samba-4.23.4/source4/client/client.c:1153:17: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1166:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1172:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1175:26: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1176:12: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)...
samba-4.23.4/source4/client/client.c:1176:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1205:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:1206:70: branch_true: ...to here
samba-4.23.4/source4/client/client.c:1206:17: throw: if ‘smbcli_errstr’ throws an exception...
samba-4.23.4/source4/client/client.c:1206:17: danger: ‘buf’ leaks here; was allocated at [(7)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/6)
# 1204|   
# 1205|   	if (NT_STATUS_IS_ERR(smbcli_close(ctx->cli->tree, fnum))) {
# 1206|-> 		d_printf("%s closing remote file %s\n",smbcli_errstr(ctx->cli->tree),rname);
# 1207|   		fclose(f);
# 1208|   		SAFE_FREE(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1297]
samba-4.23.4/source4/client/client.c:1347:15: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(directory)’
samba-4.23.4/source4/client/client.c:1372:12: enter_function: entry to ‘file_find’
samba-4.23.4/source4/client/client.c:1383:15: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:1384:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:1384:12: branch_false: ...to here
samba-4.23.4/source4/client/client.c:1386:25: call_function: calling ‘readdirname’ from ‘file_find’
# 1345|   		return(NULL);
# 1346|   
# 1347|-> 	ptr = (struct dirent *)readdir(p);
# 1348|   	if (!ptr)
# 1349|   		return(NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1298]
samba-4.23.4/source4/client/client.c:2927:25: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(*f.name)’
samba-4.23.4/source4/client/client.c:2925:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:2926:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:2927:54: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:2927:25: danger: ‘strdup(*f.name)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/27/codeFlows/0/threadFlows/0/locations/4)
# 2925|   	if ((info->count < MAX_COMPLETIONS - 1) && (strncmp(info->text, f->name, info->len) == 0) && (!ISDOT(f->name)) && (!ISDOTDOT(f->name))) {
# 2926|   		if ((info->dirmask[0] == 0) && !(f->attrib & FILE_ATTRIBUTE_DIRECTORY))
# 2927|-> 			info->matches[info->count] = strdup(f->name);
# 2928|   		else {
# 2929|   			char *tmp;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1299]
samba-4.23.4/source4/client/client.c:2996:17: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(info.matches[1])’
samba-4.23.4/source4/client/client.c:2965:12: branch_false: following ‘false’ branch (when ‘len <= 4095’)...
samba-4.23.4/source4/client/client.c:2968:24: branch_false: ...to here
samba-4.23.4/source4/client/client.c:2969:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:2970:9: branch_false: ...to here
samba-4.23.4/source4/client/client.c:2986:12: branch_false: following ‘false’ branch (when ‘ret >= 0’)...
samba-4.23.4/source4/client/client.c:2990:13: branch_false: ...to here
samba-4.23.4/source4/client/client.c:2990:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/client/client.c:2995:13: branch_false: ...to here
samba-4.23.4/source4/client/client.c:2995:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/client/client.c:2996:42: branch_true: ...to here
samba-4.23.4/source4/client/client.c:2996:35: acquire_memory: allocated here
samba-4.23.4/source4/client/client.c:2996:17: danger: ‘strdup(info.matches[1])’ leaks here; was allocated at [(11)](sarif:/runs/0/results/28/codeFlows/0/threadFlows/0/locations/10)
# 2994|   
# 2995|   	if (info.count == 2)
# 2996|-> 		info.matches[0] = strdup(info.matches[1]);
# 2997|   	else {
# 2998|   		info.matches[0] = malloc_array_p(char, info.samelen+1);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1300]
samba-4.23.4/source4/dsdb/common/rodc_helper.c:213:13: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘num_never_reveal_sids’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:133:8: enter_function: entry to ‘samdb_confirm_rodc_allowed_to_repl_to_sid_list’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:151:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:160:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:160:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:171:20: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:174:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:182:16: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:182:16: call_function: calling ‘samdb_result_sid_array_dn’ from ‘samdb_confirm_rodc_allowed_to_repl_to_sid_list’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:182:16: return_function: returning to ‘samdb_confirm_rodc_allowed_to_repl_to_sid_list’ from ‘samdb_result_sid_array_dn’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:186:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:194:16: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:194:16: call_function: calling ‘samdb_result_sid_array_dn’ from ‘samdb_confirm_rodc_allowed_to_repl_to_sid_list’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:194:16: return_function: returning to ‘samdb_confirm_rodc_allowed_to_repl_to_sid_list’ from ‘samdb_result_sid_array_dn’
samba-4.23.4/source4/dsdb/common/rodc_helper.c:198:12: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:207:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:207:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:212:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:212:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/common/rodc_helper.c:213:13: branch_true: ...to here
samba-4.23.4/source4/dsdb/common/rodc_helper.c:213:13: danger: use of uninitialized value ‘num_never_reveal_sids’ here
#  211|   
#  212|   	if (never_reveal_sids &&
#  213|-> 	    sid_list_match(num_token_sids,
#  214|   			   token_sids,
#  215|   			   num_never_reveal_sids,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1301]
samba-4.23.4/source4/dsdb/common/util.c:81:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:80:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:81:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:81:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   79|   
#   80|   	va_start(ap, format);
#   81|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn,
#   82|   			       res, attrs, format, ap);
#   83|   	va_end(ap);

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1302]
samba-4.23.4/source4/dsdb/common/util.c:122:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:138:13: enter_function: entry to ‘samdb_search_string’
samba-4.23.4/source4/dsdb/common/util.c:147:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:148:15: call_function: calling ‘samdb_search_string_v’ from ‘samdb_search_string’
#  120|   	attrs[0] = attr_name;
#  121|   
#  122|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
#  123|   	if (count > 1) {
#  124|   		DEBUG(1,("samdb: search for %s %s not single valued (count=%d)\n",

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1303]
samba-4.23.4/source4/dsdb/common/util.c:165:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:164:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:165:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:165:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  163|   
#  164|   	va_start(ap, format);
#  165|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, NULL, format, ap);
#  166|   	va_end(ap);
#  167|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1304]
samba-4.23.4/source4/dsdb/common/util.c:194:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:193:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:194:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:194:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  192|   
#  193|   	va_start(ap, format);
#  194|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
#  195|   	va_end(ap);
#  196|   	if (count > 1) {

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1305]
samba-4.23.4/source4/dsdb/common/util.c:227:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:226:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:227:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:227:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  225|   
#  226|   	va_start(ap, format);
#  227|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
#  228|   	va_end(ap);
#  229|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1306]
samba-4.23.4/source4/dsdb/common/util.c:255:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:254:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:255:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:255:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  253|   
#  254|   	va_start(ap, format);
#  255|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
#  256|   	va_end(ap);
#  257|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1307]
samba-4.23.4/source4/dsdb/common/util.c:284:17: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:283:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:284:17: throw: if ‘gendb_search_v’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:284:17: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  282|   
#  283|   	va_start(ap, format);
#  284|-> 	count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
#  285|   	va_end(ap);
#  286|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1308]
samba-4.23.4/source4/dsdb/common/util.c:5667:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:5655:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:5659:15: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5660:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:5665:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5665:12: branch_true: following ‘true’ branch (when ‘exp_fmt’ is non-NULL)...
samba-4.23.4/source4/dsdb/common/util.c:5666:17: branch_true: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5666:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:5667:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:5667:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/6)
# 5665|   	if (exp_fmt) {
# 5666|   		va_start(ap, exp_fmt);
# 5667|-> 		expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
# 5668|   		va_end(ap);
# 5669|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1309]
samba-4.23.4/source4/dsdb/common/util.c:5831:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:5817:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:5821:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5824:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:5829:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5829:12: branch_true: following ‘true’ branch (when ‘exp_fmt’ is non-NULL)...
samba-4.23.4/source4/dsdb/common/util.c:5830:17: branch_true: ...to here
samba-4.23.4/source4/dsdb/common/util.c:5830:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:5831:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:5831:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/6)
# 5829|   	if (exp_fmt) {
# 5830|   		va_start(ap, exp_fmt);
# 5831|-> 		expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
# 5832|   		va_end(ap);
# 5833|   

Error: COMPILER_WARNING (CWE-704): [#def1310]
samba-4.23.4/source4/dsdb/common/util.c: scope_hint: In function ‘samdb_forest_name’
samba-4.23.4/source4/dsdb/common/util.c:5867:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5867 |         p = strchr(forest_name, '/');
#      |           ^
# 5865|   	}
# 5866|   
# 5867|-> 	p = strchr(forest_name, '/');
# 5868|   	if (p) {
# 5869|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1311]
samba-4.23.4/source4/dsdb/common/util.c:5867:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5865|   	}
# 5866|   
# 5867|-> 	p = strchr(forest_name, '/');
# 5868|   	if (p) {
# 5869|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1312]
samba-4.23.4/source4/dsdb/common/util.c: scope_hint: In function ‘samdb_default_domain_name’
samba-4.23.4/source4/dsdb/common/util.c:5886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5886 |         p = strchr(domain_name, '/');
#      |           ^
# 5884|   	}
# 5885|   
# 5886|-> 	p = strchr(domain_name, '/');
# 5887|   	if (p) {
# 5888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1313]
samba-4.23.4/source4/dsdb/common/util.c:5886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5884|   	}
# 5885|   
# 5886|-> 	p = strchr(domain_name, '/');
# 5887|   	if (p) {
# 5888|   		*p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1314]
samba-4.23.4/source4/dsdb/common/util.c:6952:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/common/util.c:6940:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:6944:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:6945:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/common/util.c:6948:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/common/util.c:6950:12: branch_true: following ‘true’ branch (when ‘exp_fmt’ is non-NULL)...
samba-4.23.4/source4/dsdb/common/util.c:6951:17: branch_true: ...to here
samba-4.23.4/source4/dsdb/common/util.c:6951:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/common/util.c:6952:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source4/dsdb/common/util.c:6952:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(7)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/6)
# 6950|   	if (exp_fmt) {
# 6951|   		va_start(ap, exp_fmt);
# 6952|-> 		expression = talloc_vasprintf(tmp_ctx, exp_fmt, ap);
# 6953|   		va_end(ap);
# 6954|   

Error: CPPCHECK_WARNING (CWE-457): [#def1315]
samba-4.23.4/source4/dsdb/common/util_links.c:40: error[uninitvar]: Uninitialized variable: v2_data
#   38|   	struct ldb_val v1 = data_blob_const(v1_data, sizeof(v1_data));
#   39|   	uint8_t v2_data[16];
#   40|-> 	struct ldb_val v2 = data_blob_const(v2_data, sizeof(v2_data));
#   41|   
#   42|   	/* This can't fail */

Error: COMPILER_WARNING (CWE-704): [#def1316]
samba-4.23.4/source4/dsdb/samdb/cracknames.c: scope_hint: In function ‘DsCrackNameOneFilter’
samba-4.23.4/source4/dsdb/samdb/cracknames.c:1196:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1196 |         p = strchr(info1->dns_domain_name, '/');
#      |           ^
# 1194|   	info1->dns_domain_name = ldb_dn_canonical_string(mem_ctx, result->dn);
# 1195|   	W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
# 1196|-> 	p = strchr(info1->dns_domain_name, '/');
# 1197|   	if (p) {
# 1198|   		p[0] = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1317]
samba-4.23.4/source4/dsdb/samdb/cracknames.c:1196:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1194|   	info1->dns_domain_name = ldb_dn_canonical_string(mem_ctx, result->dn);
# 1195|   	W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
# 1196|-> 	p = strchr(info1->dns_domain_name, '/');
# 1197|   	if (p) {
# 1198|   		p[0] = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1318]
samba-4.23.4/source4/dsdb/samdb/cracknames.c: scope_hint: In function ‘crack_name_to_nt4_name’
samba-4.23.4/source4/dsdb/samdb/cracknames.c:1576:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1576 |         p = strchr(*nt4_domain, '\\');
#      |           ^
# 1574|   	}
# 1575|   
# 1576|-> 	p = strchr(*nt4_domain, '\\');
# 1577|   	if (!p) {
# 1578|   		return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def1319]
samba-4.23.4/source4/dsdb/samdb/cracknames.c:1576:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1574|   	}
# 1575|   
# 1576|-> 	p = strchr(*nt4_domain, '\\');
# 1577|   	if (!p) {
# 1578|   		return NT_STATUS_INVALID_PARAMETER;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1320]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:696:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘msg’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:658:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:664:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:664:12: branch_false: following ‘false’ branch (when ‘implicit_validated_write_control’ is NULL)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:674:21: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:684:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:694:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:696:40: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:696:40: danger: dereference of NULL ‘msg’
#  694|   		if (ret != LDB_SUCCESS) {
#  695|   			dsdb_acl_debug(sd, acl_user_token(module),
#  696|-> 				       msg->dn,
#  697|   				       true,
#  698|   				       10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1321]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:722:55: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘msg’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:658:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:664:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:684:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:694:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:709:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:709:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:714:21: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:714:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:722:55: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:722:55: danger: dereference of NULL ‘msg’
#  720|   
#  721|   		ret = dsdb_module_search_dn(module, tmp_ctx,
#  722|-> 					    &acl_res, msg->dn,
#  723|   					    acl_attrs,
#  724|   					    DSDB_FLAG_NEXT_MODULE |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1322]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:795:62: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘msg’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:658:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:660:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:664:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:684:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:694:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:709:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:709:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:734:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:734:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:741:13: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:750:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:755:30: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:766:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:771:15: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:780:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:785:63: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:793:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:795:62: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:795:62: danger: dereference of NULL ‘msg’
#  793|   	if (userAccountControl & (UF_SERVER_TRUST_ACCOUNT | UF_PARTIAL_SECRETS_ACCOUNT)) {
#  794|   		ret = dsdb_module_find_ntdsguid_for_computer(module, tmp_ctx,
#  795|-> 							     msg->dn, &ntds, req);
#  796|   		if (ret != LDB_SUCCESS) {
#  797|   			ldb_asprintf_errstring(ldb, "Failed to find NTDSDSA objectGuid for %s: %s",

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1323]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:902:40: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘msg’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:859:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:869:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:869:12: branch_false: following ‘false’ branch (when ‘implicit_validated_write_control’ is NULL)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:879:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:885:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:890:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:900:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:902:40: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:902:40: danger: dereference of NULL ‘msg’
#  900|   		if (ret != LDB_SUCCESS) {
#  901|   			dsdb_acl_debug(sd, acl_user_token(module),
#  902|-> 				       msg->dn,
#  903|   				       true,
#  904|   				       10);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1324]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:935:55: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘msg’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:859:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:869:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:885:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:890:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:900:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:915:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:915:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:916:36: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:927:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:935:55: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:935:55: danger: dereference of NULL ‘msg’
#  933|   
#  934|   		ret = dsdb_module_search_dn(module, tmp_ctx,
#  935|-> 					    &acl_res, msg->dn,
#  936|   					    acl_attrs,
#  937|   					    DSDB_FLAG_NEXT_MODULE |

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1325]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1046:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘search_res’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:859:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:863:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:865:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:869:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:885:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:890:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:900:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:915:13: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:915:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:947:19: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:947:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:956:18: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:957:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:962:32: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:963:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:968:23: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:997:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1002:42: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1009:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1013:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1020:12: branch_false: following ‘false’ branch (when ‘account_name_len <= dns_host_name_len’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1024:39: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1023:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1030:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1035:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/acl.c:1046:33: danger: dereference of NULL ‘search_res’
# 1044|   	ret = dsdb_find_nc_root(ldb,
# 1045|   				tmp_ctx,
# 1046|-> 				search_res->dn,
# 1047|   				&nc_root);
# 1048|   	if (ret != LDB_SUCCESS) {

Error: COMPILER_WARNING (CWE-704): [#def1326]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c: scope_hint: In function ‘get_key_directory’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c:128:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  128 |         p = strrchr(private_dir, '/');
#      |           ^
#  126|   	}
#  127|   
#  128|-> 	p = strrchr(private_dir, '/');
#  129|   	if (p != NULL) {
#  130|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1327]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c:128:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126|   	}
#  127|   
#  128|-> 	p = strrchr(private_dir, '/');
#  129|   	if (p != NULL) {
#  130|   		*p = '\0';

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1328]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:346:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘dn1’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:672:13: enter_function: entry to ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:695:12: branch_false: following ‘false’ branch (when ‘max_num_values != 0’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:709:21: branch_true: following ‘true’ branch (when ‘i < max_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:21: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:715:46: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:717:31: call_function: calling ‘dn_compare’ from ‘log_membership_changes’
#  344|   	 * Do a binary compare first to avoid unnecessary parsing
#  345|   	 */
#  346|-> 	if (data_blob_cmp(dn1->v, dn2->v) == 0) {
#  347|   		/*
#  348|   		 * Values are equal at a binary level so no need

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1329]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:743:29: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘old_val’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:672:13: enter_function: entry to ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:695:12: branch_false: following ‘false’ branch (when ‘max_num_values != 0’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:709:21: branch_true: following ‘true’ branch (when ‘i < max_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:21: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:718:27: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:718:27: branch_true: following ‘true’ branch (when ‘old_i < old_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:722:46: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:743:29: danger: dereference of NULL ‘old_val’
#  741|   			const char *user = NULL;
#  742|   			enum event_id_type event_id;
#  743|-> 			if (old_val->dsdb_dn == NULL) {
#  744|   				really_parse_trusted_dn(
#  745|   					ctx,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1330]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:840:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘new_val’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:672:13: enter_function: entry to ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:695:12: branch_false: following ‘false’ branch (when ‘max_num_values != 0’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:703:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: call_function: calling ‘get_parsed_dns’ from ‘log_membership_changes’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:704:22: return_function: returning to ‘log_membership_changes’ from ‘get_parsed_dns’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:709:21: branch_true: following ‘true’ branch (when ‘i < max_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:21: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:711:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:718:27: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:718:27: branch_false: following ‘false’ branch (when ‘old_i >= old_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:725:27: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:725:27: branch_true: following ‘true’ branch (when ‘new_i < new_num_values’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:730:46: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:755:27: branch_false: following ‘false’ branch (when ‘cmp != 1’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:761:27: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:761:27: branch_false: following ‘false’ branch (when ‘cmp != 2’)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:840:30: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/group_audit.c:840:30: danger: dereference of NULL ‘new_val’
#  838|   			const char *user = NULL;
#  839|   			enum event_id_type event_id;
#  840|-> 			if ( new_val->dsdb_dn == NULL) {
#  841|   				really_parse_trusted_dn(
#  842|   					ctx,

Error: COMPILER_WARNING (CWE-704): [#def1331]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c: scope_hint: In function ‘partition_load_modules’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c:106:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  106 |                 p = strchr((const char *)dn_blob.data, ':');
#      |                   ^
#  104|   		dn_blob = modules_attributes->values[i];
#  105|   
#  106|-> 		p = strchr((const char *)dn_blob.data, ':');
#  107|   		if (!p) {
#  108|   			ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def1332]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c:106:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  104|   		dn_blob = modules_attributes->values[i];
#  105|   
#  106|-> 		p = strchr((const char *)dn_blob.data, ':');
#  107|   		if (!p) {
#  108|   			ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def1333]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c: scope_hint: In function ‘partition_reload_if_required’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c:460:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  460 |                         char *p = strrchr((const char *)dn_blob.data, ':');
#      |                                   ^~~~~~~
#  458|   
#  459|   			/* Look for DN:filename.ldb */
#  460|-> 			char *p = strrchr((const char *)dn_blob.data, ':');
#  461|   			if (!p) {
#  462|   				ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def1334]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/partition_init.c:460:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  458|   
#  459|   			/* Look for DN:filename.ldb */
#  460|-> 			char *p = strrchr((const char *)dn_blob.data, ':');
#  461|   			if (!p) {
#  462|   				ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def1335]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c: scope_hint: In function ‘rr_search_callback’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  123 |                 p = strchr(ac->req->op.search.attrs[i], ';');
#      |                   ^
#  121|   		struct ldb_val *orig_values;
#  122|   
#  123|-> 		p = strchr(ac->req->op.search.attrs[i], ';');
#  124|   		if (!p) {
#  125|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def1336]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  121|   		struct ldb_val *orig_values;
#  122|   
#  123|-> 		p = strchr(ac->req->op.search.attrs[i], ';');
#  124|   		if (!p) {
#  125|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def1337]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c: scope_hint: In function ‘rr_search’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c:230:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  230 |                 p = strchr(new_attrs[i], ';');
#      |                   ^
#  228|   		new_attrs[i] = req->op.search.attrs[i];
#  229|   		new_attrs[i+1] = NULL;
#  230|-> 		p = strchr(new_attrs[i], ';');
#  231|   		if (!p) {
#  232|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def1338]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/ranged_results.c:230:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  228|   		new_attrs[i] = req->op.search.attrs[i];
#  229|   		new_attrs[i+1] = NULL;
#  230|-> 		p = strchr(new_attrs[i], ';');
#  231|   		if (!p) {
#  232|   			continue;

Error: CPPCHECK_WARNING (CWE-457): [#def1339]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/repl_meta_data.c:1305: error[uninitvar]: Uninitialized variable: guid_data
# 1303|   		guid = GUID_random();
# 1304|   
# 1305|-> 		guid_blob_stack = data_blob_const(guid_data, sizeof(guid_data));
# 1306|   
# 1307|   		/* This can't fail */

Error: COMPILER_WARNING (CWE-704): [#def1340]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/rootdse.c: scope_hint: In function ‘get_optional_feature_dn_guid’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/rootdse.c:1159:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1159 |         guid = strchr(ldb_val_str, ':');
#      |              ^
# 1157|   	}
# 1158|   
# 1159|-> 	guid = strchr(ldb_val_str, ':');
# 1160|   	if (!guid) {
# 1161|   		ldb_set_errstring(ldb,

Error: COMPILER_WARNING (CWE-704): [#def1341]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/rootdse.c:1159:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1157|   	}
# 1158|   
# 1159|-> 	guid = strchr(ldb_val_str, ':');
# 1160|   	if (!guid) {
# 1161|   		ldb_set_errstring(ldb,

Error: COMPILER_WARNING (CWE-704): [#def1342]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/samldb.c: scope_hint: In function ‘check_spn_alias_collision’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/samldb.c:3843:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3843 |         p = strchr(spn, '/');
#      |           ^
# 3841|   	 *    spn_tail      = "example.com/xxx"
# 3842|   	 */
# 3843|-> 	p = strchr(spn, '/');
# 3844|   	if (p == NULL) {
# 3845|   		/* bad SPN */

Error: COMPILER_WARNING (CWE-704): [#def1343]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/samldb.c:3843:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3841|   	 *    spn_tail      = "example.com/xxx"
# 3842|   	 */
# 3843|-> 	p = strchr(spn, '/');
# 3844|   	if (p == NULL) {
# 3845|   		/* bad SPN */

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1344]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:233:30: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:227:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:231:12: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:231:12: branch_true: following ‘true’ branch (when ‘format’ is non-NULL)...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:232:17: branch_true: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:232:17: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:233:30: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/util.c:233:30: danger: missing call to ‘va_end’ to match ‘va_start’ at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  231|   	if (format) {
#  232|   		va_start(ap, format);
#  233|-> 		expression = talloc_vasprintf(tmp_ctx, format, ap);
#  234|   		va_end(ap);
#  235|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1345]
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:654:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘store’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:763:12: enter_function: entry to ‘vlv_search’
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:778:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:782:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:786:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:791:20: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:792:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:796:21: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:797:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:801:16: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:805:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:810:9: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:817:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:862:26: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:864:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:864:20: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:868:29: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:878:26: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:878:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:887:17: branch_false: ...to here
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:887:17: release_memory: ‘current’ is NULL
samba-4.23.4/source4/dsdb/samdb/ldb_modules/vlv_pagination.c:888:23: call_function: calling ‘copy_search_details’ from ‘vlv_search’
#  652|   {
#  653|   	/* free the old details which are no longer going to be reachable. */
#  654|-> 	if (store->vlv_details != NULL){
#  655|   		TALLOC_FREE(store->vlv_details);
#  656|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1346]
samba-4.23.4/source4/dsdb/schema/schema_query.c:280:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  278|   	switch (query) {
#  279|   	case DSDB_SCHEMA_ALL_MAY:
#  280|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mayContain);
#  281|   		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->systemMayContain);
#  282|   		break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1347]
samba-4.23.4/source4/dsdb/schema/schema_query.c:285:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  283|   
#  284|   	case DSDB_SCHEMA_ALL_MUST:
#  285|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mustContain);
#  286|   		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->systemMustContain);
#  287|   		break;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1348]
samba-4.23.4/source4/dsdb/schema/schema_query.c:290:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  288|   
#  289|   	case DSDB_SCHEMA_SYS_MAY:
#  290|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->systemMayContain);
#  291|   		break;
#  292|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1349]
samba-4.23.4/source4/dsdb/schema/schema_query.c:294:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  292|   
#  293|   	case DSDB_SCHEMA_SYS_MUST:
#  294|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->systemMustContain);
#  295|   		break;
#  296|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1350]
samba-4.23.4/source4/dsdb/schema/schema_query.c:298:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  296|   
#  297|   	case DSDB_SCHEMA_MAY:
#  298|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mayContain);
#  299|   		break;
#  300|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1351]
samba-4.23.4/source4/dsdb/schema/schema_query.c:302:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  300|   
#  301|   	case DSDB_SCHEMA_MUST:
#  302|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mustContain);
#  303|   		break;
#  304|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1352]
samba-4.23.4/source4/dsdb/schema/schema_query.c:306:65: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘sclass’
samba-4.23.4/source4/dsdb/schema/schema_query.c:372:21: enter_function: entry to ‘dsdb_full_attribute_list_internal_el’
samba-4.23.4/source4/dsdb/schema/schema_query.c:380:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/dsdb/schema/schema_query.c:383:100: branch_true: ...to here
samba-4.23.4/source4/dsdb/schema/schema_query.c:382:27: call_function: calling ‘attribute_list_from_class’ from ‘dsdb_full_attribute_list_internal_el’
#  304|   
#  305|   	case DSDB_SCHEMA_ALL:
#  306|-> 		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mayContain);
#  307|   		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->systemMayContain);
#  308|   		attr_list = merge_attr_list(mem_ctx, attr_list, sclass->mustContain);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1353]
samba-4.23.4/source4/kdc/db-glue.c:369:23: warning[-Wanalyzer-malloc-leak]: leak of ‘sentry.keys.val’
samba-4.23.4/source4/kdc/db-glue.c:4542:17: enter_function: entry to ‘dsdb_extract_aes_256_key’
samba-4.23.4/source4/kdc/db-glue.c:4561:20: call_function: calling ‘samba_kdc_message2entry_keys’ from ‘dsdb_extract_aes_256_key’
#  367|   		struct sdb_key key = {};
#  368|   
#  369|-> 		ret = smb_krb5_keyblock_init_contents(context,
#  370|   						      ENCTYPE_AES256_CTS_HMAC_SHA1_96,
#  371|   						      secretbuffer->data,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1354]
samba-4.23.4/source4/kdc/db-glue.c:525:31: warning[-Wanalyzer-malloc-leak]: leak of ‘key.salt’
samba-4.23.4/source4/kdc/db-glue.c:4542:17: enter_function: entry to ‘dsdb_extract_aes_256_key’
samba-4.23.4/source4/kdc/db-glue.c:4561:20: call_function: calling ‘samba_kdc_message2entry_keys’ from ‘dsdb_extract_aes_256_key’
#  523|   			key.salt->type = KRB5_PW_SALT;
#  524|   
#  525|-> 			ret = smb_krb5_copy_data_contents(&key.salt->salt,
#  526|   							  salt.data,
#  527|   							  salt.length);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1355]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: warning[-Wanalyzer-malloc-leak]: leak of ‘netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:77:17: enter_function: entry to ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:98:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:103:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:105:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:122:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:126:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: branch_true: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: call_function: calling ‘ks_get_netbios_name’ from ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: return_function: returning to ‘kdb_samba_db_check_policy_as’ from ‘ks_get_netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:133:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: throw: if ‘mit_samba_check_client_access’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: danger: ‘netbios_name’ leaks here; was allocated at [(16)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/15)
#  136|   	}
#  137|   
#  138|-> 	code = mit_samba_check_client_access(mit_ctx,
#  139|   					     client,
#  140|   					     client_name,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1356]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:152:21: warning[-Wanalyzer-malloc-leak]: leak of ‘netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:77:17: enter_function: entry to ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:98:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:103:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:105:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:122:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:126:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: branch_true: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: call_function: calling ‘ks_get_netbios_name’ from ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: return_function: returning to ‘kdb_samba_db_check_policy_as’ from ‘ks_get_netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:133:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:147:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:152:21: throw: if ‘smb_krb5_data_from_blob’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:152:21: danger: ‘netbios_name’ leaks here; was allocated at [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15)
#  150|   		int code_tmp;
#  151|   
#  152|-> 		d = smb_krb5_data_from_blob(int_data);
#  153|   
#  154|   		code_tmp = decode_krb5_padata_sequence(&d, &e_data);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1357]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:154:28: warning[-Wanalyzer-malloc-leak]: leak of ‘netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:77:17: enter_function: entry to ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:98:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:103:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:105:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:122:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:126:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:127:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:131:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: branch_true: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: call_function: calling ‘ks_get_netbios_name’ from ‘kdb_samba_db_check_policy_as’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:132:24: return_function: returning to ‘kdb_samba_db_check_policy_as’ from ‘ks_get_netbios_name’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:133:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:138:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:147:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:154:28: throw: if ‘decode_krb5_padata_sequence’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_policies.c:154:28: danger: ‘netbios_name’ leaks here; was allocated at [(16)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/15)
#  152|   		d = smb_krb5_data_from_blob(int_data);
#  153|   
#  154|-> 		code_tmp = decode_krb5_padata_sequence(&d, &e_data);
#  155|   		if (code_tmp == 0) {
#  156|   			*e_data_out = e_data;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1358]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:146:24: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:136:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:137:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:141:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:145:12: branch_true: following ‘true’ branch (when ‘princ’ is NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:146:24: branch_true: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:146:24: throw: if ‘krb5_parse_name’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:146:24: danger: ‘kentry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  144|   
#  145|   	if (princ == NULL) {
#  146|-> 		code = krb5_parse_name(context, KRB5_KDB_M_NAME, &kentry->princ);
#  147|   	} else {
#  148|   		code = krb5_copy_principal(context, princ, &kentry->princ);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1359]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:148:24: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:136:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:137:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:141:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:145:12: branch_false: following ‘false’ branch (when ‘princ’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:148:24: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:148:24: throw: if ‘krb5_copy_principal’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:148:24: danger: ‘kentry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  146|   		code = krb5_parse_name(context, KRB5_KDB_M_NAME, &kentry->princ);
#  147|   	} else {
#  148|-> 		code = krb5_copy_principal(context, princ, &kentry->princ);
#  149|   	}
#  150|   	if (code != 0) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1360]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:173:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 32)’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:137:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:141:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:150:12: branch_false: following ‘false’ branch (when ‘code == 0’)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:155:15: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:158:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:164:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:165:28: acquire_memory: this call could return NULL
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:173:9: danger: ‘calloc(1, 32)’ could be NULL: unchecked value from [(7)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/6)
#  171|   	key_data = &kentry->key_data[0];
#  172|   
#  173|-> 	key_data->key_data_ver          = KRB5_KDB_V1_KEY_DATA_ARRAY;
#  174|   	key_data->key_data_kvno         = 1;
#  175|   	key_data->key_data_type[0]      = ENCTYPE_UNKNOWN;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1361]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:225:16: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:203:12: branch_false: following ‘false’ branch (when ‘princ’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:207:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:209:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:210:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:214:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:217:12: branch_false: following ‘false’ branch (when ‘attributes <= 0’)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:221:12: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:221:12: branch_false: following ‘false’ branch (when ‘max_life <= 0’)...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:225:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:225:16: throw: if ‘krb5_copy_principal’ throws an exception...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:225:16: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  223|   	}
#  224|   
#  225|-> 	code = krb5_copy_principal(context, princ, &kentry->princ);
#  226|   	if (code != 0) {
#  227|   		krb5_db_free_principal(context, kentry);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1362]
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:273:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(1, 32)’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:303:17: enter_function: entry to ‘kdb_samba_db_get_principal’
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:312:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:316:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:316:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:324:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit-kdb/kdb_samba_principals.c:326:24: call_function: inlined call to ‘ks_get_admin_principal’ from ‘kdb_samba_db_get_principal’
#  271|   	key_data = &kentry->key_data[0];
#  272|   
#  273|-> 	key_data->key_data_ver          = KRB5_KDB_V1_KEY_DATA_ARRAY;
#  274|   	key_data->key_data_kvno         = 1;
#  275|   	key_data->key_data_type[0]      = key.enctype;

Error: COMPILER_WARNING (CWE-477): [#def1363]
samba-4.23.4/source4/kdc/mit_samba.c: scope_hint: In function ‘mit_samba_context_init’
samba-4.23.4/source4/kdc/mit_samba.c:94:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#   94 |         tevent_loop_allow_nesting(base_ctx.ev_ctx);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/bin/default/include/public/ldb.h:51: included_from: Included from here.
samba-4.23.4/source4/dsdb/samdb/samdb.h:56: included_from: Included from here.
samba-4.23.4/source4/kdc/mit_samba.c:26: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#   92|   		goto done;
#   93|   	}
#   94|-> 	tevent_loop_allow_nesting(base_ctx.ev_ctx);
#   95|   	base_ctx.lp_ctx = loadparm_init_global(false);
#   96|   	if (!base_ctx.lp_ctx) {

Error: COMPILER_WARNING (CWE-477): [#def1364]
samba-4.23.4/source4/kdc/mit_samba.c:94:9: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#   92|   		goto done;
#   93|   	}
#   94|-> 	tevent_loop_allow_nesting(base_ctx.ev_ctx);
#   95|   	base_ctx.lp_ctx = loadparm_init_global(false);
#   96|   	if (!base_ctx.lp_ctx) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1365]
samba-4.23.4/source4/kdc/mit_samba.c:195:16: warning[-Wanalyzer-malloc-leak]: leak of ‘data’
samba-4.23.4/source4/kdc/mit_samba.c:172:12: branch_false: following ‘false’ branch (when ‘pwd’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:176:19: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:179:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:183:20: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:184:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:189:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:189:16: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:191:12: branch_false: following ‘false’ branch (when ‘data’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:195:16: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:195:16: throw: if ‘smb_krb5_make_data’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:195:16: danger: ‘data’ leaks here; was allocated at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  193|   	}
#  194|   
#  195|-> 	*pwd = smb_krb5_make_data(data, length);
#  196|   
#  197|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1366]
samba-4.23.4/source4/kdc/mit_samba.c:239:29: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:235:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:239:29: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:239:29: throw: if ‘smb_krb5_principal_is_tgs’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:239:29: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  237|   		sflags |= SDB_F_FOR_AS_REQ;
#  238|   	} else {
#  239|-> 		int equal = smb_krb5_principal_is_tgs(ctx->context, principal);
#  240|   		if (equal == -1) {
#  241|   			return ENOMEM;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1367]
samba-4.23.4/source4/kdc/mit_samba.c:258:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:258:15: throw: if ‘samba_kdc_fetch’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:258:15: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  256|   
#  257|   fetch_referral_principal:
#  258|-> 	ret = samba_kdc_fetch(ctx->context, ctx->db_ctx,
#  259|   			      principal, sflags, 0, &sentry);
#  260|   	switch (ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1368]
samba-4.23.4/source4/kdc/mit_samba.c:268:41: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:268:41: throw: if ‘lpcfg_realm’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:268:41: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  266|   	case SDB_ERR_WRONG_REALM: {
#  267|   		char *dest_realm = NULL;
#  268|-> 		const char *our_realm = lpcfg_realm(ctx->db_ctx->lp_ctx);
#  269|   
#  270|   		if (sflags & SDB_F_FOR_AS_REQ) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1369]
samba-4.23.4/source4/kdc/mit_samba.c:280:25: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:240:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:244:20: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:270:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:279:21: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:279:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:311:44: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:313:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:318:23: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:325:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:329:17: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:270:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:279:21: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:280:25: throw: if ‘sdb_entry_free’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:280:25: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2)
#  278|   
#  279|   		if (referral_principal != NULL) {
#  280|-> 			sdb_entry_free(&sentry);
#  281|   			ret = KRB5_KDB_NOENTRY;
#  282|   			goto done;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1370]
samba-4.23.4/source4/kdc/mit_samba.c:310:30: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:240:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:244:20: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:270:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:279:21: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:279:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:311:44: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:310:30: throw: if ‘smb_krb5_principal_get_realm’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:310:30: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  308|   		 * principal and return success.
#  309|   		 */
#  310|-> 		dest_realm = smb_krb5_principal_get_realm(
#  311|   			ctx, ctx->context, sentry.principal);
#  312|   		sdb_entry_free(&sentry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1371]
samba-4.23.4/source4/kdc/mit_samba.c:312:17: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:240:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:244:20: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:270:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:279:21: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:279:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:311:44: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:312:17: throw: if ‘sdb_entry_free’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:312:17: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  310|   		dest_realm = smb_krb5_principal_get_realm(
#  311|   			ctx, ctx->context, sentry.principal);
#  312|-> 		sdb_entry_free(&sentry);
#  313|   		if (dest_realm == NULL) {
#  314|   			ret = KRB5_KDB_NOENTRY;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1372]
samba-4.23.4/source4/kdc/mit_samba.c:318:23: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:240:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:244:20: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:270:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:279:21: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:279:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:311:44: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:313:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:318:23: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:318:23: throw: if ‘smb_krb5_make_principal’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:318:23: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  316|   		}
#  317|   
#  318|-> 		ret = smb_krb5_make_principal(ctx->context,
#  319|   					      &referral_principal,
#  320|   					      our_realm,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1373]
samba-4.23.4/source4/kdc/mit_samba.c:338:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:338:15: throw: if ‘sdb_entry_to_krb5_db_entry’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:338:15: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  336|   	}
#  337|   
#  338|-> 	ret = sdb_entry_to_krb5_db_entry(ctx->context, &sentry, kentry);
#  339|   
#  340|   	sdb_entry_free(&sentry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1374]
samba-4.23.4/source4/kdc/mit_samba.c:343:9: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:343:9: throw: if ‘krb5_free_principal’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:343:9: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/2)
#  341|   
#  342|   done:
#  343|-> 	krb5_free_principal(ctx->context, referral_principal);
#  344|   	referral_principal = NULL;
#  345|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1375]
samba-4.23.4/source4/kdc/mit_samba.c:352:1: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:214:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:218:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:220:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:221:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:231:13: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:235:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:239:29: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:240:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:215:24: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:352:1: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/2)
#  350|   	}
#  351|   	return ret;
#  352|-> }
#  353|   
#  354|   krb5_error_code mit_samba_get_firstkey(struct mit_samba_context *ctx,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1376]
samba-4.23.4/source4/kdc/mit_samba.c:376:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:365:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:369:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:371:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:372:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:376:15: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:376:15: throw: if ‘samba_kdc_firstkey’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:376:15: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/2)
#  374|   	}
#  375|   
#  376|-> 	ret = samba_kdc_firstkey(ctx->context, ctx->db_ctx, SDB_F_ADMIN_DATA, &sentry);
#  377|   	switch (ret) {
#  378|   	case 0:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1377]
samba-4.23.4/source4/kdc/mit_samba.c:390:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:365:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:369:10: branch_true: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:371:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:372:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:376:15: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:390:15: throw: if ‘sdb_entry_to_krb5_db_entry’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:390:15: danger: ‘kentry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/2)
#  388|   	}
#  389|   
#  390|-> 	ret = sdb_entry_to_krb5_db_entry(ctx->context, &sentry, kentry);
#  391|   
#  392|   	sdb_entry_free(&sentry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1378]
samba-4.23.4/source4/kdc/mit_samba.c:416:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:411:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:412:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:416:15: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:416:15: throw: if ‘samba_kdc_nextkey’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:416:15: danger: ‘kentry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/0)
#  414|   	}
#  415|   
#  416|-> 	ret = samba_kdc_nextkey(ctx->context, ctx->db_ctx, SDB_F_ADMIN_DATA, &sentry);
#  417|   	switch (ret) {
#  418|   	case 0:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1379]
samba-4.23.4/source4/kdc/mit_samba.c:430:15: warning[-Wanalyzer-malloc-leak]: leak of ‘kentry’
samba-4.23.4/source4/kdc/mit_samba.c:411:18: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:412:12: branch_false: following ‘false’ branch (when ‘kentry’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:416:15: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:430:15: throw: if ‘sdb_entry_to_krb5_db_entry’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:430:15: danger: ‘kentry’ leaks here; was allocated at [(1)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/0)
#  428|   	}
#  429|   
#  430|-> 	ret = sdb_entry_to_krb5_db_entry(ctx->context, &sentry, kentry);
#  431|   
#  432|   	sdb_entry_free(&sentry);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1380]
samba-4.23.4/source4/kdc/mit_samba.c:664:15: warning[-Wanalyzer-malloc-leak]: leak of ‘pa.contents’
samba-4.23.4/source4/kdc/mit_samba.c:643:12: branch_false: following ‘false’ branch (when ‘e_data’ is non-NULL)...
samba-4.23.4/source4/kdc/mit_samba.c:646:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:652:35: acquire_memory: allocated here
samba-4.23.4/source4/kdc/mit_samba.c:653:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/kdc/mit_samba.c:657:9: branch_false: ...to here
samba-4.23.4/source4/kdc/mit_samba.c:664:15: throw: if ‘encode_krb5_padata_sequence’ throws an exception...
samba-4.23.4/source4/kdc/mit_samba.c:664:15: danger: ‘pa.contents’ leaks here; was allocated at [(3)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/2)
#  662|   	ppa[1] = NULL;
#  663|   
#  664|-> 	ret = encode_krb5_padata_sequence(ppa, &d);
#  665|   	free(pa.contents);
#  666|   	if (ret) {

Error: COMPILER_WARNING (CWE-477): [#def1381]
samba-4.23.4/source4/lib/events/tevent_s4.c: scope_hint: In function ‘s4_event_context_init’
samba-4.23.4/source4/lib/events/tevent_s4.c:37:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#   37 |                 tevent_loop_allow_nesting(ev);
#      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source4/lib/events/events.h:3: included_from: Included from here.
samba-4.23.4/source4/lib/events/tevent_s4.c:21: included_from: Included from here.
/usr/include/tevent.h:2712:6: note: declared here
# 2712 | void tevent_loop_allow_nesting(struct tevent_context *ev) _DEPRECATED_;
#      |      ^~~~~~~~~~~~~~~~~~~~~~~~~
#   35|   	if (ev) {
#   36|   		samba_tevent_set_debug(ev, "s4_tevent");
#   37|-> 		tevent_loop_allow_nesting(ev);
#   38|   	}
#   39|   	return ev;

Error: COMPILER_WARNING (CWE-477): [#def1382]
samba-4.23.4/source4/lib/events/tevent_s4.c:37:17: warning[-Wdeprecated-declarations]: ‘tevent_loop_allow_nesting’ is deprecated
#   35|   	if (ev) {
#   36|   		samba_tevent_set_debug(ev, "s4_tevent");
#   37|-> 		tevent_loop_allow_nesting(ev);
#   38|   	}
#   39|   	return ev;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1383]
samba-4.23.4/source4/lib/messaging/messaging.c:126:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/lib/messaging/messaging.c:115:12: branch_false: following ‘false’ branch (when ‘num_fds == 1’)...
samba-4.23.4/source4/lib/messaging/messaging.c:120:13: branch_false: ...to here
samba-4.23.4/source4/lib/messaging/messaging.c:120:13: acquire_memory: allocated here
samba-4.23.4/source4/lib/messaging/messaging.c:121:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/lib/messaging/messaging.c:126:9: branch_false: ...to here
samba-4.23.4/source4/lib/messaging/messaging.c:126:9: throw: if ‘talloc_full_report_printf’ throws an exception...
samba-4.23.4/source4/lib/messaging/messaging.c:126:9: danger: ‘f’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  124|   	}
#  125|   
#  126|-> 	talloc_full_report_printf(NULL, f);
#  127|   	fclose(f);
#  128|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1384]
samba-4.23.4/source4/lib/policy/gp_filesys.c:438:26: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(local_path)’
samba-4.23.4/source4/lib/policy/gp_filesys.c:432:15: acquire_memory: allocated here
samba-4.23.4/source4/lib/policy/gp_filesys.c:433:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/policy/gp_filesys.c:433:12: branch_false: ...to here
samba-4.23.4/source4/lib/policy/gp_filesys.c:438:26: throw: if ‘readdir’ throws an exception...
samba-4.23.4/source4/lib/policy/gp_filesys.c:438:26: danger: ‘opendir(local_path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  436|   	}
#  437|   
#  438|-> 	while ((dirent = readdir(dir)) != NULL) {
#  439|   		if (ISDOT(dirent->d_name) || ISDOTDOT(dirent->d_name)) {
#  440|   			continue;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1385]
samba-4.23.4/source4/lib/policy/gp_filesys.c:502:41: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(talloc_asprintf(gp_ctx, "%s/%s",  local_path, &*<unknown>.d_name), 0)’
samba-4.23.4/source4/lib/policy/gp_filesys.c:550:10: enter_function: entry to ‘gp_push_gpt’
samba-4.23.4/source4/lib/policy/gp_filesys.c:569:18: call_function: calling ‘push_recursive’ from ‘gp_push_gpt’
#  500|   			while ((nread = read(local_fd, buf, sizeof(buf)))) {
#  501|   				if (nread == -1) {
#  502|-> 					DBG_ERR("read failed with errno %s\n",
#  503|   						strerror(errno));
#  504|   					status = NT_STATUS_UNSUCCESSFUL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1386]
samba-4.23.4/source4/lib/policy/gp_filesys.c:507:42: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(talloc_asprintf(gp_ctx, "%s/%s",  local_path, &*<unknown>.d_name), 0)’
samba-4.23.4/source4/lib/policy/gp_filesys.c:550:10: enter_function: entry to ‘gp_push_gpt’
samba-4.23.4/source4/lib/policy/gp_filesys.c:569:18: call_function: calling ‘push_recursive’ from ‘gp_push_gpt’
#  505|   					goto done;
#  506|   				}
#  507|-> 				nwrite = smbcli_write(gp_ctx->cli->tree,
#  508|   						      remote_fd, 0, buf,
#  509|   						      total_read, nread);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1387]
samba-4.23.4/source4/lib/policy/gp_filesys.c:523:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(talloc_asprintf(gp_ctx, "%s/%s",  local_path, &*<unknown>.d_name), 0)’
samba-4.23.4/source4/lib/policy/gp_filesys.c:550:10: enter_function: entry to ‘gp_push_gpt’
samba-4.23.4/source4/lib/policy/gp_filesys.c:569:18: call_function: calling ‘push_recursive’ from ‘gp_push_gpt’
#  521|   			}
#  522|   
#  523|-> 			close(local_fd);
#  524|   			local_fd = -1;
#  525|   			smbcli_close(gp_ctx->cli->tree, remote_fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1388]
samba-4.23.4/source4/lib/policy/gp_filesys.c:535:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘<unknown>’
samba-4.23.4/source4/lib/policy/gp_filesys.c:550:10: enter_function: entry to ‘gp_push_gpt’
samba-4.23.4/source4/lib/policy/gp_filesys.c:569:18: call_function: calling ‘push_recursive’ from ‘gp_push_gpt’
#  533|   done:
#  534|   	if (local_fd != -1) {
#  535|-> 		close(local_fd);
#  536|   	}
#  537|   	if (remote_fd != -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1389]
samba-4.23.4/source4/lib/registry/hive.c:46:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(location, 2)’
samba-4.23.4/source4/lib/registry/hive.c:38:14: acquire_resource: opened here
samba-4.23.4/source4/lib/registry/hive.c:39:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/hive.c:45:15: branch_false: ...to here
samba-4.23.4/source4/lib/registry/hive.c:46:9: danger: ‘open(location, 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   44|   
#   45|   	num = read(fd, peek, 20);
#   46|-> 	close(fd);
#   47|   	if (num == -1) {
#   48|   		return WERR_FILE_NOT_FOUND;

Error: CPPCHECK_WARNING (CWE-457): [#def1390]
samba-4.23.4/source4/lib/registry/patchfile_preg.c:78: error[uninitvar]: Uninitialized variable: &buf
#   76|   	preg_write_utf16(data->fd, ";");
#   77|   	SIVAL(&buf, 0, value_type);
#   78|-> 	sys_write_v(data->fd, &buf, sizeof(uint32_t));
#   79|   	preg_write_utf16(data->fd, ";");
#   80|   	SIVAL(&buf, 0, value_data.length);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1391]
samba-4.23.4/source4/lib/registry/regf.c:1662:37: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source4/lib/registry/regf.c:1640:15: enter_function: entry to ‘regf_del_value’
samba-4.23.4/source4/lib/registry/regf.c:1652:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/regf.c:1656:18: branch_false: ...to here
samba-4.23.4/source4/lib/registry/regf.c:1656:18: call_function: calling ‘hbin_get’ from ‘regf_del_value’
samba-4.23.4/source4/lib/registry/regf.c:1656:18: return_function: returning to ‘regf_del_value’ from ‘hbin_get’
samba-4.23.4/source4/lib/registry/regf.c:1658:21: branch_true: following ‘true’ branch...
samba-4.23.4/source4/lib/registry/regf.c:1659:20: branch_true: ...to here
samba-4.23.4/source4/lib/registry/regf.c:1659:20: branch_false: following ‘false’ branch (when ‘found_offset == 0’)...
samba-4.23.4/source4/lib/registry/regf.c:1662:37: branch_false: ...to here
samba-4.23.4/source4/lib/registry/regf.c:1662:37: danger: dereference of NULL ‘values.data + (sizetype)(i * 4)’
# 1660|   			((uint32_t *)values.data)[i-1] = ((uint32_t *) values.data)[i];
# 1661|   		} else {
# 1662|-> 			vk_offset = IVAL(values.data, i * 4);
# 1663|   			if (!hbin_get_tdr(regf, vk_offset, private_data,
# 1664|   					  (tdr_pull_fn_t)tdr_pull_vk_block,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1392]
samba-4.23.4/source4/lib/registry/regf.c:1885:41: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
samba-4.23.4/source4/lib/registry/regf.c:1867:15: enter_function: entry to ‘regf_set_value’
samba-4.23.4/source4/lib/registry/regf.c:1881:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/lib/registry/regf.c:1882:26: branch_true: ...to here
samba-4.23.4/source4/lib/registry/regf.c:1882:26: call_function: calling ‘hbin_get’ from ‘regf_set_value’
samba-4.23.4/source4/lib/registry/regf.c:1882:26: return_function: returning to ‘regf_set_value’ from ‘hbin_get’
samba-4.23.4/source4/lib/registry/regf.c:1884:29: branch_true: following ‘true’ branch...
samba-4.23.4/source4/lib/registry/regf.c:1885:41: branch_true: ...to here
samba-4.23.4/source4/lib/registry/regf.c:1885:41: danger: dereference of NULL ‘values.data + (sizetype)(i * 4)’
# 1883|   
# 1884|   		for (i = 0; i < nk->num_values; i++) {
# 1885|-> 			tmp_vk_offset = IVAL(values.data, i * 4);
# 1886|   			if (!hbin_get_tdr(regf, tmp_vk_offset, private_data,
# 1887|   					  (tdr_pull_fn_t)tdr_pull_vk_block,

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1393]
samba-4.23.4/source4/lib/registry/regf.c:2220:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor
samba-4.23.4/source4/lib/registry/regf.c:2204:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/regf.c:2206:9: branch_false: ...to here
samba-4.23.4/source4/lib/registry/regf.c:2211:20: acquire_resource: opened here
samba-4.23.4/source4/lib/registry/regf.c:2213:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/regf.c:2220:16: branch_false: ...to here
samba-4.23.4/source4/lib/registry/regf.c:2220:16: throw: if ‘tdr_pull_init’ throws an exception...
samba-4.23.4/source4/lib/registry/regf.c:2220:16: danger: leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
# 2218|   	}
# 2219|   
# 2220|-> 	pull = tdr_pull_init(regf);
# 2221|   
# 2222|   	pull->data.data = (uint8_t*)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1394]
samba-4.23.4/source4/lib/registry/tools/regshell.c:459:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
samba-4.23.4/source4/lib/registry/tools/regshell.c:433:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:434:9: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:437:18: branch_true: following ‘true’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:440:28: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:442:28: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:442:28: branch_true: following ‘true’ branch (when ‘count == 1’)...
samba-4.23.4/source4/lib/registry/tools/regshell.c:443:43: branch_true: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:437:18: branch_true: following ‘true’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:439:42: acquire_memory: allocated here
samba-4.23.4/source4/lib/registry/tools/regshell.c:440:28: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:442:28: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:442:28: branch_false: following ‘false’ branch (when ‘count != 1’)...
samba-4.23.4/source4/lib/registry/tools/regshell.c:442:28: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:459:17: danger: ‘<unknown>’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  457|   		break;
#  458|   	default:
#  459|-> 		matches[0] = strndup(matches[1], samelen);
#  460|   	}
#  461|   	matches[count] = NULL;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1395]
samba-4.23.4/source4/lib/registry/tools/regshell.c:503:48: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘strdup(subkeyname)’ where non-null expected
samba-4.23.4/source4/lib/registry/tools/regshell.c:485:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/registry/tools/regshell.c:486:9: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:492:20: branch_true: following ‘true’ branch (when ‘j != 99’)...
samba-4.23.4/source4/lib/registry/tools/regshell.c:493:26: branch_true: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:495:19: branch_true: following ‘true’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/lib/registry/tools/regshell.c:496:29: branch_true: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:497:46: acquire_memory: this call could return NULL
samba-4.23.4/source4/lib/registry/tools/regshell.c:500:36: branch_false: following ‘false’ branch (when ‘j != 1’)...
samba-4.23.4/source4/lib/registry/tools/regshell.c:500:36: branch_false: ...to here
samba-4.23.4/source4/lib/registry/tools/regshell.c:503:48: danger: argument 2 (‘strdup(subkeyname)’) from [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6) could be NULL where non-null expected
#  501|   					samelen = strlen(matches[j]);
#  502|   				else
#  503|-> 					while (strncmp(matches[j], matches[j-1], samelen) != 0)
#  504|   						samelen--;
#  505|   			}

Error: COMPILER_WARNING (CWE-704): [#def1396]
samba-4.23.4/source4/lib/registry/util.c: scope_hint: In function ‘reg_strhex_to_data_blob’
samba-4.23.4/source4/lib/registry/util.c:98:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   98 |                 hi = strchr(HEXCHARS, toupper(str[i]));
#      |                    ^
#   96|   	j = 0;
#   97|   	for (i = 0; i < strlen(str); i++) {
#   98|-> 		hi = strchr(HEXCHARS, toupper(str[i]));
#   99|   		if (hi == NULL)
#  100|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def1397]
samba-4.23.4/source4/lib/registry/util.c:98:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   96|   	j = 0;
#   97|   	for (i = 0; i < strlen(str); i++) {
#   98|-> 		hi = strchr(HEXCHARS, toupper(str[i]));
#   99|   		if (hi == NULL)
#  100|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def1398]
samba-4.23.4/source4/lib/registry/util.c:103:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  103 |                 lo = strchr(HEXCHARS, toupper(str[i]));
#      |                    ^
#  101|   
#  102|   		i++;
#  103|-> 		lo = strchr(HEXCHARS, toupper(str[i]));
#  104|   		if (lo == NULL)
#  105|   			break;

Error: COMPILER_WARNING (CWE-704): [#def1399]
samba-4.23.4/source4/lib/registry/util.c:103:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  101|   
#  102|   		i++;
#  103|-> 		lo = strchr(HEXCHARS, toupper(str[i]));
#  104|   		if (lo == NULL)
#  105|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1400]
samba-4.23.4/source4/lib/socket/socket.c:459:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/source4/lib/socket/socket.c:452:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/lib/socket/socket.c:455:14: branch_false: ...to here
samba-4.23.4/source4/lib/socket/socket.c:455:14: acquire_resource: opened here
samba-4.23.4/source4/lib/socket/socket.c:456:12: branch_false: following ‘false’ branch (when ‘fd != -1’)...
samba-4.23.4/source4/lib/socket/socket.c:459:9: branch_false: ...to here
samba-4.23.4/source4/lib/socket/socket.c:459:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source4/lib/socket/socket.c:459:9: danger: ‘fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  457|   		return map_nt_error_from_unix_common(errno);
#  458|   	}
#  459|-> 	close(sock->fd);
#  460|   	sock->fd = fd;
#  461|   	return NT_STATUS_OK;

Error: CPPCHECK_WARNING (CWE-476): [#def1401]
samba-4.23.4/source4/libcli/clideltree.c:43: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: n
#   41|   
#   42|   	n = strdup(name);
#   43|-> 	n[strlen(n)-1] = 0;
#   44|   	if (asprintf(&s, "%s%s", n, finfo->name) < 0) {
#   45|   		free(n);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1402]
samba-4.23.4/source4/libcli/clideltree.c:43:11: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘n’ where non-null expected
samba-4.23.4/source4/libcli/clideltree.c:42:13: acquire_memory: this call could return NULL
samba-4.23.4/source4/libcli/clideltree.c:43:11: danger: argument 1 (‘n’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#   41|   
#   42|   	n = strdup(name);
#   43|-> 	n[strlen(n)-1] = 0;
#   44|   	if (asprintf(&s, "%s%s", n, finfo->name) < 0) {
#   45|   		free(n);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1403]
samba-4.23.4/source4/libcli/clifile.c:698:9: warning[-Wanalyzer-malloc-leak]: leak of ‘path2’
samba-4.23.4/source4/libcli/clifile.c:697:17: acquire_memory: allocated here
samba-4.23.4/source4/libcli/clifile.c:698:9: throw: if ‘trim_string’ throws an exception...
samba-4.23.4/source4/libcli/clifile.c:698:9: danger: ‘path2’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  696|   
#  697|   	path2 = strdup(path);
#  698|-> 	trim_string(path2,NULL,"\\");
#  699|   	if (!*path2) {
#  700|   		free(path2);

Error: CPPCHECK_WARNING (CWE-476): [#def1404]
samba-4.23.4/source4/libcli/clifile.c:699: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: path2
#  697|   	path2 = strdup(path);
#  698|   	trim_string(path2,NULL,"\\");
#  699|-> 	if (!*path2) {
#  700|   		free(path2);
#  701|   		path2 = strdup("\\");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1405]
samba-4.23.4/source4/libcli/clifile.c:706:18: warning[-Wanalyzer-malloc-leak]: leak of ‘path2’
samba-4.23.4/source4/libcli/clifile.c:697:17: acquire_memory: allocated here
samba-4.23.4/source4/libcli/clifile.c:699:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/libcli/clifile.c:700:17: branch_true: ...to here
samba-4.23.4/source4/libcli/clifile.c:701:25: acquire_memory: allocated here
samba-4.23.4/source4/libcli/clifile.c:706:18: throw: if ‘smb_raw_chkpath’ throws an exception...
samba-4.23.4/source4/libcli/clifile.c:706:18: danger: ‘path2’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  704|   	parms.chkpath.in.path = path2;
#  705|   
#  706|-> 	status = smb_raw_chkpath(tree, &parms);
#  707|   
#  708|   	free(path2);

Error: CPPCHECK_WARNING (CWE-457): [#def1406]
samba-4.23.4/source4/libcli/clilist.c:168: warning[uninitvar]: Uninitialized variable: state.last_name
#  166|   			next_parms.t2fnext.data_level = state.data_level;
#  167|   			next_parms.t2fnext.in.max_count = max_matches;
#  168|-> 			next_parms.t2fnext.in.last_name = state.last_name;
#  169|   			next_parms.t2fnext.in.handle = ff_dir_handle;
#  170|   			next_parms.t2fnext.in.resume_key = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1407]
samba-4.23.4/source4/libcli/raw/rawreadwrite.c:158:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘req’
samba-4.23.4/source4/libcli/raw/rawreadwrite.c:197:19: enter_function: entry to ‘smb_raw_read’
samba-4.23.4/source4/libcli/raw/rawreadwrite.c:200:16: call_function: calling ‘smb_raw_read_recv’ from ‘smb_raw_read’
#  156|   		parms->readx.out.compaction_mode = SVAL(req->in.vwv, VWV(3));
#  157|   		parms->readx.out.nread = SVAL(req->in.vwv, VWV(5));
#  158|-> 		parms->readx.out.flags2 = req->flags2;
#  159|   		parms->readx.out.data_offset = SVAL(req->in.vwv, VWV(6));
#  160|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1408]
samba-4.23.4/source4/libcli/resolve/resolve.c:254:50: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘addrs’
samba-4.23.4/source4/libcli/resolve/resolve.c:244:10: enter_function: entry to ‘resolve_name_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:249:33: release_memory: ‘addrs’ is NULL
samba-4.23.4/source4/libcli/resolve/resolve.c:251:18: call_function: calling ‘resolve_name_all_recv’ from ‘resolve_name_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:251:18: return_function: returning to ‘resolve_name_recv’ from ‘resolve_name_all_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:253:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/libcli/resolve/resolve.c:254:50: branch_true: ...to here
samba-4.23.4/source4/libcli/resolve/resolve.c:254:50: release_memory: ‘addrs’ is NULL
samba-4.23.4/source4/libcli/resolve/resolve.c:254:50: danger: dereference of NULL ‘addrs’
#  252|   
#  253|   	if (NT_STATUS_IS_OK(status)) {
#  254|-> 		struct tsocket_address *t_addr = socket_address_to_tsocket_address(addrs, addrs[0]);
#  255|   		if (!t_addr) {
#  256|   			return NT_STATUS_NO_MEMORY;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1409]
samba-4.23.4/source4/libcli/resolve/resolve.c:284:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘addrs’
samba-4.23.4/source4/libcli/resolve/resolve.c:272:10: enter_function: entry to ‘resolve_name_multiple_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:277:33: release_memory: ‘addrs’ is NULL
samba-4.23.4/source4/libcli/resolve/resolve.c:280:18: call_function: calling ‘resolve_name_all_recv’ from ‘resolve_name_multiple_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:280:18: return_function: returning to ‘resolve_name_multiple_recv’ from ‘resolve_name_all_recv’
samba-4.23.4/source4/libcli/resolve/resolve.c:281:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/libcli/resolve/resolve.c:281:9: branch_false: ...to here
samba-4.23.4/source4/libcli/resolve/resolve.c:284:24: release_memory: ‘addrs’ is NULL
samba-4.23.4/source4/libcli/resolve/resolve.c:284:19: danger: dereference of NULL ‘addrs + (long unsigned int)i * 8’
#  282|   
#  283|   	/* count the addresses */
#  284|-> 	for (i=0; addrs[i]; i++) ;
#  285|   
#  286|   	*reply_addrs = talloc_array(mem_ctx, const char *, i+1);

Error: CPPCHECK_WARNING (CWE-457): [#def1410]
samba-4.23.4/source4/libcli/smb2/create.c:93: error[uninitvar]: Uninitialized variable: data
#   91|   		SBVAL(data, 0, io->in.alloc_size);
#   92|   		status = smb2_create_blob_add(req, &blobs,
#   93|-> 					      SMB2_CREATE_TAG_ALSI, data_blob_const(data, 8));
#   94|   		if (!NT_STATUS_IS_OK(status)) {
#   95|   			talloc_free(req);

Error: CPPCHECK_WARNING (CWE-457): [#def1411]
samba-4.23.4/source4/libcli/smb2/create.c:169: error[uninitvar]: Uninitialized variable: data
#  167|   		SBVAL(data, 0, io->in.timewarp);		
#  168|   		status = smb2_create_blob_add(req, &blobs,
#  169|-> 					      SMB2_CREATE_TAG_TWRP, data_blob_const(data, 8));
#  170|   		if (!NT_STATUS_IS_OK(status)) {
#  171|   			talloc_free(req);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1412]
samba-4.23.4/source4/libcli/smb_composite/appendacl.c:294:49: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
samba-4.23.4/source4/libcli/smb_composite/appendacl.c:306:10: enter_function: entry to ‘smb_composite_appendacl’
samba-4.23.4/source4/libcli/smb_composite/appendacl.c:311:16: call_function: calling ‘smb_composite_appendacl_recv’ from ‘smb_composite_appendacl’
#  292|   
#  293|   	if (NT_STATUS_IS_OK(status)) {
#  294|-> 		struct appendacl_state *state = talloc_get_type(c->private_data, struct appendacl_state);
#  295|   		state->io->out.sd = security_descriptor_copy (mem_ctx, state->io->out.sd);
#  296|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1413]
samba-4.23.4/source4/libcli/smb_composite/loadfile.c:274:48: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘c’
samba-4.23.4/source4/libcli/smb_composite/loadfile.c:286:10: enter_function: entry to ‘smb_composite_loadfile’
samba-4.23.4/source4/libcli/smb_composite/loadfile.c:291:16: call_function: calling ‘smb_composite_loadfile_recv’ from ‘smb_composite_loadfile’
#  272|   
#  273|   	if (NT_STATUS_IS_OK(status)) {
#  274|-> 		struct loadfile_state *state = talloc_get_type(c->private_data, struct loadfile_state);
#  275|   		talloc_steal(mem_ctx, state->io->out.data);
#  276|   	}

Error: COMPILER_WARNING (CWE-477): [#def1414]
samba-4.23.4/source4/librpc/rpc/dcerpc.c: scope_hint: In function ‘dcerpc_pipe_binding_handle’
samba-4.23.4/source4/librpc/rpc/dcerpc.c:747:9: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#  747 |         dcerpc_binding_handle_set_sync_ev(h, p->conn->event_ctx);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source4/librpc/rpc/dcerpc.h:33: included_from: Included from here.
samba-4.23.4/source4/librpc/rpc/dcerpc.c:30: included_from: Included from here.
samba-4.23.4/librpc/rpc/rpc_common.h:257:19: note: declared here
#  257 | _DEPRECATED_ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
#      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  745|   	hs->p = p;
#  746|   
#  747|-> 	dcerpc_binding_handle_set_sync_ev(h, p->conn->event_ctx);
#  748|   
#  749|   	return h;

Error: COMPILER_WARNING (CWE-477): [#def1415]
samba-4.23.4/source4/librpc/rpc/dcerpc.c:747:9: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#  745|   	hs->p = p;
#  746|   
#  747|-> 	dcerpc_binding_handle_set_sync_ev(h, p->conn->event_ctx);
#  748|   
#  749|   	return h;

Error: COMPILER_WARNING (CWE-477): [#def1416]
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c: scope_hint: In function ‘pyrpc_irpc_connect’
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:94:9: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#   94 |         dcerpc_binding_handle_set_sync_ev(*binding_handle, event_ctx);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source4/librpc/rpc/dcerpc.h:33: included_from: Included from here.
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:30: included_from: Included from here.
samba-4.23.4/librpc/rpc/rpc_common.h:257:19: note: declared here
#  257 | _DEPRECATED_ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
#      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   92|   	 * but as there's no top level event loop it's not that critical.
#   93|   	 */
#   94|-> 	dcerpc_binding_handle_set_sync_ev(*binding_handle, event_ctx);
#   95|   
#   96|   	return NT_STATUS_OK;

Error: COMPILER_WARNING (CWE-477): [#def1417]
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:94:9: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#   92|   	 * but as there's no top level event loop it's not that critical.
#   93|   	 */
#   94|-> 	dcerpc_binding_handle_set_sync_ev(*binding_handle, event_ctx);
#   95|   
#   96|   	return NT_STATUS_OK;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1418]
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:416:23: warning[-Wanalyzer-malloc-leak]: leak of ‘wb’
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:403:21: branch_true: following ‘true’ branch...
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:405:64: branch_true: ...to here
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:405:64: acquire_memory: allocated here
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:407:20: branch_false: following ‘false’ branch (when ‘wb’ is non-NULL)...
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:410:17: branch_false: ...to here
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:416:23: throw: if ‘PyDescr_NewWrapper’ throws an exception...
samba-4.23.4/source4/librpc/rpc/pyrpc_util.c:416:23: danger: ‘wb’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  414|   		wb->doc = discard_const_p(char, mds[i].doc);
#  415|   
#  416|-> 		ret = PyDescr_NewWrapper(ifacetype, wb, discard_const_p(void, &mds[i]));
#  417|   
#  418|   		PyDict_SetItemString(ifacetype->tp_dict, mds[i].name,

Error: COMPILER_WARNING (CWE-704): [#def1419]
samba-4.23.4/source4/nbt_server/wins/winsdb.c: scope_hint: In function ‘winsdb_addr_decode’
samba-4.23.4/source4/nbt_server/wins/winsdb.c:235:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  235 |         p = strchr(address, ';');
#      |           ^
#  233|   	address = (char *)val->data;
#  234|   
#  235|-> 	p = strchr(address, ';');
#  236|   	if (!p) {
#  237|   		/* support old entries, with only the address */

Error: COMPILER_WARNING (CWE-704): [#def1420]
samba-4.23.4/source4/nbt_server/wins/winsdb.c:235:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  233|   	address = (char *)val->data;
#  234|   
#  235|-> 	p = strchr(address, ';');
#  236|   	if (!p) {
#  237|   		/* support old entries, with only the address */

Error: COMPILER_WARNING (CWE-704): [#def1421]
samba-4.23.4/source4/nbt_server/wins/winsdb.c:261:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  261 |         p = strchr(wins_owner, ';');
#      |           ^
#  259|   	}
#  260|   	wins_owner = p + 10;
#  261|-> 	p = strchr(wins_owner, ';');
#  262|   	if (!p) {
#  263|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def1422]
samba-4.23.4/source4/nbt_server/wins/winsdb.c:261:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  259|   	}
#  260|   	wins_owner = p + 10;
#  261|-> 	p = strchr(wins_owner, ';');
#  262|   	if (!p) {
#  263|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def1423]
samba-4.23.4/source4/nbt_server/wins/winsdb.c:283:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  283 |         p = strchr(expire_time, ';');
#      |           ^
#  281|   
#  282|   	expire_time = p + 11;
#  283|-> 	p = strchr(expire_time, ';');
#  284|   	if (!p) {
#  285|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def1424]
samba-4.23.4/source4/nbt_server/wins/winsdb.c:283:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  281|   
#  282|   	expire_time = p + 11;
#  283|-> 	p = strchr(expire_time, ';');
#  284|   	if (!p) {
#  285|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1425]
samba-4.23.4/source4/param/pyparam.c:283:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:269:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:272:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:272:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:275:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:275:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:278:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:283:9: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:283:9: throw: if ‘lpcfg_numservices’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:283:9: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4)
#  281|   	}
#  282|   
#  283|-> 	lpcfg_dump(lp_ctx, f, show_defaults, lpcfg_numservices(lp_ctx));
#  284|   
#  285|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1426]
samba-4.23.4/source4/param/pyparam.c:283:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:269:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:272:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:272:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:275:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:275:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:278:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:283:9: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:283:9: throw: if ‘lpcfg_numservices’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:283:9: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  281|   	}
#  282|   
#  283|-> 	lpcfg_dump(lp_ctx, f, show_defaults, lpcfg_numservices(lp_ctx));
#  284|   
#  285|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1427]
samba-4.23.4/source4/param/pyparam.c:314:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:300:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:303:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:303:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:306:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:306:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:309:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:314:9: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:314:9: throw: if ‘lpcfg_dump_globals’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:314:9: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  312|   	}
#  313|   
#  314|-> 	lpcfg_dump_globals(lp_ctx, f, show_defaults);
#  315|   
#  316|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1428]
samba-4.23.4/source4/param/pyparam.c:314:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:300:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:303:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:303:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:306:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:306:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:309:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:314:9: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:314:9: throw: if ‘lpcfg_dump_globals’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:314:9: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  312|   	}
#  313|   
#  314|-> 	lpcfg_dump_globals(lp_ctx, f, show_defaults);
#  315|   
#  316|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1429]
samba-4.23.4/source4/param/pyparam.c:347:37: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:347:37: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:347:37: throw: if ‘strwicmp’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:347:37: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
#  345|   	}
#  346|   
#  347|-> 	if (section_name != NULL && strwicmp(section_name, GLOBAL_NAME) &&
#  348|   		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1430]
samba-4.23.4/source4/param/pyparam.c:347:37: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:347:37: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:347:37: throw: if ‘strwicmp’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:347:37: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  345|   	}
#  346|   
#  347|-> 	if (section_name != NULL && strwicmp(section_name, GLOBAL_NAME) &&
#  348|   		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1431]
samba-4.23.4/source4/param/pyparam.c:348:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:348:17: throw: if ‘strwicmp’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:348:17: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/4)
#  346|   
#  347|   	if (section_name != NULL && strwicmp(section_name, GLOBAL_NAME) &&
#  348|-> 		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */
#  350|   		service = lpcfg_service(lp_ctx, section_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1432]
samba-4.23.4/source4/param/pyparam.c:348:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:348:17: throw: if ‘strwicmp’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:348:17: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/4)
#  346|   
#  347|   	if (section_name != NULL && strwicmp(section_name, GLOBAL_NAME) &&
#  348|-> 		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */
#  350|   		service = lpcfg_service(lp_ctx, section_name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1433]
samba-4.23.4/source4/param/pyparam.c:350:27: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:350:27: throw: if ‘lpcfg_service’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:350:27: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4)
#  348|   		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */
#  350|-> 		service = lpcfg_service(lp_ctx, section_name);
#  351|   		if (service == NULL) {
#  352|   			PyErr_Format(PyExc_RuntimeError, "Unknown section %s", section_name);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1434]
samba-4.23.4/source4/param/pyparam.c:350:27: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:350:27: throw: if ‘lpcfg_service’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:350:27: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4)
#  348|   		strwicmp(section_name, GLOBAL_NAME2)) {
#  349|   		/* it's a share parameter */
#  350|-> 		service = lpcfg_service(lp_ctx, section_name);
#  351|   		if (service == NULL) {
#  352|   			PyErr_Format(PyExc_RuntimeError, "Unknown section %s", section_name);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1435]
samba-4.23.4/source4/param/pyparam.c:352:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:351:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:352:25: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:352:25: throw: if ‘PyErr_Format’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:352:25: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4)
#  350|   		service = lpcfg_service(lp_ctx, section_name);
#  351|   		if (service == NULL) {
#  352|-> 			PyErr_Format(PyExc_RuntimeError, "Unknown section %s", section_name);
#  353|   			return NULL;
#  354|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1436]
samba-4.23.4/source4/param/pyparam.c:352:25: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:351:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:352:25: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:352:25: throw: if ‘PyErr_Format’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:352:25: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4)
#  350|   		service = lpcfg_service(lp_ctx, section_name);
#  351|   		if (service == NULL) {
#  352|-> 			PyErr_Format(PyExc_RuntimeError, "Unknown section %s", section_name);
#  353|   			return NULL;
#  354|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1437]
samba-4.23.4/source4/param/pyparam.c:361:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:361:15: throw: if ‘lpcfg_dump_a_parameter’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:361:15: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/4)
#  359|   	}
#  360|   
#  361|-> 	ret = lpcfg_dump_a_parameter(lp_ctx, service, param_name, f);
#  362|   
#  363|   	if (!ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1438]
samba-4.23.4/source4/param/pyparam.c:361:15: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:361:15: throw: if ‘lpcfg_dump_a_parameter’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:361:15: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/4)
#  359|   	}
#  360|   
#  361|-> 	ret = lpcfg_dump_a_parameter(lp_ctx, service, param_name, f);
#  362|   
#  363|   	if (!ret) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1439]
samba-4.23.4/source4/param/pyparam.c:377:1: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:351:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:352:25: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:377:1: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/4)
#  375|   	Py_RETURN_NONE;
#  376|   
#  377|-> }
#  378|   
#  379|   static PyObject *py_lp_log_level(PyObject *self, PyObject *unused)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1440]
samba-4.23.4/source4/param/pyparam.c:377:1: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:334:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:337:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:337:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:340:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:340:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:343:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:347:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:347:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:351:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:352:25: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:377:1: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/4)
#  375|   	Py_RETURN_NONE;
#  376|   
#  377|-> }
#  378|   
#  379|   static PyObject *py_lp_log_level(PyObject *self, PyObject *unused)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1441]
samba-4.23.4/source4/param/pyparam.c:642:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:631:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:631:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:634:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:634:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:637:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:641:14: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:641:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:642:17: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:642:17: throw: if ‘PyErr_SetNone’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:642:17: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/4)
#  640|   
#  641|   	if (!PyObject_TypeCheck(py_default_service, &PyLoadparmService)) {
#  642|-> 		PyErr_SetNone(PyExc_TypeError);
#  643|   		if (f != stdout) {
#  644|   			fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1442]
samba-4.23.4/source4/param/pyparam.c:642:17: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:631:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:631:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:634:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:634:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:637:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:641:14: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:641:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/pyparam.c:642:17: branch_true: ...to here
samba-4.23.4/source4/param/pyparam.c:642:17: throw: if ‘PyErr_SetNone’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:642:17: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/4)
#  640|   
#  641|   	if (!PyObject_TypeCheck(py_default_service, &PyLoadparmService)) {
#  642|-> 		PyErr_SetNone(PyExc_TypeError);
#  643|   		if (f != stdout) {
#  644|   			fclose(f);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1443]
samba-4.23.4/source4/param/pyparam.c:651:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘f’
samba-4.23.4/source4/param/pyparam.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:631:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:631:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:634:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:634:21: acquire_resource: opened here
samba-4.23.4/source4/param/pyparam.c:637:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:641:14: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:641:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:649:27: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:651:9: throw: if ‘lpcfg_dump_one’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:651:9: danger: ‘f’ leaks here; was opened at [(5)](sarif:/runs/0/results/24/codeFlows/0/threadFlows/0/locations/4)
#  649|   	default_service = PyLoadparmService_AsLoadparmService(py_default_service);
#  650|   
#  651|-> 	lpcfg_dump_one(f, show_defaults, service, default_service);
#  652|   
#  653|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1444]
samba-4.23.4/source4/param/pyparam.c:651:9: warning[-Wanalyzer-malloc-leak]: leak of ‘f’
samba-4.23.4/source4/param/pyparam.c:628:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:631:13: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:631:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:634:21: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:634:21: acquire_memory: allocated here
samba-4.23.4/source4/param/pyparam.c:637:12: branch_false: following ‘false’ branch (when ‘f’ is non-NULL)...
samba-4.23.4/source4/param/pyparam.c:641:14: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:641:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/pyparam.c:649:27: branch_false: ...to here
samba-4.23.4/source4/param/pyparam.c:651:9: throw: if ‘lpcfg_dump_one’ throws an exception...
samba-4.23.4/source4/param/pyparam.c:651:9: danger: ‘f’ leaks here; was allocated at [(5)](sarif:/runs/0/results/25/codeFlows/0/threadFlows/0/locations/4)
#  649|   	default_service = PyLoadparmService_AsLoadparmService(py_default_service);
#  650|   
#  651|-> 	lpcfg_dump_one(f, show_defaults, service, default_service);
#  652|   
#  653|   	if (f != stdout) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1445]
samba-4.23.4/source4/param/share_classic.c:63:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘val’
samba-4.23.4/source4/param/share_classic.c:57:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/share_classic.c:58:24: branch_true: ...to here
samba-4.23.4/source4/param/share_classic.c:59:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/share_classic.c:62:23: branch_false: ...to here
samba-4.23.4/source4/param/share_classic.c:63:17: danger: dereference of NULL ‘val’
#   61|   		}
#   62|   		val = strchr(parm, ':');
#   63|-> 		*val = '\0';
#   64|   		val++;
#   65|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1446]
samba-4.23.4/source4/param/share_classic.c:121:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘val’
samba-4.23.4/source4/param/share_classic.c:115:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/share_classic.c:116:24: branch_true: ...to here
samba-4.23.4/source4/param/share_classic.c:117:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/share_classic.c:120:23: branch_false: ...to here
samba-4.23.4/source4/param/share_classic.c:121:17: danger: dereference of NULL ‘val’
#  119|   		}
#  120|   		val = strchr(parm, ':');
#  121|-> 		*val = '\0';
#  122|   		val++;
#  123|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1447]
samba-4.23.4/source4/param/share_classic.c:179:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘val’
samba-4.23.4/source4/param/share_classic.c:173:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/share_classic.c:174:24: branch_true: ...to here
samba-4.23.4/source4/param/share_classic.c:175:19: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/share_classic.c:178:23: branch_false: ...to here
samba-4.23.4/source4/param/share_classic.c:179:17: danger: dereference of NULL ‘val’
#  177|   		}
#  178|   		val = strchr(parm, ':');
#  179|-> 		*val = '\0';
#  180|   		val++;
#  181|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1448]
samba-4.23.4/source4/param/share_classic.c:277:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘val’
samba-4.23.4/source4/param/share_classic.c:271:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/param/share_classic.c:272:24: branch_true: ...to here
samba-4.23.4/source4/param/share_classic.c:273:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/param/share_classic.c:276:23: branch_false: ...to here
samba-4.23.4/source4/param/share_classic.c:277:17: danger: dereference of NULL ‘val’
#  275|   		}
#  276|   		val = strchr(parm, ':');
#  277|-> 		*val = '\0';
#  278|   		val++;
#  279|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def1449]
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:409:17: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:923:8: enter_function: entry to ‘dns_fill_records_array’
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:944:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:947:13: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:966:12: branch_false: following ‘false’ branch (when ‘msg’ is non-NULL)...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:971:13: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:971:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:975:15: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:976:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:982:14: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:983:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:988:19: branch_true: following ‘true’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:993:49: branch_true: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:995:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1001:20: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1028:28: branch_true: following ‘true’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1029:37: branch_true: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1029:36: branch_true: following ‘true’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1035:56: branch_true: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1039:36: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1043:65: branch_false: ...to here
samba-4.23.4/source4/rpc_server/dnsserver/dnsdata.c:1044:33: call_function: calling ‘dnsp_to_dns_copy’ from ‘dns_fill_records_array’
#  407|   
#  408|   	default:
#  409|-> 		memcpy(&dns->data, &dnsp->data, sizeof(union DNS_RPC_RECORD_DATA));
#  410|   		DEBUG(0, ("dnsserver: Found Unhandled DNS record type=%d\n", dnsp->wType));
#  411|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def1450]
samba-4.23.4/source4/rpc_server/drsuapi/getncchanges.c:2086: warning[uninitvar]: Uninitialized variable: source_guid.length
# 2084|   
# 2085|   		if (!NT_STATUS_IS_OK(status)
# 2086|-> 				|| source_guid.length != sizeof(guid_array[0].source_guid)) {
# 2087|   			DEBUG(0,(__location__ ": Bad la guid in sort\n"));
# 2088|   			TALLOC_FREE(frame);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1451]
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3138:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*r.out.result’
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3343:17: enter_function: entry to ‘dcesrv_lsa_RemovePrivilegesFromAccount’
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3351:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3357:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3358:13: branch_true: ...to here
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3357:13: branch_true: following ‘true’ branch...
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3362:33: branch_true: ...to here
samba-4.23.4/source4/rpc_server/lsa/dcesrv_lsa.c:3366:26: call_function: calling ‘dcesrv_lsa_EnumAccountRights’ from ‘dcesrv_lsa_RemovePrivilegesFromAccount’
# 3136|   	struct ldb_message_element *el;
# 3137|   
# 3138|-> 	DCESRV_PULL_HANDLE(h, r->in.handle, LSA_HANDLE_POLICY);
# 3139|   
# 3140|   	state = h->data;

Error: COMPILER_WARNING (CWE-704): [#def1452]
samba-4.23.4/source4/rpc_server/lsa/lsa_init.c: scope_hint: In function ‘dcesrv_lsa_get_policy_state’
samba-4.23.4/source4/rpc_server/lsa/lsa_init.c:126:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126 |         p = strchr(state->domain_dns, '/');
#      |           ^
#  124|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  125|   	}
#  126|-> 	p = strchr(state->domain_dns, '/');
#  127|   	if (p) {
#  128|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1453]
samba-4.23.4/source4/rpc_server/lsa/lsa_init.c:126:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  124|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  125|   	}
#  126|-> 	p = strchr(state->domain_dns, '/');
#  127|   	if (p) {
#  128|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1454]
samba-4.23.4/source4/rpc_server/lsa/lsa_init.c:135:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  135 |         p = strchr(state->forest_dns, '/');
#      |           ^
#  133|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  134|   	}
#  135|-> 	p = strchr(state->forest_dns, '/');
#  136|   	if (p) {
#  137|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1455]
samba-4.23.4/source4/rpc_server/lsa/lsa_init.c:135:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  133|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  134|   	}
#  135|-> 	p = strchr(state->forest_dns, '/');
#  136|   	if (p) {
#  137|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def1456]
samba-4.23.4/source4/rpc_server/lsa/lsa_lookup.c: scope_hint: In function ‘dcesrv_lsa_LookupNames_base_call’
samba-4.23.4/source4/rpc_server/lsa/lsa_lookup.c:999:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  999 |                 p = strchr(item->name, '\\');
#      |                   ^
#  997|   
#  998|   		item->hints.principal = item->name;
#  999|-> 		p = strchr(item->name, '\\');
# 1000|   		if (p != NULL && p != item->name) {
# 1001|   			item->hints.domain = talloc_strndup(state->items,

Error: COMPILER_WARNING (CWE-704): [#def1457]
samba-4.23.4/source4/rpc_server/lsa/lsa_lookup.c:999:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  997|   
#  998|   		item->hints.principal = item->name;
#  999|-> 		p = strchr(item->name, '\\');
# 1000|   		if (p != NULL && p != item->name) {
# 1001|   			item->hints.domain = talloc_strndup(state->items,

Error: COMPILER_WARNING (CWE-704): [#def1458]
samba-4.23.4/source4/rpc_server/lsa/lsa_lookup.c:1019:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1019 |                         p = strchr(item->name, '@');
#      |                           ^
# 1017|   		}
# 1018|   		if (item->hints.domain == NULL) {
# 1019|-> 			p = strchr(item->name, '@');
# 1020|   			if (p != NULL && p != item->name && p[1] != '\0') {
# 1021|   				item->hints.namespace = p + 1;

Error: COMPILER_WARNING (CWE-704): [#def1459]
samba-4.23.4/source4/rpc_server/lsa/lsa_lookup.c:1019:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1017|   		}
# 1018|   		if (item->hints.domain == NULL) {
# 1019|-> 			p = strchr(item->name, '@');
# 1020|   			if (p != NULL && p != item->name && p[1] != '\0') {
# 1021|   				item->hints.namespace = p + 1;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1460]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:966:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:966:24: danger: use of uninitialized value ‘dom_msgs’ here
#  964|   	switch (r->in.level) {
#  965|   	case 1:
#  966|-> 		return dcesrv_samr_info_DomInfo1(d_state, mem_ctx, dom_msgs,
#  967|   						 &info->info1);
#  968|   	case 2:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1461]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:969:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:969:24: danger: use of uninitialized value ‘dom_msgs’ here
#  967|   						 &info->info1);
#  968|   	case 2:
#  969|-> 		return dcesrv_samr_info_DomGeneralInformation(d_state, mem_ctx, dom_msgs,
#  970|   							      &info->general);
#  971|   	case 3:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1462]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:972:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:972:24: danger: use of uninitialized value ‘dom_msgs’ here
#  970|   							      &info->general);
#  971|   	case 3:
#  972|-> 		return dcesrv_samr_info_DomInfo3(d_state, mem_ctx, dom_msgs,
#  973|   						 &info->info3);
#  974|   	case 4:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1463]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:975:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:975:24: danger: use of uninitialized value ‘dom_msgs’ here
#  973|   						 &info->info3);
#  974|   	case 4:
#  975|-> 		return dcesrv_samr_info_DomOEMInformation(d_state, mem_ctx, dom_msgs,
#  976|   							  &info->oem);
#  977|   	case 5:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1464]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:981:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:981:24: danger: use of uninitialized value ‘dom_msgs’ here
#  979|   						 &info->info5);
#  980|   	case 6:
#  981|-> 		return dcesrv_samr_info_DomInfo6(d_state, mem_ctx, dom_msgs,
#  982|   						 &info->info6);
#  983|   	case 7:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1465]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:984:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:984:24: danger: use of uninitialized value ‘dom_msgs’ here
#  982|   						 &info->info6);
#  983|   	case 7:
#  984|-> 		return dcesrv_samr_info_DomInfo7(d_state, mem_ctx, dom_msgs,
#  985|   						 &info->info7);
#  986|   	case 8:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1466]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:987:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:987:24: danger: use of uninitialized value ‘dom_msgs’ here
#  985|   						 &info->info7);
#  986|   	case 8:
#  987|-> 		return dcesrv_samr_info_DomInfo8(d_state, mem_ctx, dom_msgs,
#  988|   						 &info->info8);
#  989|   	case 9:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1467]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:993:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:993:24: danger: use of uninitialized value ‘dom_msgs’ here
#  991|   						 &info->info9);
#  992|   	case 11:
#  993|-> 		return dcesrv_samr_info_DomGeneralInformation2(d_state, mem_ctx, dom_msgs,
#  994|   							       &info->general2);
#  995|   	case 12:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1468]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:996:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:996:24: danger: use of uninitialized value ‘dom_msgs’ here
#  994|   							       &info->general2);
#  995|   	case 12:
#  996|-> 		return dcesrv_samr_info_DomInfo12(d_state, mem_ctx, dom_msgs,
#  997|   						  &info->info12);
#  998|   	case 13:

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1469]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:999:24: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘dom_msgs’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:838:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:958:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:962:10: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:999:24: danger: use of uninitialized value ‘dom_msgs’ here
#  997|   						  &info->info12);
#  998|   	case 13:
#  999|-> 		return dcesrv_samr_info_DomInfo13(d_state, mem_ctx, dom_msgs,
# 1000|   						  &info->info13);
# 1001|   	default:

Error: CPPCHECK_WARNING (CWE-457): [#def1470]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:2099: warning[uninitvar]: Uninitialized variables: res.dn, res.num_elements, res.elements
# 2097|   		struct dom_sid *alias_sid;
# 2098|   
# 2099|-> 		alias_sid = samdb_result_dom_sid(mem_ctx, res[i], "objectSid");
# 2100|   		if (alias_sid == NULL) {
# 2101|   			return NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: CPPCHECK_WARNING (CWE-457): [#def1471]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4448: warning[uninitvar]: Uninitialized variable: res_memberof
# 4446|   
# 4447|   		group_sid = samdb_result_dom_sid(mem_ctx,
# 4448|-> 						 res_memberof->msgs[i],
# 4449|   						 "objectSid");
# 4450|   		if (group_sid == NULL) {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1472]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4701:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘entriesGeneral’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4493:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4503:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4572:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4605:19: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4636:21: branch_true: following ‘true’ branch (when ‘i < results’)...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4639:38: branch_true: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4660:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4672:53: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4681:26: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4685:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4698:24: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4701:25: danger: dereference of NULL ‘entriesGeneral + (long unsigned int)count * 64’
# 4699|   		case 1:
# 4700|   
# 4701|-> 			entriesGeneral[count].idx = idx + 1;
# 4702|   			entriesGeneral[count].rid = rid;
# 4703|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1473]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4717:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘entriesFull’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4493:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4503:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4572:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4605:19: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4636:21: branch_true: following ‘true’ branch (when ‘i < results’)...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4639:38: branch_true: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4660:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4672:53: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4681:26: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4685:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4698:24: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4717:25: danger: dereference of NULL ‘entriesFull + (long unsigned int)count * 48’
# 4715|   			break;
# 4716|   		case 2:
# 4717|-> 			entriesFull[count].idx = idx + 1;
# 4718|   			entriesFull[count].rid = rid;
# 4719|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1474]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4735:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘entriesFullGroup’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4493:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4503:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4572:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4605:19: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4636:21: branch_true: following ‘true’ branch (when ‘i < results’)...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4639:38: branch_true: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4660:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4672:53: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4681:26: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4685:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4698:24: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4735:25: danger: dereference of NULL ‘entriesFullGroup + (long unsigned int)count * 48’
# 4733|   			break;
# 4734|   		case 3:
# 4735|-> 			entriesFullGroup[count].idx = idx + 1;
# 4736|   			entriesFullGroup[count].rid = rid;
# 4737|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1475]
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4751:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘entriesAscii’
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4493:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4503:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4572:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4605:19: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4626:12: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4636:21: branch_true: following ‘true’ branch (when ‘i < results’)...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4639:38: branch_true: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4660:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4667:27: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4672:53: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4674:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4681:26: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4685:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4698:24: branch_false: ...to here
samba-4.23.4/source4/rpc_server/samr/dcesrv_samr.c:4751:25: danger: dereference of NULL ‘entriesAscii + (long unsigned int)count * 24’
# 4749|   		case 4:
# 4750|   		case 5:
# 4751|-> 			entriesAscii[count].idx = idx + 1;
# 4752|   			entriesAscii[count].account_name.string =
# 4753|   			    ldb_msg_find_attr_as_string(

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1476]
samba-4.23.4/source4/samba/process_prefork.c:400:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[0]’
samba-4.23.4/source4/samba/process_prefork.c:228:13: enter_function: entry to ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:253:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:257:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:259:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:295:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:303:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:306:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:306:9: call_function: calling ‘prefork_reload_after_fork’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:306:9: return_function: returning to ‘prefork_fork_master’ from ‘prefork_reload_after_fork’
samba-4.23.4/source4/samba/process_prefork.c:307:9: call_function: calling ‘setup_handlers’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:307:9: return_function: returning to ‘prefork_fork_master’ from ‘setup_handlers’
samba-4.23.4/source4/samba/process_prefork.c:309:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:330:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:339:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:352:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:363:42: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:365:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:369:24: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:397:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/source4/samba/process_prefork.c:400:17: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:400:17: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_prefork.c:400:17: danger: ‘control_pipe[0]’ leaks here
#  398|   			smb_panic("Unable to create worker control pipe\n");
#  399|   		}
#  400|-> 		smb_set_close_on_exec(control_pipe[0]);
#  401|   		smb_set_close_on_exec(control_pipe[1]);
#  402|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1477]
samba-4.23.4/source4/samba/process_prefork.c:400:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[1]’
samba-4.23.4/source4/samba/process_prefork.c:228:13: enter_function: entry to ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:253:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:257:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:259:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:295:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:303:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:306:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:306:9: call_function: calling ‘prefork_reload_after_fork’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:306:9: return_function: returning to ‘prefork_fork_master’ from ‘prefork_reload_after_fork’
samba-4.23.4/source4/samba/process_prefork.c:307:9: call_function: calling ‘setup_handlers’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:307:9: return_function: returning to ‘prefork_fork_master’ from ‘setup_handlers’
samba-4.23.4/source4/samba/process_prefork.c:309:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:330:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:339:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:352:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:363:42: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:365:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:369:24: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:397:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/source4/samba/process_prefork.c:400:17: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:400:17: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_prefork.c:400:17: danger: ‘control_pipe[1]’ leaks here
#  398|   			smb_panic("Unable to create worker control pipe\n");
#  399|   		}
#  400|-> 		smb_set_close_on_exec(control_pipe[0]);
#  401|   		smb_set_close_on_exec(control_pipe[1]);
#  402|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1478]
samba-4.23.4/source4/samba/process_prefork.c:401:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘control_pipe[1]’
samba-4.23.4/source4/samba/process_prefork.c:228:13: enter_function: entry to ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:253:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:257:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:259:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:295:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:303:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:306:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:306:9: call_function: calling ‘prefork_reload_after_fork’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:306:9: return_function: returning to ‘prefork_fork_master’ from ‘prefork_reload_after_fork’
samba-4.23.4/source4/samba/process_prefork.c:307:9: call_function: calling ‘setup_handlers’ from ‘prefork_fork_master’
samba-4.23.4/source4/samba/process_prefork.c:307:9: return_function: returning to ‘prefork_fork_master’ from ‘setup_handlers’
samba-4.23.4/source4/samba/process_prefork.c:309:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:330:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:333:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:339:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:352:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:363:42: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:365:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_prefork.c:369:24: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:397:20: branch_false: following ‘false’ branch (when ‘ret == 0’)...
samba-4.23.4/source4/samba/process_prefork.c:400:17: branch_false: ...to here
samba-4.23.4/source4/samba/process_prefork.c:401:17: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_prefork.c:401:17: danger: ‘control_pipe[1]’ leaks here
#  399|   		}
#  400|   		smb_set_close_on_exec(control_pipe[0]);
#  401|-> 		smb_set_close_on_exec(control_pipe[1]);
#  402|   	}
#  403|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1479]
samba-4.23.4/source4/samba/process_standard.c:215:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘parent_child_pipe[0]’
samba-4.23.4/source4/samba/process_standard.c:193:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:197:12: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:202:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:207:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:208:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/samba/process_standard.c:215:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:215:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_standard.c:215:9: danger: ‘parent_child_pipe[0]’ leaks here
#  213|   	}
#  214|   
#  215|-> 	smb_set_close_on_exec(parent_child_pipe[0]);
#  216|   	smb_set_close_on_exec(parent_child_pipe[1]);
#  217|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1480]
samba-4.23.4/source4/samba/process_standard.c:215:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘parent_child_pipe[1]’
samba-4.23.4/source4/samba/process_standard.c:193:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:197:12: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:202:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:207:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:208:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/samba/process_standard.c:215:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:215:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_standard.c:215:9: danger: ‘parent_child_pipe[1]’ leaks here
#  213|   	}
#  214|   
#  215|-> 	smb_set_close_on_exec(parent_child_pipe[0]);
#  216|   	smb_set_close_on_exec(parent_child_pipe[1]);
#  217|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1481]
samba-4.23.4/source4/samba/process_standard.c:216:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘parent_child_pipe[1]’
samba-4.23.4/source4/samba/process_standard.c:193:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:197:12: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:202:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/process_standard.c:207:15: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:208:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/samba/process_standard.c:215:9: branch_false: ...to here
samba-4.23.4/source4/samba/process_standard.c:216:9: throw: if ‘smb_set_close_on_exec’ throws an exception...
samba-4.23.4/source4/samba/process_standard.c:216:9: danger: ‘parent_child_pipe[1]’ leaks here
#  214|   
#  215|   	smb_set_close_on_exec(parent_child_pipe[0]);
#  216|-> 	smb_set_close_on_exec(parent_child_pipe[1]);
#  217|   
#  218|   	state->from_child_fd = parent_child_pipe[0];

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1482]
samba-4.23.4/source4/samba/server.c:72:17: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(path)’
samba-4.23.4/source4/samba/server.c:67:15: acquire_memory: allocated here
samba-4.23.4/source4/samba/server.c:68:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/samba/server.c:72:17: branch_false: ...to here
samba-4.23.4/source4/samba/server.c:72:17: throw: if ‘readdir’ throws an exception...
samba-4.23.4/source4/samba/server.c:72:17: danger: ‘opendir(path)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   70|   	}
#   71|   
#   72|-> 	for (de=readdir(dir);de;de=readdir(dir)) {
#   73|   		char *fname;
#   74|   		struct stat st;

Error: COMPILER_WARNING (CWE-477): [#def1483]
samba-4.23.4/source4/samba/service_task.c: scope_hint: In function ‘task_server_terminate’
samba-4.23.4/source4/samba/service_task.c:49:25: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#   49 |                         dcerpc_binding_handle_set_sync_ev(irpc_handle, event_ctx);
#      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.23.4/source4/librpc/rpc/dcerpc.h:33: included_from: Included from here.
samba-4.23.4/bin/default/source4/librpc/gen_ndr/ndr_irpc_c.h:1: included_from: Included from here.
samba-4.23.4/source4/samba/service_task.c:26: included_from: Included from here.
samba-4.23.4/librpc/rpc/rpc_common.h:257:19: note: declared here
#  257 | _DEPRECATED_ void dcerpc_binding_handle_set_sync_ev(struct dcerpc_binding_handle *h,
#      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   47|   		if (irpc_handle != NULL) {
#   48|   			/* Note: this makes use of nested event loops... */
#   49|-> 			dcerpc_binding_handle_set_sync_ev(irpc_handle, event_ctx);
#   50|   			r.in.reason = reason;
#   51|   			dcerpc_samba_terminate_r(irpc_handle, task, &r);

Error: COMPILER_WARNING (CWE-477): [#def1484]
samba-4.23.4/source4/samba/service_task.c:49:25: warning[-Wdeprecated-declarations]: ‘dcerpc_binding_handle_set_sync_ev’ is deprecated
#   47|   		if (irpc_handle != NULL) {
#   48|   			/* Note: this makes use of nested event loops... */
#   49|-> 			dcerpc_binding_handle_set_sync_ev(irpc_handle, event_ctx);
#   50|   			r.in.reason = reason;
#   51|   			dcerpc_samba_terminate_r(irpc_handle, task, &r);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1485]
samba-4.23.4/source4/torture/basic/delaywrite.c:1300:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘finfo2.all_info.out.write_time’
samba-4.23.4/source4/torture/basic/delaywrite.c:1212:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1214:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1216:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1222:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1235:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1267:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1268:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1276:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1298:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1298:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1300:9: danger: use of uninitialized value ‘finfo2.all_info.out.write_time’ here
# 1298|   	GET_INFO_BOTH(finfo3,pinfo3);
# 1299|   
# 1300|-> 	torture_assert_u64_equal(tctx,
# 1301|   				 finfo3.all_info.out.write_time,
# 1302|   				 finfo2.all_info.out.write_time,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1486]
samba-4.23.4/source4/torture/basic/delaywrite.c:1631:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘finfo2.basic_info.out.write_time’
samba-4.23.4/source4/torture/basic/delaywrite.c:1535:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1537:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1539:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1545:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1558:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1567:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1568:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1573:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1579:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1579:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1581:9: branch_false: following ‘false’ branch (when ‘__got != __not_expected’)...
samba-4.23.4/source4/torture/basic/delaywrite.c:1587:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1587:9: branch_false: following ‘false’ branch (when ‘__not_expected != __got’)...
samba-4.23.4/source4/torture/basic/delaywrite.c:1594:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1599:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1628:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1630:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1631:9: danger: use of uninitialized value ‘finfo2.basic_info.out.write_time’ here
# 1629|   
# 1630|   	GET_INFO_BOTH(finfo3,pinfo3);
# 1631|-> 	COMPARE_WRITE_TIME_EQUAL(finfo3, finfo2);
# 1632|   
# 1633|   	/*

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1487]
samba-4.23.4/source4/torture/basic/delaywrite.c:1953:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘finfo2.basic_info.out.write_time’
samba-4.23.4/source4/torture/basic/delaywrite.c:1875:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1877:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1879:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1885:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1898:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1906:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1912:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1912:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1914:9: branch_false: following ‘false’ branch (when ‘__got != __not_expected’)...
samba-4.23.4/source4/torture/basic/delaywrite.c:1922:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1927:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1950:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:1952:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:1953:9: danger: use of uninitialized value ‘finfo2.basic_info.out.write_time’ here
# 1951|   
# 1952|   	GET_INFO_BOTH(finfo3,pinfo3);
# 1953|-> 	COMPARE_WRITE_TIME_EQUAL(finfo3, finfo2);
# 1954|   
# 1955|   	/*

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1488]
samba-4.23.4/source4/torture/basic/delaywrite.c:2091:17: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘finfo3.all_info.out.write_time’
samba-4.23.4/source4/torture/basic/delaywrite.c:2002:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2004:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2006:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2012:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2029:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2034:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2040:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2040:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2042:9: branch_false: following ‘false’ branch (when ‘__got != __not_expected’)...
samba-4.23.4/source4/torture/basic/delaywrite.c:2048:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2049:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2125:1: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2050:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2051:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2054:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2125:1: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2055:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2056:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2061:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2077:17: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2079:16: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2081:17: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2083:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2089:17: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2089:17: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2091:17: danger: use of uninitialized value ‘finfo3.all_info.out.write_time’ here
# 2089|   		GET_INFO_BOTH(finfo4,pinfo4);
# 2090|   
# 2091|-> 		torture_assert_u64_equal(tctx,
# 2092|   					 finfo4.all_info.out.write_time,
# 2093|   					 finfo3.all_info.out.write_time,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1489]
samba-4.23.4/source4/torture/basic/delaywrite.c:2102:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘finfo4.basic_info.out.write_time’
samba-4.23.4/source4/torture/basic/delaywrite.c:2002:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2004:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2006:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2012:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2029:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2034:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2040:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2040:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2042:9: branch_false: following ‘false’ branch (when ‘__got != __not_expected’)...
samba-4.23.4/source4/torture/basic/delaywrite.c:2048:9: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2049:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2125:1: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2050:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2051:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2054:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2125:1: branch_false: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2055:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2056:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2061:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2077:17: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2079:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2099:9: branch_true: ...to here
samba-4.23.4/source4/torture/basic/delaywrite.c:2101:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/basic/delaywrite.c:2102:9: danger: use of uninitialized value ‘finfo4.basic_info.out.write_time’ here
# 2100|   
# 2101|   	GET_INFO_BOTH(finfo5,pinfo5);
# 2102|-> 	COMPARE_WRITE_TIME_EQUAL(finfo5, finfo4);
# 2103|   
# 2104|   	/*

Error: CPPCHECK_WARNING (CWE-457): [#def1490]
samba-4.23.4/source4/torture/basic/utable.c:56: error[uninitvar]: Uninitialized variable: c2
#   54|   		len = 0;
#   55|   		if (!convert_string(CH_UTF16, CH_UNIX,
#   56|-> 				     c2, 2, 
#   57|   				     p, sizeof(fname)-strlen(fname), &len)) {
#   58|   			torture_comment(tctx, "convert_string failed [%s]\n",

Error: CPPCHECK_WARNING (CWE-457): [#def1491]
samba-4.23.4/source4/torture/basic/utable.c:120: error[uninitvar]: Uninitialized variable: c2
#  118|   
#  119|   	if (!convert_string(CH_UTF16, CH_UNIX,
#  120|-> 			     c2, 2, 
#  121|   			     p, sizeof(fname)-strlen(fname), &len)) {
#  122|   		return NULL;

Error: CPPCHECK_WARNING (CWE-628): [#def1492]
samba-4.23.4/source4/torture/basic/utable.c:149: warning[invalidFunctionArg]: Invalid isprint() argument nr 1. The value is 65535 but the valid values are '0:255'.
#  147|   		if (c == '.' || c == '\\') continue;
#  148|   
#  149|-> 		torture_comment(tctx, "%04x (%c)\n", c, isprint(c)?c:'.');
#  150|   
#  151|   		fname = form_name(c);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1493]
samba-4.23.4/source4/torture/dfs/domaindfs.c:142:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘str’
samba-4.23.4/source4/torture/dfs/domaindfs.c:91:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/dfs/domaindfs.c:194:1: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:96:11: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/dfs/domaindfs.c:100:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:104:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/dfs/domaindfs.c:194:1: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:109:9: branch_false: following ‘false’ branch (when ‘__got == 0’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:111:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:111:9: branch_false: following ‘false’ branch (when ‘__got == 1’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:113:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:113:9: branch_false: following ‘false’ branch (when ‘__got == 0’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:115:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:115:9: branch_false: following ‘false’ branch (when ‘__got == 3’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:119:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:119:9: branch_false: following ‘false’ branch (when ‘__got == 0’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:124:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:124:9: branch_false: following ‘false’ branch (when ‘__got == 2’)...
samba-4.23.4/source4/torture/dfs/domaindfs.c:129:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:129:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/dfs/domaindfs.c:133:9: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:133:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/dfs/domaindfs.c:137:15: branch_false: ...to here
samba-4.23.4/source4/torture/dfs/domaindfs.c:142:9: danger: dereference of NULL ‘str’
#  140|   		str2++;
#  141|   	}
#  142|-> 	torture_assert_int_equal(tctx, strlen(str) >0, 1 ,"Length of domain too short");
#  143|   	str++;
#  144|   	torture_assert_int_equal(tctx, strcmp(str,str2), 0,

Error: GCC_ANALYZER_WARNING (CWE-404): [#def1494]
samba-4.23.4/source4/torture/dns/dlz_bind9.c:56:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
samba-4.23.4/source4/torture/dns/dlz_bind9.c:55:9: acquire_resource: ‘va_start’ called here
samba-4.23.4/source4/torture/dns/dlz_bind9.c:56:15: throw: if ‘talloc_vasprintf’ throws an exception...
samba-4.23.4/source4/torture/dns/dlz_bind9.c:56:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   54|   	char *msg;
#   55|   	va_start(ap, fmt);
#   56|-> 	msg = talloc_vasprintf(NULL, fmt, ap);
#   57|   	torture_comment(tctx_static, "%s\n", msg);
#   58|   	TALLOC_FREE(msg);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1495]
samba-4.23.4/source4/torture/gentest.c:3262:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’
samba-4.23.4/source4/torture/gentest.c:3260:19: acquire_memory: allocated here
samba-4.23.4/source4/torture/gentest.c:3261:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)...
samba-4.23.4/source4/torture/gentest.c:3262:9: branch_false: ...to here
samba-4.23.4/source4/torture/gentest.c:3262:9: throw: if ‘all_string_sub’ throws an exception...
samba-4.23.4/source4/torture/gentest.c:3262:9: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
# 3260|   	char *p = strdup(unc);
# 3261|   	if (!p) return false;
# 3262|-> 	all_string_sub(p, "\\", "/", 0);
# 3263|   	if (strncmp(p, "//", 2) != 0) return false;
# 3264|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1496]
samba-4.23.4/source4/torture/gpo/apply.c:150:31: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", talloc_asprintf(<unknown>, "%s/%s",  lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/MACHINE/Microsoft/Windows NT/SecEdit"), "GptTmpl.inf"), "w")’
samba-4.23.4/source4/torture/gpo/apply.c:119:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:122:19: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:128:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:138:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:140:15: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:142:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:147:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
samba-4.23.4/source4/torture/gpo/apply.c:149:28: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:149:28: acquire_resource: opened here
samba-4.23.4/source4/torture/gpo/apply.c:149:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:150:31: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:150:31: throw: if ‘talloc_asprintf’ throws an exception...
samba-4.23.4/source4/torture/gpo/apply.c:150:31: danger: ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", talloc_asprintf(<unknown>, "%s/%s",  lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/MACHINE/Microsoft/Windows NT/SecEdit"), "GptTmpl.inf"), "w")’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  148|   		/* Write out the sysvol */
#  149|   		if ( (fp = fopen(gpo_file, "w")) ) {
#  150|-> 			fputs(talloc_asprintf(ctx, GPTTMPL, minpwdcases[i],
#  151|   					      maxpwdcases[i], pwdlencases[i],
#  152|   					      pwdpropcases[i]), fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1497]
samba-4.23.4/source4/torture/gpo/apply.c:150:31: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", talloc_asprintf(<unknown>, "%s/%s",  lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/MACHINE/Microsoft/Windows NT/SecEdit"), "GptTmpl.inf"), "w")’
samba-4.23.4/source4/torture/gpo/apply.c:119:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:122:19: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:128:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:138:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:140:15: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:142:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:147:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
samba-4.23.4/source4/torture/gpo/apply.c:149:28: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:149:28: acquire_memory: allocated here
samba-4.23.4/source4/torture/gpo/apply.c:149:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:150:31: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:150:31: throw: if ‘talloc_asprintf’ throws an exception...
samba-4.23.4/source4/torture/gpo/apply.c:150:31: danger: ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", talloc_asprintf(<unknown>, "%s/%s",  lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/MACHINE/Microsoft/Windows NT/SecEdit"), "GptTmpl.inf"), "w")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10)
#  148|   		/* Write out the sysvol */
#  149|   		if ( (fp = fopen(gpo_file, "w")) ) {
#  150|-> 			fputs(talloc_asprintf(ctx, GPTTMPL, minpwdcases[i],
#  151|   					      maxpwdcases[i], pwdlencases[i],
#  152|   					      pwdpropcases[i]), fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1498]
samba-4.23.4/source4/torture/gpo/apply.c:169:38: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/GPT.INI"), "w")’
samba-4.23.4/source4/torture/gpo/apply.c:119:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:122:19: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:128:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:138:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:140:15: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:142:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:147:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
samba-4.23.4/source4/torture/gpo/apply.c:149:28: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:168:28: acquire_resource: opened here
samba-4.23.4/source4/torture/gpo/apply.c:168:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:169:31: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:169:38: throw: if ‘talloc_asprintf’ throws an exception...
samba-4.23.4/source4/torture/gpo/apply.c:169:38: danger: ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/GPT.INI"), "w")’ leaks here; was opened at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10)
#  167|   		}
#  168|   		if ( (fp = fopen(gpt_file, "w")) ) {
#  169|-> 			char *data = talloc_asprintf(ctx,
#  170|   						     "[General]\nVersion=%d\n",
#  171|   						     ++vers);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1499]
samba-4.23.4/source4/torture/gpo/apply.c:169:38: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/GPT.INI"), "w")’
samba-4.23.4/source4/torture/gpo/apply.c:119:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:122:19: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:128:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:138:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:140:15: branch_false: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:142:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:147:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
samba-4.23.4/source4/torture/gpo/apply.c:149:28: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:168:28: acquire_memory: allocated here
samba-4.23.4/source4/torture/gpo/apply.c:168:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/gpo/apply.c:169:31: branch_true: ...to here
samba-4.23.4/source4/torture/gpo/apply.c:169:38: throw: if ‘talloc_asprintf’ throws an exception...
samba-4.23.4/source4/torture/gpo/apply.c:169:38: danger: ‘fopen(talloc_asprintf(talloc_named_const(tctx, 0, "talloc_new: ../../source4/torture/gpo/apply.c:92"), "%s/%s", lpcfg_path(lpcfg_service(*tctx.lp_ctx, "sysvol"), lpcfg_default_service(*tctx.lp_ctx), tctx), "addom.samba.example.com/Policies/{{31B2F340-016D-11D2-945F-00C04FB984F9}}/GPT.INI"), "w")’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10)
#  167|   		}
#  168|   		if ( (fp = fopen(gpt_file, "w")) ) {
#  169|-> 			char *data = talloc_asprintf(ctx,
#  170|   						     "[General]\nVersion=%d\n",
#  171|   						     ++vers);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1500]
samba-4.23.4/source4/torture/libnetapi/libnetapi_group.c:191:49: warning[-Wanalyzer-null-argument]: use of NULL ‘current_name’ where non-null expected
#  189|   				}
#  190|   
#  191|-> 				if (username && strcasecmp(current_name, username) == 0) {
#  192|   					found_user = 1;
#  193|   				}

Error: CPPCHECK_WARNING (CWE-457): [#def1501]
samba-4.23.4/source4/torture/locktest.c:569: error[uninitvar]: Uninitialized variable: &seed
#  567|   	struct poptOption long_options[] = {
#  568|   		POPT_AUTOHELP
#  569|-> 		{"seed",	  0, POPT_ARG_INT,  &seed, 	0,	"Seed to use for randomizer", 	NULL},
#  570|   		{"num-ops",	  0, POPT_ARG_INT,  &numops, 	0, 	"num ops",	NULL},
#  571|   		{"lockrange",     0, POPT_ARG_INT,  &lock_range,0,      "locking range", NULL},

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1502]
samba-4.23.4/source4/torture/masktest.c:50:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘file’
samba-4.23.4/source4/torture/masktest.c:218:13: enter_function: entry to ‘test_mask’
samba-4.23.4/source4/torture/masktest.c:231:12: branch_false: following ‘false’ branch (when ‘argc <= 1’)...
samba-4.23.4/source4/torture/masktest.c:231:12: branch_false: ...to here
samba-4.23.4/source4/torture/masktest.c:268:17: call_function: calling ‘testpair’ from ‘test_mask’
#   48|   	if (ISDOT(pattern)) return false;
#   49|   
#   50|-> 	if (ISDOTDOT(file)) file = ".";
#   51|   
#   52|   	return ms_fnmatch_protocol(

Error: CPPCHECK_WARNING (CWE-457): [#def1503]
samba-4.23.4/source4/torture/masktest.c:310: error[uninitvar]: Uninitialized variable: &seed
#  308|   	struct poptOption long_options[] = {
#  309|   		POPT_AUTOHELP
#  310|-> 		{"seed",	  0, POPT_ARG_INT,  &seed, 	0,	"Seed to use for randomizer", 	NULL},
#  311|   		{"num-ops",	  0, POPT_ARG_INT,  &NumLoops, 	0, 	"num ops",	NULL},
#  312|   		{"maxlength",	  0, POPT_ARG_INT,  &max_length,0, 	"maximum length",	NULL},

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1504]
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_resource: opened here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: throw: if ‘nbio_time_reset’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: danger: ‘fopen(loadfile, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   93|   
#   94|   again:
#   95|-> 	nbio_time_reset();
#   96|   
#   97|   	while (fgets(line, sizeof(line)-1, f)) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1505]
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: throw: if ‘nbio_time_reset’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:95:9: danger: ‘fopen(loadfile, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   93|   
#   94|   again:
#   95|-> 	nbio_time_reset();
#   96|   
#   97|   	while (fgets(line, sizeof(line)-1, f)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1506]
samba-4.23.4/source4/torture/nbench/nbench.c:103:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_resource: opened here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:109:17: throw: if ‘all_string_sub’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:103:17: danger: ‘fopen(loadfile, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  101|   		int error = 0;
#  102|   
#  103|-> 		nbench_line_count++;
#  104|   
#  105|   		if ((strlen(line) > 0) && line[strlen(line)-1] == '\n') {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1507]
samba-4.23.4/source4/torture/nbench/nbench.c:103:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:109:17: throw: if ‘all_string_sub’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:103:17: danger: ‘fopen(loadfile, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  101|   		int error = 0;
#  102|   
#  103|-> 		nbench_line_count++;
#  104|   
#  105|   		if ((strlen(line) > 0) && line[strlen(line)-1] == '\n') {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1508]
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_resource: opened here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:97:16: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: throw: if ‘rewind’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: danger: ‘fopen(loadfile, "r")’ leaks here; was opened at [(3)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/2)
#  219|   	}
#  220|   
#  221|-> 	rewind(f);
#  222|   	goto again;
#  223|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1509]
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(loadfile, "r")’
samba-4.23.4/source4/torture/nbench/nbench.c:83:12: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:87:13: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:89:12: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:97:16: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: throw: if ‘rewind’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbench.c:221:9: danger: ‘fopen(loadfile, "r")’ leaks here; was allocated at [(3)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/2)
#  219|   	}
#  220|   
#  221|-> 	rewind(f);
#  222|   	goto again;
#  223|   

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1510]
samba-4.23.4/source4/torture/nbench/nbio.c:295:17: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘printf’ from within signal handler
samba-4.23.4/source4/torture/nbench/nbio.c:248:6: enter_function: entry to ‘nb_alarm’
samba-4.23.4/source4/torture/nbench/nbio.c:256:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
 call_function: calling ‘nb_alarm’ from ‘nb_alarm’
#  293|   
#  294|   	if (in_warmup) {
#  295|-> 		printf("%4d  %8d  %.2f MB/sec  warmup %.0f sec   \n", 
#  296|   		       num_connected, lines/nprocs, 
#  297|   		       nbio_result(), t);

Error: CPPCHECK_WARNING (CWE-476): [#def1511]
samba-4.23.4/source4/torture/nbench/nbio.c:553: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  551|   
#  552|   	buf = malloc(size);
#  553|-> 	memset(buf, 0xab, size);
#  554|   
#  555|   	io.writex.level = RAW_WRITE_WRITEX;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1512]
samba-4.23.4/source4/torture/nbench/nbio.c:553:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
samba-4.23.4/source4/torture/nbench/nbio.c:540:6: enter_function: entry to ‘nb_writex’
samba-4.23.4/source4/torture/nbench/nbio.c:547:13: call_function: calling ‘find_handle’ from ‘nb_writex’
samba-4.23.4/source4/torture/nbench/nbio.c:547:13: return_function: returning to ‘nb_writex’ from ‘find_handle’
samba-4.23.4/source4/torture/nbench/nbio.c:549:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbio.c:552:15: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbio.c:552:15: acquire_memory: this call could return NULL
samba-4.23.4/source4/torture/nbench/nbio.c:553:9: danger: argument 1 (‘buf’) from [(16)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/15) could be NULL where non-null expected
#  551|   
#  552|   	buf = malloc(size);
#  553|-> 	memset(buf, 0xab, size);
#  554|   
#  555|   	io.writex.level = RAW_WRITE_WRITEX;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1513]
samba-4.23.4/source4/torture/nbench/nbio.c:563:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/torture/nbench/nbio.c:540:6: enter_function: entry to ‘nb_writex’
samba-4.23.4/source4/torture/nbench/nbio.c:547:13: call_function: calling ‘find_handle’ from ‘nb_writex’
samba-4.23.4/source4/torture/nbench/nbio.c:547:13: return_function: returning to ‘nb_writex’ from ‘find_handle’
samba-4.23.4/source4/torture/nbench/nbio.c:549:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbio.c:552:15: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbio.c:552:15: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbio.c:563:15: throw: if ‘smb_raw_write’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbio.c:563:15: danger: ‘buf’ leaks here; was allocated at [(16)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/15)
#  561|   	io.writex.in.data = buf;
#  562|   
#  563|-> 	ret = smb_raw_write(c->tree, &io);
#  564|   
#  565|   	free(buf);

Error: CPPCHECK_WARNING (CWE-476): [#def1514]
samba-4.23.4/source4/torture/nbench/nbio.c:595: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: buf
#  593|   	buf = malloc(size);
#  594|   
#  595|-> 	memset(buf, 0x12, size);
#  596|   
#  597|   	io.write.level = RAW_WRITE_WRITE;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1515]
samba-4.23.4/source4/torture/nbench/nbio.c:595:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
samba-4.23.4/source4/torture/nbench/nbio.c:581:6: enter_function: entry to ‘nb_write’
samba-4.23.4/source4/torture/nbench/nbio.c:588:13: call_function: calling ‘find_handle’ from ‘nb_write’
samba-4.23.4/source4/torture/nbench/nbio.c:588:13: return_function: returning to ‘nb_write’ from ‘find_handle’
samba-4.23.4/source4/torture/nbench/nbio.c:590:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbio.c:593:15: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbio.c:593:15: acquire_memory: this call could return NULL
samba-4.23.4/source4/torture/nbench/nbio.c:595:9: danger: argument 1 (‘buf’) from [(16)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/15) could be NULL where non-null expected
#  593|   	buf = malloc(size);
#  594|   
#  595|-> 	memset(buf, 0x12, size);
#  596|   
#  597|   	io.write.level = RAW_WRITE_WRITE;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1516]
samba-4.23.4/source4/torture/nbench/nbio.c:604:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/torture/nbench/nbio.c:581:6: enter_function: entry to ‘nb_write’
samba-4.23.4/source4/torture/nbench/nbio.c:588:13: call_function: calling ‘find_handle’ from ‘nb_write’
samba-4.23.4/source4/torture/nbench/nbio.c:588:13: return_function: returning to ‘nb_write’ from ‘find_handle’
samba-4.23.4/source4/torture/nbench/nbio.c:590:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbio.c:593:15: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbio.c:593:15: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbio.c:604:15: throw: if ‘smb_raw_write’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbio.c:604:15: danger: ‘buf’ leaks here; was allocated at [(16)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/15)
#  602|   	io.write.in.data = buf;
#  603|   
#  604|-> 	ret = smb_raw_write(c->tree, &io);
#  605|   
#  606|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1517]
samba-4.23.4/source4/torture/nbench/nbio.c:729:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’
samba-4.23.4/source4/torture/nbench/nbio.c:706:6: enter_function: entry to ‘nb_readx’
samba-4.23.4/source4/torture/nbench/nbio.c:713:13: call_function: calling ‘find_handle’ from ‘nb_readx’
samba-4.23.4/source4/torture/nbench/nbio.c:713:13: return_function: returning to ‘nb_readx’ from ‘find_handle’
samba-4.23.4/source4/torture/nbench/nbio.c:715:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/nbench/nbio.c:718:15: branch_false: ...to here
samba-4.23.4/source4/torture/nbench/nbio.c:718:15: acquire_memory: allocated here
samba-4.23.4/source4/torture/nbench/nbio.c:729:15: throw: if ‘smb_raw_read’ throws an exception...
samba-4.23.4/source4/torture/nbench/nbio.c:729:15: danger: ‘buf’ leaks here; was allocated at [(16)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/15)
#  727|   	io.readx.out.data     = buf;
#  728|   
#  729|-> 	ret = smb_raw_read(c->tree, &io);
#  730|   
#  731|   	free(buf);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1518]
samba-4.23.4/source4/torture/ndr/krb5pac.c:488:9: warning[-Wanalyzer-malloc-leak]: leak of ‘plain_data.data’
samba-4.23.4/source4/torture/ndr/krb5pac.c:441:9: branch_false: following ‘false’ branch (when ‘__got == 0’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:443:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:443:9: branch_false: following ‘false’ branch (when ‘__got == 6’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:445:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:445:9: branch_false: following ‘false’ branch (when ‘__got == 1’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:446:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:446:9: branch_false: following ‘false’ branch (when ‘__got == 448’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:447:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:447:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:449:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:449:9: branch_false: following ‘false’ branch (when ‘__got == 2’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:450:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:450:9: branch_false: following ‘false’ branch (when ‘__got == 148’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:451:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:451:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:452:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:452:9: branch_false: following ‘false’ branch (when ‘__got == 0’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:456:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:456:9: branch_false: following ‘false’ branch (when ‘__got == 18’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:460:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:460:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:470:9: branch_false: following ‘false’ branch (when ‘__got == 32’)...
samba-4.23.4/source4/torture/ndr/krb5pac.c:471:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:471:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:472:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:472:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:478:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:484:27: acquire_memory: allocated here
samba-4.23.4/source4/torture/ndr/krb5pac.c:486:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/ndr/krb5pac.c:488:9: branch_false: ...to here
samba-4.23.4/source4/torture/ndr/krb5pac.c:488:9: throw: if ‘krb5_c_decrypt’ throws an exception...
samba-4.23.4/source4/torture/ndr/krb5pac.c:488:9: danger: ‘plain_data.data’ leaks here; was allocated at [(29)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/28)
#  486|   	torture_assert(tctx, plain_data.data, "malloc failed");
#  487|   
#  488|-> 	torture_assert_krb5_error_equal(tctx, krb5_c_decrypt(ctx,
#  489|   #ifdef SAMBA4_USES_HEIMDAL
#  490|   					reply_key,

Error: CPPCHECK_WARNING (CWE-457): [#def1519]
samba-4.23.4/source4/torture/raw/lockbench.c:374: warning[uninitvar]: Uninitialized variables: cli.options, cli.sock, cli.transport, cli.session, cli.tree, cli.substitute, cli.lsa
#  372|   	num_connected = i;
#  373|   
#  374|-> 	if (!torture_setup_dir(cli, BASEDIR)) {
#  375|   		goto failed;
#  376|   	}

Error: CPPCHECK_WARNING (CWE-457): [#def1520]
samba-4.23.4/source4/torture/raw/offline.c:434: warning[uninitvar]: Uninitialized variables: cli.options, cli.sock, cli.transport, cli.session, cli.tree, cli.substitute, cli.lsa
#  432|   	num_connected = i;
#  433|   
#  434|-> 	if (!torture_setup_dir(cli, BASEDIR)) {
#  435|   		goto failed;
#  436|   	}

Error: COMPILER_WARNING (CWE-704): [#def1521]
samba-4.23.4/source4/torture/raw/qfileinfo.c: scope_hint: In function ‘torture_raw_qfileinfo_internals’
samba-4.23.4/source4/torture/raw/qfileinfo.c:811:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  811 |                 char *p = strrchr(s1->all_info.out.fname.s, '\\');
#      |                           ^~~~~~~
#  809|   	}
#  810|   	if (s1 && s1->all_info.out.fname.s) {
#  811|-> 		char *p = strrchr(s1->all_info.out.fname.s, '\\');
#  812|   		if (!p) {
#  813|   			printf("Not a full path in all_info/fname? - '%s'\n",

Error: COMPILER_WARNING (CWE-704): [#def1522]
samba-4.23.4/source4/torture/raw/qfileinfo.c:811:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  809|   	}
#  810|   	if (s1 && s1->all_info.out.fname.s) {
#  811|-> 		char *p = strrchr(s1->all_info.out.fname.s, '\\');
#  812|   		if (!p) {
#  813|   			printf("Not a full path in all_info/fname? - '%s'\n",

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1523]
samba-4.23.4/source4/torture/raw/samba3misc.c:850:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
samba-4.23.4/source4/torture/raw/samba3misc.c:806:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:808:23: branch_true: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:808:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:813:16: branch_false: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:814:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:821:26: branch_false: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:821:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:827:27: branch_false: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:827:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:838:14: branch_false: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:838:14: acquire_resource: opened here
samba-4.23.4/source4/torture/raw/samba3misc.c:839:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/raw/samba3misc.c:845:9: branch_false: ...to here
samba-4.23.4/source4/torture/raw/samba3misc.c:850:13: throw: if ‘fcntl’ throws an exception...
samba-4.23.4/source4/torture/raw/samba3misc.c:850:13: danger: ‘fd’ leaks here; was opened at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10)
#  848|   	posix_lock.l_len = 1;
#  849|   
#  850|-> 	if (fcntl(fd, F_SETLK, &posix_lock) == -1) {
#  851|   		torture_warning(tctx, "fcntl failed: %s\n", strerror(errno));
#  852|   		ret = false;

Error: CPPCHECK_WARNING (CWE-457): [#def1524]
samba-4.23.4/source4/torture/raw/search.c:344: error[uninitvar]: Uninitialized variable: params
#  342|   	SSVAL(params, 0, 0);
#  343|   	SSVAL(params, 2, SMB_SET_CIFS_UNIX_INFO);
#  344|-> 	tp.in.params = data_blob_talloc(tctx, params, 4);
#  345|   	tp.in.data = data_blob_talloc(tctx, data, 12);
#  346|   	return smb_raw_trans2(cli_unix->tree, tctx, &tp);

Error: CPPCHECK_WARNING (CWE-457): [#def1525]
samba-4.23.4/source4/torture/raw/search.c:345: error[uninitvar]: Uninitialized variable: data
#  343|   	SSVAL(params, 2, SMB_SET_CIFS_UNIX_INFO);
#  344|   	tp.in.params = data_blob_talloc(tctx, params, 4);
#  345|-> 	tp.in.data = data_blob_talloc(tctx, data, 12);
#  346|   	return smb_raw_trans2(cli_unix->tree, tctx, &tp);
#  347|   }

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1526]
samba-4.23.4/source4/torture/rpc/iremotewinspool_common.c:51:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘level1.build’
samba-4.23.4/source4/torture/rpc/iremotewinspool_common.c:39:13: branch_false: following ‘false’ branch (when ‘os > 8’)...
samba-4.23.4/source4/torture/rpc/iremotewinspool_common.c:51:16: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/iremotewinspool_common.c:51:16: danger: use of uninitialized value ‘level1.build’ here
#   49|   	}
#   50|   
#   51|-> 	return level1;
#   52|   }
#   53|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1527]
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fpath, "r")’
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:98:14: acquire_resource: opened here
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:99:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:17: throw: if ‘smbcli_open’ throws an exception...
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: danger: ‘fopen(fpath, "r")’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   99|   	torture_assert_goto(tctx, fp, ok, done, "Failed to open local file\n");
#  100|   
#  101|-> 	smbfp = smbcli_open(dinfo->cli->tree, dst_fpath, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE);
#  102|   	torture_assert_int_not_equal_goto(tctx, smbfp, -1, ok, done, "Failed to open dst file\n");
#  103|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1528]
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fpath, "r")’
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:98:14: acquire_memory: allocated here
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:99:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:17: throw: if ‘smbcli_open’ throws an exception...
samba-4.23.4/source4/torture/rpc/iremotewinspool_driver.c:101:29: danger: ‘fopen(fpath, "r")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   99|   	torture_assert_goto(tctx, fp, ok, done, "Failed to open local file\n");
#  100|   
#  101|-> 	smbfp = smbcli_open(dinfo->cli->tree, dst_fpath, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE);
#  102|   	torture_assert_int_not_equal_goto(tctx, smbfp, -1, ok, done, "Failed to open dst file\n");
#  103|   

Error: GCC_ANALYZER_WARNING (CWE-131): [#def1529]
samba-4.23.4/source4/torture/rpc/samr.c:111:9: warning[-Wanalyzer-allocation-size]: allocated buffer size is not a multiple of the pointee's size
samba-4.23.4/source4/torture/rpc/samr.c:353:14: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:355:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:356:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:357:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:361:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:363:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:365:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:367:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:369:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:371:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:373:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:376:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:377:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:378:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:379:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:380:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:381:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:382:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:383:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:386:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:387:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:388:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:389:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:390:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:391:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:392:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:393:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:396:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:397:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:398:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:399:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:402:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:403:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:404:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:405:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:408:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:409:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:410:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:411:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:413:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:416:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:417:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:418:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:419:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:421:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:424:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:425:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:426:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:427:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:430:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:431:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:432:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:433:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:435:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:437:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:439:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:442:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:571:1: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:442:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/samr.c:442:9: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/samr.c:442:9: call_function: inlined call to ‘init_lsa_BinaryString’ from ‘test_SetUserInfo’
#  109|   	string->length = length;
#  110|   	string->size = length;
#  111|-> 	string->array = (uint16_t *)discard_const(s);
#  112|   }
#  113|   

Error: COMPILER_WARNING (CWE-704): [#def1530]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘strip_unc’
samba-4.23.4/source4/torture/rpc/spoolss.c:4759:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 4759 |         name = strchr(unc, '\\');
#      |              ^
# 4757|   	}
# 4758|   
# 4759|-> 	name = strchr(unc, '\\');
# 4760|   	if (name) {
# 4761|   		return name+1;

Error: COMPILER_WARNING (CWE-704): [#def1531]
samba-4.23.4/source4/torture/rpc/spoolss.c:4759:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 4757|   	}
# 4758|   
# 4759|-> 	name = strchr(unc, '\\');
# 4760|   	if (name) {
# 4761|   		return name+1;

Error: COMPILER_WARNING (CWE-704): [#def1532]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘strip_path’
samba-4.23.4/source4/torture/rpc/spoolss.c:5062:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5062 |         p = strrchr(path, '\\');
#      |           ^
# 5060|   	}
# 5061|   
# 5062|-> 	p = strrchr(path, '\\');
# 5063|   	if (p) {
# 5064|   		return p+1;

Error: COMPILER_WARNING (CWE-704): [#def1533]
samba-4.23.4/source4/torture/rpc/spoolss.c:5062:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5060|   	}
# 5061|   
# 5062|-> 	p = strrchr(path, '\\');
# 5063|   	if (p) {
# 5064|   		return p+1;

Error: COMPILER_WARNING (CWE-704): [#def1534]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘test_SetPrinterDataEx_keys’
samba-4.23.4/source4/torture/rpc/spoolss.c:5509:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5509 |                 c = strchr(key, '\\');
#      |                   ^
# 5507|   		}
# 5508|   
# 5509|-> 		c = strchr(key, '\\');
# 5510|   		if (c) {
# 5511|   			int k;

Error: COMPILER_WARNING (CWE-704): [#def1535]
samba-4.23.4/source4/torture/rpc/spoolss.c:5509:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5507|   		}
# 5508|   
# 5509|-> 		c = strchr(key, '\\');
# 5510|   		if (c) {
# 5511|   			int k;

Error: COMPILER_WARNING (CWE-704): [#def1536]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘test_SetPrinterDataEx_values’
samba-4.23.4/source4/torture/rpc/spoolss.c:5572:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5572 |                         q = strrchr(values[i], ',');
#      |                           ^
# 5570|   		    torture_setting_bool(tctx, "samba4", false)) {
# 5571|   			char *q;
# 5572|-> 			q = strrchr(values[i], ',');
# 5573|   			if (q) {
# 5574|   				torture_comment(

Error: COMPILER_WARNING (CWE-704): [#def1537]
samba-4.23.4/source4/torture/rpc/spoolss.c:5572:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5570|   		    torture_setting_bool(tctx, "samba4", false)) {
# 5571|   			char *q;
# 5572|-> 			q = strrchr(values[i], ',');
# 5573|   			if (q) {
# 5574|   				torture_comment(

Error: COMPILER_WARNING (CWE-704): [#def1538]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘get_full_printername’
samba-4.23.4/source4/torture/rpc/spoolss.c:7187:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 7187 |                 p = strchr(name, '\\');
#      |                   ^
# 7185|   	if (name && name[0] == '\\' && name[1] == '\\') {
# 7186|   		name += 2;
# 7187|-> 		p = strchr(name, '\\');
# 7188|   		if (p) {
# 7189|   			return full_name;

Error: COMPILER_WARNING (CWE-704): [#def1539]
samba-4.23.4/source4/torture/rpc/spoolss.c:7187:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 7185|   	if (name && name[0] == '\\' && name[1] == '\\') {
# 7186|   		name += 2;
# 7187|-> 		p = strchr(name, '\\');
# 7188|   		if (p) {
# 7189|   			return full_name;

Error: COMPILER_WARNING (CWE-704): [#def1540]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘compose_local_driver_directory’
samba-4.23.4/source4/torture/rpc/spoolss.c:8032:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 8032 |         p = strrchr(local_dir, '/');
#      |           ^
# 8030|   	char *p;
# 8031|   
# 8032|-> 	p = strrchr(local_dir, '/');
# 8033|   	if (!p) {
# 8034|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def1541]
samba-4.23.4/source4/torture/rpc/spoolss.c:8032:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 8030|   	char *p;
# 8031|   
# 8032|-> 	p = strrchr(local_dir, '/');
# 8033|   	if (!p) {
# 8034|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def1542]
samba-4.23.4/source4/torture/rpc/spoolss.c: scope_hint: In function ‘driver_directory_dir’
samba-4.23.4/source4/torture/rpc/spoolss.c:10628:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#10628 |         p = strrchr(driver_directory, '\\');
#      |           ^
#10626|   	char *p;
#10627|   
#10628|-> 	p = strrchr(driver_directory, '\\');
#10629|   	if (p) {
#10630|   		return p+1;

Error: COMPILER_WARNING (CWE-704): [#def1543]
samba-4.23.4/source4/torture/rpc/spoolss.c:10628:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#10626|   	char *p;
#10627|   
#10628|-> 	p = strrchr(driver_directory, '\\');
#10629|   	if (p) {
#10630|   		return p+1;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1544]
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’
samba-4.23.4/source4/torture/rpc/spoolss.c:10706:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10718:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10719:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10728:9: branch_false: following ‘false’ branch (when ‘remote_name’ is non-NULL)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10730:9: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: acquire_resource: opened here
samba-4.23.4/source4/torture/rpc/spoolss.c:10738:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10742:15: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10748:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:26: branch_true: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: throw: if ‘torture_warning’ throws an exception...
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: danger: ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
#10754|   				break; /* Empty local file. */
#10755|   
#10756|-> 			torture_warning(tctx,
#10757|   				"failed to read file: %s\n", strerror(errno));
#10758|   			break;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1545]
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’
samba-4.23.4/source4/torture/rpc/spoolss.c:10706:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10718:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10719:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10728:9: branch_false: following ‘false’ branch (when ‘remote_name’ is non-NULL)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10730:9: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: acquire_memory: allocated here
samba-4.23.4/source4/torture/rpc/spoolss.c:10738:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10742:15: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10748:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:26: branch_true: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: throw: if ‘torture_warning’ throws an exception...
samba-4.23.4/source4/torture/rpc/spoolss.c:10756:25: danger: ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8)
#10754|   				break; /* Empty local file. */
#10755|   
#10756|-> 			torture_warning(tctx,
#10757|   				"failed to read file: %s\n", strerror(errno));
#10758|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1546]
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’
samba-4.23.4/source4/torture/rpc/spoolss.c:10706:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10718:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10719:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10728:9: branch_false: following ‘false’ branch (when ‘remote_name’ is non-NULL)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10730:9: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: acquire_resource: opened here
samba-4.23.4/source4/torture/rpc/spoolss.c:10738:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10742:15: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10748:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:26: branch_true: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:20: branch_false: following ‘false’ branch (when ‘n > 0’)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: throw: if ‘smbcli_write’ throws an exception...
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: danger: ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’ leaks here; was opened at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8)
#10759|   		}
#10760|   
#10761|-> 		ret = smbcli_write(cli->tree, fnum, 0, buf, nread + start, n);
#10762|   
#10763|   		if (n != ret) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1547]
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’
samba-4.23.4/source4/torture/rpc/spoolss.c:10706:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10718:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10719:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10728:9: branch_false: following ‘false’ branch (when ‘remote_name’ is non-NULL)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10730:9: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10733:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10737:13: acquire_memory: allocated here
samba-4.23.4/source4/torture/rpc/spoolss.c:10738:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10742:15: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10743:12: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10748:16: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:26: branch_true: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10752:20: branch_false: following ‘false’ branch (when ‘n > 0’)...
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: branch_false: ...to here
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: throw: if ‘smbcli_write’ throws an exception...
samba-4.23.4/source4/torture/rpc/spoolss.c:10761:23: danger: ‘fopen(talloc_asprintf(tctx, "%s/%s", *d.local.driver_directory,  p), "r")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8)
#10759|   		}
#10760|   
#10761|-> 		ret = smbcli_write(cli->tree, fnum, 0, buf, nread + start, n);
#10762|   
#10763|   		if (n != ret) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1548]
samba-4.23.4/source4/torture/smb2/dir.c:714:22: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
samba-4.23.4/source4/torture/smb2/dir.c:702:6: enter_function: entry to ‘fill_result’
samba-4.23.4/source4/torture/smb2/dir.c:712:19: branch_true: following ‘true’ branch (when ‘i < count’)...
samba-4.23.4/source4/torture/smb2/dir.c:713:43: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/dir.c:713:25: call_function: calling ‘extract_name’ from ‘fill_result’
samba-4.23.4/source4/torture/smb2/dir.c:713:25: return_function: returning to ‘fill_result’ from ‘extract_name’
samba-4.23.4/source4/torture/smb2/dir.c:714:22: danger: argument 1 (‘extract_name(file + (long unsigned int)i * 144, level,  data_level)’) NULL where non-null expected
#  712|   	for (i=0; i<count; i++) {
#  713|   		sname = extract_name(&file[i], level, data_level);
#  714|-> 		if (!strcmp(sname, ".") || !(strcmp(sname, "..")))
#  715|   			continue;
#  716|   		data->count++;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1549]
samba-4.23.4/source4/torture/smb2/ioctl.c:2413:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘compression_fmt’
samba-4.23.4/source4/torture/smb2/ioctl.c:2387:13: enter_function: entry to ‘test_ioctl_compress_file_flag’
samba-4.23.4/source4/torture/smb2/ioctl.c:2396:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_file_flag’
samba-4.23.4/source4/torture/smb2/ioctl.c:2396:14: return_function: returning to ‘test_ioctl_compress_file_flag’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2399:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2401:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2401:18: call_function: calling ‘test_ioctl_compress_fs_supported’ from ‘test_ioctl_compress_file_flag’
samba-4.23.4/source4/torture/smb2/ioctl.c:2401:18: return_function: returning to ‘test_ioctl_compress_file_flag’ from ‘test_ioctl_compress_fs_supported’
samba-4.23.4/source4/torture/smb2/ioctl.c:2403:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2404:13: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2404:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2409:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2409:18: call_function: calling ‘test_ioctl_compress_get’ from ‘test_ioctl_compress_file_flag’
samba-4.23.4/source4/torture/smb2/ioctl.c:2409:18: return_function: returning to ‘test_ioctl_compress_file_flag’ from ‘test_ioctl_compress_get’
samba-4.23.4/source4/torture/smb2/ioctl.c:2411:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2413:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2413:9: danger: use of uninitialized value ‘compression_fmt’ here
# 2411|   	torture_assert_ntstatus_ok(torture, status, "FSCTL_GET_COMPRESSION");
# 2412|   
# 2413|-> 	torture_assert(torture, (compression_fmt == COMPRESSION_FORMAT_NONE),
# 2414|   		       "initial compression state not NONE");
# 2415|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1550]
samba-4.23.4/source4/torture/smb2/ioctl.c:2467:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘compression_fmt’
samba-4.23.4/source4/torture/smb2/ioctl.c:2432:13: enter_function: entry to ‘test_ioctl_compress_dir_inherit’
samba-4.23.4/source4/torture/smb2/ioctl.c:2444:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_dir_inherit’
samba-4.23.4/source4/torture/smb2/ioctl.c:2444:14: return_function: returning to ‘test_ioctl_compress_dir_inherit’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2447:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2449:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2449:18: call_function: calling ‘test_ioctl_compress_fs_supported’ from ‘test_ioctl_compress_dir_inherit’
samba-4.23.4/source4/torture/smb2/ioctl.c:2449:18: return_function: returning to ‘test_ioctl_compress_dir_inherit’ from ‘test_ioctl_compress_fs_supported’
samba-4.23.4/source4/torture/smb2/ioctl.c:2451:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2452:13: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2452:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2459:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2459:18: call_function: calling ‘test_ioctl_compress_set’ from ‘test_ioctl_compress_dir_inherit’
samba-4.23.4/source4/torture/smb2/ioctl.c:2459:18: return_function: returning to ‘test_ioctl_compress_dir_inherit’ from ‘test_ioctl_compress_set’
samba-4.23.4/source4/torture/smb2/ioctl.c:2461:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2463:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2463:18: call_function: calling ‘test_ioctl_compress_get’ from ‘test_ioctl_compress_dir_inherit’
samba-4.23.4/source4/torture/smb2/ioctl.c:2463:18: return_function: returning to ‘test_ioctl_compress_dir_inherit’ from ‘test_ioctl_compress_get’
samba-4.23.4/source4/torture/smb2/ioctl.c:2465:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2467:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2467:9: danger: use of uninitialized value ‘compression_fmt’ here
# 2465|   	torture_assert_ntstatus_ok(torture, status, "FSCTL_GET_COMPRESSION");
# 2466|   
# 2467|-> 	torture_assert(torture, (compression_fmt == COMPRESSION_FORMAT_LZNT1),
# 2468|   		       "invalid compression state after set");
# 2469|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1551]
samba-4.23.4/source4/torture/smb2/ioctl.c:2684:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘compression_fmt’
samba-4.23.4/source4/torture/smb2/ioctl.c:2657:13: enter_function: entry to ‘test_ioctl_compress_create_with_attr’
samba-4.23.4/source4/torture/smb2/ioctl.c:2667:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_create_with_attr’
samba-4.23.4/source4/torture/smb2/ioctl.c:2667:14: return_function: returning to ‘test_ioctl_compress_create_with_attr’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2670:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2672:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2672:18: call_function: calling ‘test_ioctl_compress_fs_supported’ from ‘test_ioctl_compress_create_with_attr’
samba-4.23.4/source4/torture/smb2/ioctl.c:2672:18: return_function: returning to ‘test_ioctl_compress_create_with_attr’ from ‘test_ioctl_compress_fs_supported’
samba-4.23.4/source4/torture/smb2/ioctl.c:2674:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2675:13: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2675:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2680:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2680:18: call_function: calling ‘test_ioctl_compress_get’ from ‘test_ioctl_compress_create_with_attr’
samba-4.23.4/source4/torture/smb2/ioctl.c:2680:18: return_function: returning to ‘test_ioctl_compress_create_with_attr’ from ‘test_ioctl_compress_get’
samba-4.23.4/source4/torture/smb2/ioctl.c:2682:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2684:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2684:9: danger: use of uninitialized value ‘compression_fmt’ here
# 2682|   	torture_assert_ntstatus_ok(torture, status, "FSCTL_GET_COMPRESSION");
# 2683|   
# 2684|-> 	torture_assert(torture, (compression_fmt == COMPRESSION_FORMAT_NONE),
# 2685|   		       "initial compression state not NONE");
# 2686|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1552]
samba-4.23.4/source4/torture/smb2/ioctl.c:2739:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘compression_fmt’
samba-4.23.4/source4/torture/smb2/ioctl.c:2702:13: enter_function: entry to ‘test_ioctl_compress_inherit_disable’
samba-4.23.4/source4/torture/smb2/ioctl.c:2716:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_inherit_disable’
samba-4.23.4/source4/torture/smb2/ioctl.c:2716:14: return_function: returning to ‘test_ioctl_compress_inherit_disable’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2719:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2721:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2721:18: call_function: calling ‘test_ioctl_compress_fs_supported’ from ‘test_ioctl_compress_inherit_disable’
samba-4.23.4/source4/torture/smb2/ioctl.c:2721:18: return_function: returning to ‘test_ioctl_compress_inherit_disable’ from ‘test_ioctl_compress_fs_supported’
samba-4.23.4/source4/torture/smb2/ioctl.c:2723:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2724:13: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2724:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2731:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2731:18: call_function: calling ‘test_ioctl_compress_set’ from ‘test_ioctl_compress_inherit_disable’
samba-4.23.4/source4/torture/smb2/ioctl.c:2731:18: return_function: returning to ‘test_ioctl_compress_inherit_disable’ from ‘test_ioctl_compress_set’
samba-4.23.4/source4/torture/smb2/ioctl.c:2733:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2735:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2735:18: call_function: calling ‘test_ioctl_compress_get’ from ‘test_ioctl_compress_inherit_disable’
samba-4.23.4/source4/torture/smb2/ioctl.c:2735:18: return_function: returning to ‘test_ioctl_compress_inherit_disable’ from ‘test_ioctl_compress_get’
samba-4.23.4/source4/torture/smb2/ioctl.c:2737:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2739:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2739:9: danger: use of uninitialized value ‘compression_fmt’ here
# 2737|   	torture_assert_ntstatus_ok(torture, status, "FSCTL_GET_COMPRESSION");
# 2738|   
# 2739|-> 	torture_assert(torture, (compression_fmt == COMPRESSION_FORMAT_LZNT1),
# 2740|   		       "invalid compression state after set");
# 2741|   	smb2_util_close(tree, dirh);

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1553]
samba-4.23.4/source4/torture/smb2/ioctl.c:2950:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘compression_fmt’
samba-4.23.4/source4/torture/smb2/ioctl.c:2915:13: enter_function: entry to ‘test_ioctl_compress_perms’
samba-4.23.4/source4/torture/smb2/ioctl.c:2925:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_perms’
samba-4.23.4/source4/torture/smb2/ioctl.c:2925:14: return_function: returning to ‘test_ioctl_compress_perms’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2928:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2930:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2930:18: call_function: calling ‘test_ioctl_compress_fs_supported’ from ‘test_ioctl_compress_perms’
samba-4.23.4/source4/torture/smb2/ioctl.c:2930:18: return_function: returning to ‘test_ioctl_compress_perms’ from ‘test_ioctl_compress_fs_supported’
samba-4.23.4/source4/torture/smb2/ioctl.c:2932:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2933:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2934:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2939:14: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2939:14: call_function: calling ‘test_setup_create_fill’ from ‘test_ioctl_compress_perms’
samba-4.23.4/source4/torture/smb2/ioctl.c:2939:14: return_function: returning to ‘test_ioctl_compress_perms’ from ‘test_setup_create_fill’
samba-4.23.4/source4/torture/smb2/ioctl.c:2945:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/ioctl.c:2947:18: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2947:18: call_function: calling ‘test_ioctl_compress_get’ from ‘test_ioctl_compress_perms’
samba-4.23.4/source4/torture/smb2/ioctl.c:2947:18: return_function: returning to ‘test_ioctl_compress_perms’ from ‘test_ioctl_compress_get’
samba-4.23.4/source4/torture/smb2/ioctl.c:2949:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/ioctl.c:2950:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/ioctl.c:2950:9: danger: use of uninitialized value ‘compression_fmt’ here
# 2948|   					 &compression_fmt);
# 2949|   	torture_assert_ntstatus_ok(torture, status, "FSCTL_GET_COMPRESSION");
# 2950|-> 	torture_assert(torture, (compression_fmt == COMPRESSION_FORMAT_NONE),
# 2951|   		       "compression set after create");
# 2952|   	smb2_util_close(tree, fh);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1554]
samba-4.23.4/source4/torture/smb2/oplock.c:5126:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5124|   
# 5125|   	/* Set up a signal handler for RT_SIGNAL_LEASE. */
# 5126|-> 	ZERO_STRUCT(act);
# 5127|   	act.sa_handler = got_rt_break;
# 5128|   	ret = sigaction(RT_SIGNAL_LEASE, &act, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1555]
samba-4.23.4/source4/torture/smb2/oplock.c:5133:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5131|   	}
# 5132|   	/* Set up a signal handler for SIGALRM. */
# 5133|-> 	ZERO_STRUCT(act);
# 5134|   	act.sa_handler = got_alarm_fn;
# 5135|   	ret = sigaction(SIGALRM, &act, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1556]
samba-4.23.4/source4/torture/smb2/oplock.c:5140:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5138|   	}
# 5139|   	/* Open the passed in file and get a kernel oplock. */
# 5140|-> 	fd = open(name, O_RDWR, 0666);
# 5141|   	if (fd == -1) {
# 5142|   		return 2;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1557]
samba-4.23.4/source4/torture/smb2/oplock.c:5145:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5143|   	}
# 5144|   
# 5145|-> 	ret = fcntl(fd, F_SETSIG, RT_SIGNAL_LEASE);
# 5146|   	if (ret == -1) {
# 5147|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1558]
samba-4.23.4/source4/torture/smb2/oplock.c:5147:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5145|   	ret = fcntl(fd, F_SETSIG, RT_SIGNAL_LEASE);
# 5146|   	if (ret == -1) {
# 5147|-> 		close(fd);
# 5148|   		return 3;
# 5149|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1559]
samba-4.23.4/source4/torture/smb2/oplock.c:5151:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5149|   	}
# 5150|   
# 5151|-> 	ret = fcntl(fd, F_SETLEASE, F_WRLCK);
# 5152|   	if (ret == -1) {
# 5153|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1560]
samba-4.23.4/source4/torture/smb2/oplock.c:5153:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5151|   	ret = fcntl(fd, F_SETLEASE, F_WRLCK);
# 5152|   	if (ret == -1) {
# 5153|-> 		close(fd);
# 5154|   		return 4;
# 5155|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1561]
samba-4.23.4/source4/torture/smb2/oplock.c:5158:15: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5206:13: enter_function: entry to ‘wait_for_child_oplock’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5238:15: call_function: calling ‘do_child_process’ from ‘wait_for_child_oplock’
# 5156|   
# 5157|   	/* Tell the parent we're ready. */
# 5158|-> 	ret = sys_write(pipefd, &c, 1);
# 5159|   	if (ret != 1) {
# 5160|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1562]
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: danger: ‘fds[0]’ leaks here
# 5216|   				fname);
# 5217|   
# 5218|-> 	torture_assert(tctx, name != NULL, "talloc failed");
# 5219|   
# 5220|   	ret = pipe(fds);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1563]
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: danger: ‘fds[1]’ leaks here
# 5216|   				fname);
# 5217|   
# 5218|-> 	torture_assert(tctx, name != NULL, "talloc failed");
# 5219|   
# 5220|   	ret = pipe(fds);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1564]
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: throw: if ‘torture_result’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: danger: ‘fds[0]’ leaks here
# 5222|   
# 5223|   	pid = fork();
# 5224|-> 	torture_assert(tctx, pid != (pid_t)-1, "fork failed");
# 5225|   
# 5226|   	if (pid != (pid_t)0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1565]
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: following ‘true’ branch (when ‘pid == -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: throw: if ‘torture_result’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: danger: ‘fds[1]’ leaks here
# 5222|   
# 5223|   	pid = fork();
# 5224|-> 	torture_assert(tctx, pid != (pid_t)-1, "fork failed");
# 5225|   
# 5226|   	if (pid != (pid_t)0) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1566]
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5229:17: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: danger: ‘fds[0]’ leaks here
# 5228|   		/* Parent. */
# 5229|   		TALLOC_FREE(name);
# 5230|-> 		close(fds[1]);
# 5231|   		ret = sys_read(fds[0], &c, 1);
# 5232|   		torture_assert(tctx, ret == 1, "read failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1567]
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5229:17: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: throw: if ‘close’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5230:17: danger: ‘fds[1]’ leaks here
# 5228|   		/* Parent. */
# 5229|   		TALLOC_FREE(name);
# 5230|-> 		close(fds[1]);
# 5231|   		ret = sys_read(fds[0], &c, 1);
# 5232|   		torture_assert(tctx, ret == 1, "read failed");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1568]
samba-4.23.4/source4/torture/smb2/oplock.c:5231:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_true: following ‘true’ branch (when ‘pid != 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5229:17: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5231:23: throw: if ‘sys_read’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5231:23: danger: ‘fds[0]’ leaks here
# 5229|   		TALLOC_FREE(name);
# 5230|   		close(fds[1]);
# 5231|-> 		ret = sys_read(fds[0], &c, 1);
# 5232|   		torture_assert(tctx, ret == 1, "read failed");
# 5233|   		return true;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1569]
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[0]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: danger: ‘fds[0]’ leaks here
# 5235|   
# 5236|   	/* Child process. */
# 5237|-> 	close(fds[0]);
# 5238|   	ret = do_child_process(fds[1], name);
# 5239|   	_exit(ret);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1570]
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fds[1]’
samba-4.23.4/source4/torture/smb2/oplock.c:5218:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/oplock.c:5220:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5221:9: branch_false: following ‘false’ branch (when ‘ret != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5223:15: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5224:9: branch_false: following ‘false’ branch (when ‘pid != -1’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5226:12: branch_false: following ‘false’ branch (when ‘pid == 0’)...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: throw: if ‘close’ throws an exception...
samba-4.23.4/source4/torture/smb2/oplock.c:5237:9: danger: ‘fds[1]’ leaks here
# 5235|   
# 5236|   	/* Child process. */
# 5237|-> 	close(fds[0]);
# 5238|   	ret = do_child_process(fds[1], name);
# 5239|   	_exit(ret);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1571]
samba-4.23.4/source4/torture/smb2/replay.c:3162:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘transport2_2’
samba-4.23.4/source4/torture/smb2/replay.c:2806:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2811:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2812:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2815:14: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2824:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2831:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2849:9: branch_true: following ‘true’ branch (when ‘<unknown> != 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:2849:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3162:9: danger: dereference of NULL ‘transport2_2’
# 3160|   
# 3161|   	smbXcli_conn_disconnect(transport2_1->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3162|-> 	smbXcli_conn_disconnect(transport2_2->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3163|   	smbXcli_conn_disconnect(transport2_3->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3164|   	smbXcli_conn_disconnect(transport2_4->conn, NT_STATUS_LOCAL_DISCONNECT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1572]
samba-4.23.4/source4/torture/smb2/replay.c:3163:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘transport2_3’
samba-4.23.4/source4/torture/smb2/replay.c:2806:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2811:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2812:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2815:14: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2824:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2831:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2849:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:2851:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2857:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:2859:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:2862:9: branch_true: following ‘true’ branch (when ‘<unknown> != 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:2862:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3163:9: danger: dereference of NULL ‘transport2_3’
# 3161|   	smbXcli_conn_disconnect(transport2_1->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3162|   	smbXcli_conn_disconnect(transport2_2->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3163|-> 	smbXcli_conn_disconnect(transport2_3->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3164|   	smbXcli_conn_disconnect(transport2_4->conn, NT_STATUS_LOCAL_DISCONNECT);
# 3165|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1573]
samba-4.23.4/source4/torture/smb2/replay.c:4036:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘transport2_2’
samba-4.23.4/source4/torture/smb2/replay.c:3642:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3647:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3648:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3651:14: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3660:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3667:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3685:9: branch_true: following ‘true’ branch (when ‘<unknown> != 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:3685:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4022:12: branch_false: following ‘false’ branch (when ‘blocked2_3 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4025:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4025:12: branch_false: following ‘false’ branch (when ‘blocked2_2 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4028:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4028:12: branch_false: following ‘false’ branch (when ‘blocked2_1 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4031:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4031:12: branch_false: following ‘false’ branch (when ‘block_setup == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4035:53: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4036:9: danger: dereference of NULL ‘transport2_2’
# 4034|   
# 4035|   	smbXcli_conn_disconnect(transport2_1->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4036|-> 	smbXcli_conn_disconnect(transport2_2->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4037|   	smbXcli_conn_disconnect(transport2_3->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4038|   	smbXcli_conn_disconnect(transport2_4->conn, NT_STATUS_LOCAL_DISCONNECT);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1574]
samba-4.23.4/source4/torture/smb2/replay.c:4037:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘transport2_3’
samba-4.23.4/source4/torture/smb2/replay.c:3642:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3647:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3648:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3651:14: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3660:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3667:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3685:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:3687:31: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3693:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/replay.c:3695:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:3698:9: branch_true: following ‘true’ branch (when ‘<unknown> != 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:3698:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4022:12: branch_false: following ‘false’ branch (when ‘blocked2_3 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4025:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4025:12: branch_false: following ‘false’ branch (when ‘blocked2_2 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4028:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4028:12: branch_false: following ‘false’ branch (when ‘blocked2_1 == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4031:12: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4031:12: branch_false: following ‘false’ branch (when ‘block_setup == 0’)...
samba-4.23.4/source4/torture/smb2/replay.c:4035:53: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/replay.c:4037:9: danger: dereference of NULL ‘transport2_3’
# 4035|   	smbXcli_conn_disconnect(transport2_1->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4036|   	smbXcli_conn_disconnect(transport2_2->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4037|-> 	smbXcli_conn_disconnect(transport2_3->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4038|   	smbXcli_conn_disconnect(transport2_4->conn, NT_STATUS_LOCAL_DISCONNECT);
# 4039|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1575]
samba-4.23.4/source4/torture/smb2/samba3misc.c:126:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(talloc_asprintf(tctx, "%s/%s/%s",  torture_setting_string(tctx, "localdir", 0), "samba3misc.smb2", "posixtimedlock.dat"), 2)’
samba-4.23.4/source4/torture/smb2/samba3misc.c:89:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:90:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:93:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:95:17: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:96:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:98:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:99:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:101:20: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:102:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:105:21: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:107:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:113:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:114:14: acquire_resource: opened here
samba-4.23.4/source4/torture/smb2/samba3misc.c:115:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:121:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:126:9: throw: if ‘torture_comment’ throws an exception...
samba-4.23.4/source4/torture/smb2/samba3misc.c:126:9: danger: ‘open(talloc_asprintf(tctx, "%s/%s/%s",  torture_setting_string(tctx, "localdir", 0), "samba3misc.smb2", "posixtimedlock.dat"), 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  124|   	posix_lock.l_len = 1;
#  125|   
#  126|-> 	torture_comment(tctx, "  local fcntl\n");
#  127|   	rc = fcntl(fd, F_SETLK, &posix_lock);
#  128|   	if (rc == -1) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1576]
samba-4.23.4/source4/torture/smb2/samba3misc.c:127:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(talloc_asprintf(tctx, "%s/%s/%s",  torture_setting_string(tctx, "localdir", 0), "samba3misc.smb2", "posixtimedlock.dat"), 2)’
samba-4.23.4/source4/torture/smb2/samba3misc.c:89:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:90:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:93:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:95:17: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:96:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:98:18: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:99:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/samba3misc.c:101:20: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:102:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:105:21: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:107:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:113:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:114:14: acquire_resource: opened here
samba-4.23.4/source4/torture/smb2/samba3misc.c:115:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/samba3misc.c:121:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/samba3misc.c:127:14: throw: if ‘fcntl’ throws an exception...
samba-4.23.4/source4/torture/smb2/samba3misc.c:127:14: danger: ‘open(talloc_asprintf(tctx, "%s/%s/%s",  torture_setting_string(tctx, "localdir", 0), "samba3misc.smb2", "posixtimedlock.dat"), 2)’ leaks here; was opened at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  125|   
#  126|   	torture_comment(tctx, "  local fcntl\n");
#  127|-> 	rc = fcntl(fd, F_SETLK, &posix_lock);
#  128|   	if (rc == -1) {
#  129|   		torture_warning(tctx, "fcntl failed: %s\n", strerror(errno));

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1577]
samba-4.23.4/source4/torture/smb2/session.c:2303:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘transport3’
samba-4.23.4/source4/torture/smb2/session.c:2060:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/session.c:2067:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/session.c:2088:9: branch_true: following ‘true’ branch (when ‘<unknown> != 0’)...
samba-4.23.4/source4/torture/smb2/session.c:2088:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/session.c:2303:9: danger: dereference of NULL ‘transport3’
# 2301|   done:
# 2302|   
# 2303|-> 	smbXcli_conn_disconnect(transport3->conn, NT_STATUS_LOCAL_DISCONNECT);
# 2304|   	smbXcli_conn_disconnect(transport2->conn, NT_STATUS_LOCAL_DISCONNECT);
# 2305|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def1578]
samba-4.23.4/source4/torture/smb2/setinfo.c:53:44: warning[-Wanalyzer-null-argument]: use of NULL ‘eavalue’ where non-null expected
samba-4.23.4/source4/torture/smb2/setinfo.c:78:6: enter_function: entry to ‘torture_smb2_setinfo’
samba-4.23.4/source4/torture/smb2/setinfo.c:99:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:117:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:117:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:177:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:186:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:187:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:187:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:188:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:189:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:190:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:191:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:199:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:200:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:200:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:201:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:202:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:203:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:204:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:208:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:209:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:209:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:213:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:214:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:214:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:218:9: branch_false: following ‘false’ branch (when ‘<unknown> == 3221225485’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:220:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:222:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:223:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:223:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:227:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:228:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:228:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:229:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:232:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:233:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:233:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:234:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:238:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:239:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:239:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:240:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:243:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:244:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:244:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:245:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:249:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:250:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:250:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:253:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:254:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:254:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:258:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:259:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:259:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:260:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:264:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:265:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:265:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:266:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:269:9: branch_false: following ‘false’ branch (when ‘<unknown> == 3221225485’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:271:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:272:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:273:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:273:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:281:9: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:282:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:291:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:293:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:297:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:298:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:298:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:300:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:303:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:305:47: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:307:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:308:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:308:9: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:310:9: branch_true: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:319:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:322:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:326:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:334:14: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:346:9: branch_false: following ‘false’ branch (when ‘<unknown> == 0’)...
samba-4.23.4/source4/torture/smb2/setinfo.c:349:9: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:353:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smb2/setinfo.c:360:13: branch_false: ...to here
samba-4.23.4/source4/torture/smb2/setinfo.c:360:13: call_function: calling ‘find_returned_ea’ from ‘torture_smb2_setinfo’
#   51|   			return true;
#   52|   		}
#   53|-> 		if (eas[i].value.length == strlen(eavalue) &&
#   54|   				memcmp(eas[i].value.data,
#   55|   					eavalue,

Error: GCC_ANALYZER_WARNING (CWE-457): [#def1579]
samba-4.23.4/source4/torture/smb2/util.c:636:18: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*handle’
samba-4.23.4/source4/torture/smb2/util.c:645:10: enter_function: entry to ‘torture_setup_simple_file’
samba-4.23.4/source4/torture/smb2/util.c:649:27: call_function: calling ‘smb2_create_simple_file’ from ‘torture_setup_simple_file’
#  634|   	NT_STATUS_NOT_OK_RETURN(status);
#  635|   
#  636|-> 	status = smb2_util_write(tree, *handle, buf, 0, sizeof(buf));
#  637|   	NT_STATUS_NOT_OK_RETURN(status);
#  638|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1580]
samba-4.23.4/source4/torture/smbtorture.c:236:9: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:236:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:236:9: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  234|   	}
#  235|   	userdn = strndup(dns, p - dns);
#  236|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_userdn", userdn);
#  237|   
#  238|   	/* retrieve the basedn */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1581]
samba-4.23.4/source4/torture/smbtorture.c:240:13: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:240:13: throw: if ‘strchr_m’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:240:13: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  238|   	/* retrieve the basedn */
#  239|   	d = p + 1;
#  240|-> 	p = strchr_m(d, '#');
#  241|   	if (!p) {
#  242|   		lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", "");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1582]
samba-4.23.4/source4/torture/smbtorture.c:242:17: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smbtorture.c:242:17: branch_true: ...to here
samba-4.23.4/source4/torture/smbtorture.c:242:17: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:242:17: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  240|   	p = strchr_m(d, '#');
#  241|   	if (!p) {
#  242|-> 		lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
#  243|   		lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", "");
#  244|   		return;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1583]
samba-4.23.4/source4/torture/smbtorture.c:243:17: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smbtorture.c:242:17: branch_true: ...to here
samba-4.23.4/source4/torture/smbtorture.c:243:17: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:243:17: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2)
#  241|   	if (!p) {
#  242|   		lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", "");
#  243|-> 		lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", "");
#  244|   		return;
#  245|   	}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1584]
samba-4.23.4/source4/torture/smbtorture.c:247:9: warning[-Wanalyzer-malloc-leak]: leak of ‘basedn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:246:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:247:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:247:9: danger: ‘basedn’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4)
#  245|   	}
#  246|   	basedn = strndup(d, p - d);
#  247|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn);
#  248|   
#  249|   	/* retrieve the secret */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1585]
samba-4.23.4/source4/torture/smbtorture.c:247:9: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:247:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:247:9: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/2)
#  245|   	}
#  246|   	basedn = strndup(d, p - d);
#  247|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_basedn", basedn);
#  248|   
#  249|   	/* retrieve the secret */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1586]
samba-4.23.4/source4/torture/smbtorture.c:256:9: warning[-Wanalyzer-malloc-leak]: leak of ‘basedn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:246:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:256:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:256:9: danger: ‘basedn’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4)
#  254|   	}
#  255|   	secret = strdup(p);
#  256|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
#  257|   
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1587]
samba-4.23.4/source4/torture/smbtorture.c:256:9: warning[-Wanalyzer-malloc-leak]: leak of ‘secret’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:255:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:256:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:256:9: danger: ‘secret’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4)
#  254|   	}
#  255|   	secret = strdup(p);
#  256|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
#  257|   
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1588]
samba-4.23.4/source4/torture/smbtorture.c:256:9: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:256:9: throw: if ‘lpcfg_set_cmdline’ throws an exception...
samba-4.23.4/source4/torture/smbtorture.c:256:9: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  254|   	}
#  255|   	secret = strdup(p);
#  256|-> 	lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
#  257|   
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);

Error: CPPCHECK_WARNING (CWE-476): [#def1589]
samba-4.23.4/source4/torture/smbtorture.c:258: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: secret
#  256|   	lpcfg_set_cmdline(lp_ctx, "torture:ldap_secret", secret);
#  257|   
#  258|-> 	printf ("%s - %s - %s\n", userdn, basedn, secret);
#  259|   
#  260|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1590]
samba-4.23.4/source4/torture/smbtorture.c:260:1: warning[-Wanalyzer-malloc-leak]: leak of ‘basedn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:246:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:260:1: danger: ‘basedn’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);
#  259|   
#  260|-> }
#  261|   
#  262|   /* Print the full test list, formatted into separate labelled test

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1591]
samba-4.23.4/source4/torture/smbtorture.c:260:1: warning[-Wanalyzer-malloc-leak]: leak of ‘secret’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:246:29: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:255:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:260:1: danger: ‘secret’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);
#  259|   
#  260|-> }
#  261|   
#  262|   /* Print the full test list, formatted into separate labelled test

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1592]
samba-4.23.4/source4/torture/smbtorture.c:260:1: warning[-Wanalyzer-malloc-leak]: leak of ‘userdn’
samba-4.23.4/source4/torture/smbtorture.c:229:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:235:31: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:235:18: acquire_memory: allocated here
samba-4.23.4/source4/torture/smbtorture.c:241:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smbtorture.c:242:17: branch_true: ...to here
samba-4.23.4/source4/torture/smbtorture.c:260:1: danger: ‘userdn’ leaks here; was allocated at [(3)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/2)
#  258|   	printf ("%s - %s - %s\n", userdn, basedn, secret);
#  259|   
#  260|-> }
#  261|   
#  262|   /* Print the full test list, formatted into separate labelled test

Error: GCC_ANALYZER_WARNING (CWE-479): [#def1593]
samba-4.23.4/source4/torture/smbtorture.c:393:9: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler
samba-4.23.4/source4/torture/smbtorture.c:399:5: enter_function: entry to ‘main’
samba-4.23.4/source4/torture/smbtorture.c:474:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:479:9: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:487:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smbtorture.c:493:14: branch_true: ...to here
samba-4.23.4/source4/torture/smbtorture.c:498:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/torture/smbtorture.c:504:9: branch_false: ...to here
samba-4.23.4/source4/torture/smbtorture.c:622:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/torture/smbtorture.c:628:17: branch_true: ...to here
samba-4.23.4/source4/torture/smbtorture.c:390:24: enter_function: entry to ‘max_runtime_handler’
samba-4.23.4/source4/torture/smbtorture.c:393:9: danger: call to ‘exit’ from within signal handler
#  391|   {
#  392|   	DEBUG(0,("maximum runtime exceeded for smbtorture - terminating\n"));
#  393|-> 	exit(1);
#  394|   }
#  395|   

Error: CPPCHECK_WARNING (CWE-457): [#def1594]
samba-4.23.4/source4/torture/unix/unix_info2.c:100: error[uninitvar]: Uninitialized variable: params
#   98|   	SSVAL(params, 0, 0);
#   99|   	SSVAL(params, 2, SMB_SET_CIFS_UNIX_INFO);
#  100|-> 	tp.in.params = data_blob_talloc(tctx, params, 4);
#  101|   	tp.in.data = data_blob_talloc(tctx, data, 12);
#  102|   

Error: CPPCHECK_WARNING (CWE-457): [#def1595]
samba-4.23.4/source4/torture/unix/unix_info2.c:101: error[uninitvar]: Uninitialized variable: data
#   99|   	SSVAL(params, 2, SMB_SET_CIFS_UNIX_INFO);
#  100|   	tp.in.params = data_blob_talloc(tctx, params, 4);
#  101|-> 	tp.in.data = data_blob_talloc(tctx, data, 12);
#  102|   
#  103|   	status = smb_raw_trans2(cli->tree, tctx, &tp);

Error: CPPCHECK_WARNING (CWE-457): [#def1596]
samba-4.23.4/source4/torture/unix/whoami.c:170: error[uninitvar]: Uninitialized variable: &info_level
#  168|   	tp.in.trans_name = NULL;
#  169|   	SSVAL(&info_level, 0, SMB_QFS_POSIX_WHOAMI);
#  170|-> 	tp.in.params = data_blob_talloc(mem_ctx, &info_level, 2);
#  171|   	tp.in.data = data_blob_talloc(mem_ctx, NULL, 0);
#  172|   

Error: COMPILER_WARNING (CWE-704): [#def1597]
samba-4.23.4/source4/torture/winbind/struct_based.c: scope_hint: In function ‘parse_domain_user’
samba-4.23.4/source4/torture/winbind/struct_based.c:814:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  814 |         char *p = strchr(domuser, winbind_separator(torture));
#      |                   ^~~~~~
#  812|   			      fstring user)
#  813|   {
#  814|-> 	char *p = strchr(domuser, winbind_separator(torture));
#  815|   	char *dom = NULL;
#  816|   

Error: COMPILER_WARNING (CWE-704): [#def1598]
samba-4.23.4/source4/torture/winbind/struct_based.c:814:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  812|   			      fstring user)
#  813|   {
#  814|-> 	char *p = strchr(domuser, winbind_separator(torture));
#  815|   	char *dom = NULL;
#  816|   

Error: COMPILER_WARNING (CWE-704): [#def1599]
samba-4.23.4/source4/torture/winbind/struct_based.c:819:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  819 |                 if ((p = strchr(domuser, '@')) != NULL) {
#      |                        ^
#  817|   	if (!p) {
#  818|   		/* Maybe it was a UPN? */
#  819|-> 		if ((p = strchr(domuser, '@')) != NULL) {
#  820|   			fstrcpy(domain, "");
#  821|   			fstrcpy(user, domuser);

Error: COMPILER_WARNING (CWE-704): [#def1600]
samba-4.23.4/source4/torture/winbind/struct_based.c:819:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  817|   	if (!p) {
#  818|   		/* Maybe it was a UPN? */
#  819|-> 		if ((p = strchr(domuser, '@')) != NULL) {
#  820|   			fstrcpy(domain, "");
#  821|   			fstrcpy(user, domuser);

Error: COMPILER_WARNING (CWE-704): [#def1601]
samba-4.23.4/source4/utils/oLschema2ldif/lib.c: scope_hint: In function ‘check_braces’
samba-4.23.4/source4/utils/oLschema2ldif/lib.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   70 |         if ((c = strchr(string, '(')) == NULL) {
#      |                ^
#   68|   
#   69|   	b = 0;
#   70|-> 	if ((c = strchr(string, '(')) == NULL) {
#   71|   		return -1;
#   72|   	}

Error: COMPILER_WARNING (CWE-704): [#def1602]
samba-4.23.4/source4/utils/oLschema2ldif/lib.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   68|   
#   69|   	b = 0;
#   70|-> 	if ((c = strchr(string, '(')) == NULL) {
#   71|   		return -1;
#   72|   	}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1603]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: warning[-Wanalyzer-file-leak]: leak of FILE ‘copt.in’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: acquire_resource: opened here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:115:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:123:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: throw: if ‘perror’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: danger: ‘copt.in’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  122|   		copt.out = fopen(options.output, "w");
#  123|   		if (!copt.out) {
#  124|-> 			perror(options.output);
#  125|   			usage();
#  126|   			exit(1);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1604]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: warning[-Wanalyzer-malloc-leak]: leak of ‘copt.in’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: acquire_memory: allocated here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:115:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:123:20: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: throw: if ‘perror’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:124:25: danger: ‘copt.in’ leaks here; was allocated at [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#  122|   		copt.out = fopen(options.output, "w");
#  123|   		if (!copt.out) {
#  124|-> 			perror(options.output);
#  125|   			usage();
#  126|   			exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1605]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘copt.in’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: acquire_resource: opened here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:115:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: throw: if ‘process_file’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: danger: ‘copt.in’ leaks here; was opened at [(13)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/12)
#  128|   	}
#  129|   
#  130|-> 	ret = process_file(ctx, &copt);
#  131|   
#  132|   	fclose(copt.in);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1606]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: warning[-Wanalyzer-file-leak]: leak of FILE ‘copt.out’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: acquire_resource: opened here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:123:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: throw: if ‘process_file’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: danger: ‘copt.out’ leaks here; was opened at [(15)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/14)
#  128|   	}
#  129|   
#  130|-> 	ret = process_file(ctx, &copt);
#  131|   
#  132|   	fclose(copt.in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1607]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: warning[-Wanalyzer-malloc-leak]: leak of ‘copt.in’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:114:27: acquire_memory: allocated here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:115:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: throw: if ‘process_file’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: danger: ‘copt.in’ leaks here; was allocated at [(13)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/12)
#  128|   	}
#  129|   
#  130|-> 	ret = process_file(ctx, &copt);
#  131|   
#  132|   	fclose(copt.in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1608]
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: warning[-Wanalyzer-malloc-leak]: leak of ‘copt.out’
samba-4.23.4/source4/utils/oLschema2ldif/main.c:73:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:77:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:84:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:22: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:90:15: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:96:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:102:9: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:107:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:13: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:113:12: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:13: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:121:12: branch_true: following ‘true’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: branch_true: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:122:28: acquire_memory: allocated here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:123:20: branch_false: following ‘false’ branch...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: branch_false: ...to here
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: throw: if ‘process_file’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/main.c:130:15: danger: ‘copt.out’ leaks here; was allocated at [(15)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/14)
#  128|   	}
#  129|   
#  130|-> 	ret = process_file(ctx, &copt);
#  131|   
#  132|   	fclose(copt.in);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1609]
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: warning[-Wanalyzer-file-leak]: leak of FILE ‘opt.out’
samba-4.23.4/source4/utils/oLschema2ldif/test.c:65:19: acquire_resource: opened here
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: throw: if ‘ldb_init’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: danger: ‘opt.out’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#   64|   	opt.in = fmemopen(input.data, input.length, "r");
#   65|   	opt.out = fopen("/dev/null", "w");
#   66|-> 	opt.ldb_ctx = ldb_init(test_ctx, NULL);
#   67|   
#   68|   	assert_non_null(opt.in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1610]
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opt.in’
samba-4.23.4/source4/utils/oLschema2ldif/test.c:64:18: acquire_memory: allocated here
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: throw: if ‘ldb_init’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: danger: ‘opt.in’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#   64|   	opt.in = fmemopen(input.data, input.length, "r");
#   65|   	opt.out = fopen("/dev/null", "w");
#   66|-> 	opt.ldb_ctx = ldb_init(test_ctx, NULL);
#   67|   
#   68|   	assert_non_null(opt.in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1611]
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: warning[-Wanalyzer-malloc-leak]: leak of ‘opt.out’
samba-4.23.4/source4/utils/oLschema2ldif/test.c:65:19: acquire_memory: allocated here
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: throw: if ‘ldb_init’ throws an exception...
samba-4.23.4/source4/utils/oLschema2ldif/test.c:66:23: danger: ‘opt.out’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#   64|   	opt.in = fmemopen(input.data, input.length, "r");
#   65|   	opt.out = fopen("/dev/null", "w");
#   66|-> 	opt.ldb_ctx = ldb_init(test_ctx, NULL);
#   67|   
#   68|   	assert_non_null(opt.in);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1612]
samba-4.23.4/third_party/quic/libquic/handshake.c:681:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
samba-4.23.4/third_party/quic/libquic/handshake.c:669:12: branch_false: following ‘false’ branch...
samba-4.23.4/third_party/quic/libquic/handshake.c:672:15: acquire_memory: allocated here
samba-4.23.4/third_party/quic/libquic/handshake.c:673:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
samba-4.23.4/third_party/quic/libquic/handshake.c:677:9: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:681:15: throw: if ‘gnutls_session_ext_register’ throws an exception...
samba-4.23.4/third_party/quic/libquic/handshake.c:681:15: danger: ‘ctx’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  679|   	ctx->session = session;
#  680|   
#  681|-> 	ret = gnutls_session_ext_register(
#  682|   		session, "QUIC Transport Parameters", QUIC_TLSEXT_TP_PARAM,
#  683|   		GNUTLS_EXT_TLS, quic_tp_recv, quic_tp_send, NULL, NULL, NULL,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1613]
samba-4.23.4/third_party/quic/libquic/handshake.c:690:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ctx’
samba-4.23.4/third_party/quic/libquic/handshake.c:669:12: branch_false: following ‘false’ branch...
samba-4.23.4/third_party/quic/libquic/handshake.c:672:15: acquire_memory: allocated here
samba-4.23.4/third_party/quic/libquic/handshake.c:673:12: branch_false: following ‘false’ branch (when ‘ctx’ is non-NULL)...
samba-4.23.4/third_party/quic/libquic/handshake.c:677:9: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:685:12: branch_false: following ‘false’ branch...
samba-4.23.4/third_party/quic/libquic/handshake.c:690:9: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:690:9: throw: if ‘gnutls_ext_set_data’ throws an exception...
samba-4.23.4/third_party/quic/libquic/handshake.c:690:9: danger: ‘ctx’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  688|   		return ret;
#  689|   	}
#  690|-> 	gnutls_ext_set_data(session, QUIC_TLSEXT_TP_PARAM, ctx);
#  691|   	gnutls_handshake_set_secret_function(session, quic_set_secret);
#  692|   	gnutls_handshake_set_read_function(session, quic_msg_read);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def1614]
samba-4.23.4/third_party/quic/libquic/handshake.c:736:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ctx’
samba-4.23.4/third_party/quic/libquic/handshake.c:834:5: enter_function: entry to ‘quic_handshake_step’
samba-4.23.4/third_party/quic/libquic/handshake.c:837:42: call_function: calling ‘quic_handshake_ctx_get’ from ‘quic_handshake_step’
samba-4.23.4/third_party/quic/libquic/handshake.c:837:42: return_function: returning to ‘quic_handshake_step’ from ‘quic_handshake_ctx_get’
samba-4.23.4/third_party/quic/libquic/handshake.c:843:12: branch_false: following ‘false’ branch (when ‘pstep’ is non-NULL)...
samba-4.23.4/third_party/quic/libquic/handshake.c:846:13: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:846:12: branch_false: following ‘false’ branch...
samba-4.23.4/third_party/quic/libquic/handshake.c:852:12: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:852:12: branch_false: following ‘false’ branch (when ‘process_fn’ is non-NULL)...
samba-4.23.4/third_party/quic/libquic/handshake.c:858:15: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:859:12: branch_false: following ‘false’ branch...
samba-4.23.4/third_party/quic/libquic/handshake.c:862:16: branch_false: ...to here
samba-4.23.4/third_party/quic/libquic/handshake.c:862:16: call_function: calling ‘quic_handshake_next_step’ from ‘quic_handshake_step’
#  734|   	gnutls_memset(&ctx->next_step, 0, sizeof(ctx->next_step));
#  735|   
#  736|-> 	if (ctx->send_list != NULL) {
#  737|   		struct quic_smsg *smsg = ctx->send_list;
#  738|   

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-212.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-namesamba-4.23.4-1.fc44
store-results-to/tmp/tmpng2ia1qn/samba-4.23.4-1.fc44.tar.xz
time-created2026-01-08 22:25:33
time-finished2026-01-08 23:02:34
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpng2ia1qn/samba-4.23.4-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpng2ia1qn/samba-4.23.4-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9