Task #115476 - fixed.err

back to task #115476
download
Error: GCC_ANALYZER_WARNING (CWE-688):
dnsconfd-2.2.0/src/dns_managers/unbound_manager.c: scope_hint: In function ‘effective_ca_from_config’
dnsconfd-2.2.0/src/dns_managers/unbound_manager.c:209:12: warning[-Wanalyzer-null-argument]: use of NULL ‘effective_ca’ where non-null expected
/usr/include/glib-2.0/glib/galloca.h:35: included_from: Included from here.
/usr/include/glib-2.0/glib.h:32: included_from: Included from here.
dnsconfd-2.2.0/src/dns_managers/unbound_manager.h:1: included_from: Included from here.
dnsconfd-2.2.0/src/dns_managers/unbound_manager.c:1: included_from: Included from here.
/usr/include/string.h:202:14: note: argument 1 of ‘strdup’ must be non-null
#  207|     }
#  208|   
#  209|->   result = strdup(effective_ca);
#  210|   
#  211|     free(backup_ca);

Error: GCC_ANALYZER_WARNING (CWE-775):
dnsconfd-2.2.0/src/fsm/fsm.c: scope_hint: In function ‘revert_resolv_conf’
dnsconfd-2.2.0/src/fsm/fsm.c:260:63: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*ctx_8(D)->config.resolv_conf_path, "w")’
dnsconfd-2.2.0/src/fsm/fsm.c: scope_hint: In function ‘revert_resolv_conf’
#  258|     FILE *resolv_conf_file = fopen(ctx->config->resolv_conf_path, "w");
#  259|   
#  260|->   if (!resolv_conf_file || fprintf(resolv_conf_file, "%s", ctx->resolv_conf_backup->str) < 0) {
#  261|       dnsconfd_log(LOG_ERR, "Failed to revert resolv.conf");
#  262|       return EVENT_FAILURE;

Error: GCC_ANALYZER_WARNING (CWE-401):
dnsconfd-2.2.0/src/fsm/fsm.c:260:63: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*ctx_8(D)->config.resolv_conf_path, "w")’
dnsconfd-2.2.0/src/fsm/fsm.c: scope_hint: In function ‘revert_resolv_conf’
#  258|     FILE *resolv_conf_file = fopen(ctx->config->resolv_conf_path, "w");
#  259|   
#  260|->   if (!resolv_conf_file || fprintf(resolv_conf_file, "%s", ctx->resolv_conf_backup->str) < 0) {
#  261|       dnsconfd_log(LOG_ERR, "Failed to revert resolv.conf");
#  262|       return EVENT_FAILURE;

Error: CPPCHECK_WARNING (CWE-404):
dnsconfd-2.2.0/src/fsm/fsm.c:265: error[resourceLeak]: Resource leak: resolv_conf_file
#  263|     }
#  264|   
#  265|->   return EVENT_SUCCESS;
#  266|   }
#  267|