Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] openscap-1.4.4/src/DS/rds_index.c:267:32: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 265| } # 266| # 267|-> while (oscap_to_start_element(reader, 2)) # 268| { # 269| if (strcmp((const char*)xmlTextReaderConstLocalName(reader), "report-request") != 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] openscap-1.4.4/src/DS/rds_index.c:269:57: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 267| while (oscap_to_start_element(reader, 2)) # 268| { # 269|-> if (strcmp((const char*)xmlTextReaderConstLocalName(reader), "report-request") != 0) { # 270| // TODO: warning? # 271| continue; Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] openscap-1.4.4/src/DS/rds_index.c:274:77: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 272| } # 273| # 274|-> struct rds_report_request_index* rr_index = rds_report_request_index_parse(reader); # 275| rds_index_add_report_request(ret, rr_index); # 276| Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] openscap-1.4.4/src/DS/rds_index.c:284:29: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 282| else if (strcmp(name, "assets") == 0) # 283| { # 284|-> if (xmlTextReaderRead(reader) != 1) { # 285| oscap_setxmlerr(xmlGetLastError()); # 286| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] openscap-1.4.4/src/DS/rds_index.c:288:32: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 286| } # 287| # 288|-> while (oscap_to_start_element(reader, 2)) # 289| { # 290| if (strcmp((const char*)xmlTextReaderConstLocalName(reader), "asset") != 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] openscap-1.4.4/src/DS/rds_index.c:290:57: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 288| while (oscap_to_start_element(reader, 2)) # 289| { # 290|-> if (strcmp((const char*)xmlTextReaderConstLocalName(reader), "asset") != 0) { # 291| // TODO: warning? # 292| continue; Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] openscap-1.4.4/src/DS/rds_index.c:295:67: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 293| } # 294| # 295|-> struct rds_asset_index* a_index = rds_asset_index_parse(reader); # 296| rds_index_add_asset(ret, a_index); # 297| Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] openscap-1.4.4/src/DS/rds_index.c:305:29: warning[-Wanalyzer-malloc-leak]: leak of ‘rds_index_new()’ # 303| else if (strcmp(name, "reports") == 0) # 304| { # 305|-> if (xmlTextReaderRead(reader) != 1) { # 306| oscap_setxmlerr(xmlGetLastError()); # 307| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] openscap-1.4.4/src/DS/sds_index.c:275:74: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ openscap-1.4.4/src/common/_error.h:52:100: note: in definition of macro ‘oscap_seterr’ openscap-1.4.4/src/common/_error.h:52:100: note: in definition of macro ‘oscap_seterr’ openscap-1.4.4/src/common/_error.h:52:100: note: in definition of macro ‘oscap_seterr’ # 273| "Expected to have xmlTextReader at start of <ds:component>, " # 274| "the current event is '%i' at '%s' instead. I refuse to parse!", # 275|-> xmlTextReaderNodeType(reader), (const char*)xmlTextReaderConstLocalName(reader)); # 276| # 277| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] openscap-1.4.4/src/DS/sds_index.c:281:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 279| # 280| char *ret = NULL; # 281|-> while (xmlTextReaderRead(reader) == 1) # 282| { # 283| int node_type = xmlTextReaderNodeType(reader); Error: GCC_ANALYZER_WARNING (CWE-401): [#def11] openscap-1.4.4/src/DS/sds_index.c:283:33: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 281| while (xmlTextReaderRead(reader) == 1) # 282| { # 283|-> int node_type = xmlTextReaderNodeType(reader); # 284| const char* local_name = (const char*)xmlTextReaderConstLocalName(reader); # 285| Error: GCC_ANALYZER_WARNING (CWE-401): [#def12] openscap-1.4.4/src/DS/sds_index.c:284:55: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 282| { # 283| int node_type = xmlTextReaderNodeType(reader); # 284|-> const char* local_name = (const char*)xmlTextReaderConstLocalName(reader); # 285| # 286| if (node_type == XML_READER_TYPE_END_ELEMENT && Error: GCC_ANALYZER_WARNING (CWE-401): [#def13] openscap-1.4.4/src/DS/sds_index.c: scope_hint: In function ‘ds_sds_index_parse’ openscap-1.4.4/src/DS/sds_index.c:339:16: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 337| struct ds_sds_index* ret = ds_sds_index_new(); # 338| # 339|-> while (oscap_to_start_element(reader, 1)) # 340| { # 341| const char* name = (const char *)xmlTextReaderConstLocalName(reader); Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] openscap-1.4.4/src/DS/sds_index.c:341:50: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 339| while (oscap_to_start_element(reader, 1)) # 340| { # 341|-> const char* name = (const char *)xmlTextReaderConstLocalName(reader); # 342| /*if (strcmp(name, "component") == 0) # 343| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] openscap-1.4.4/src/DS/sds_index.c:357:53: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 355| } # 356| else if (strcmp(name, "component") == 0) { # 357|-> char *component_id = (char*)xmlTextReaderGetAttribute(reader, BAD_CAST "id"); # 358| char *benchmark_id = ds_sds_component_dig_benchmark_id(reader); # 359| Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] openscap-1.4.4/src/DS/sds_index.c:397:17: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’ # 395| } # 396| # 397|-> xmlTextReaderRead(reader); # 398| } # 399| Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘oval_component_clone’ openscap-1.4.4/src/OVAL/oval_component.c:773:30: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(new_model, *old_component.type)’ # 771| return NULL; # 772| # 773|-> switch (new_component->type) { # 774| case OVAL_FUNCTION_ARITHMETIC:{ # 775| oval_arithmetic_operation_t operation = oval_component_get_arithmetic_operation(old_component); Error: GCC_ANALYZER_WARNING (CWE-476): [#def18] openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘oval_component_set_variable’ openscap-1.4.4/src/OVAL/oval_component.c:939:22: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘component’ # 937| # 938| /* type == OVAL_COMPONENT_VARREF */ # 939|-> if (component->type == OVAL_COMPONENT_VARREF) { # 940| oval_component_VARREF_t *varref = (oval_component_VARREF_t *) component; # 941| varref->variable = variable; Error: GCC_ANALYZER_WARNING (CWE-401): [#def19] openscap-1.4.4/src/OVAL/oval_component.c:954:16: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 1)’ openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘oval_component_parse_tag’ # 952| { # 953| # 954|-> return oval_value_parse_tag(reader, context, oval_value_consume, component); # 955| } # 956| Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘_oval_component_parse_OBJECTREF_tag’ openscap-1.4.4/src/OVAL/oval_component.c:962:32: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 2)’ # 960| # 961| struct oval_definition_model *model = context->definition_model; # 962|-> char *objref = (char *)xmlTextReaderGetAttribute(reader, BAD_CAST "object_ref"); # 963| struct oval_object *object = oval_definition_model_get_new_object(model, objref); # 964| char *field; Error: GCC_ANALYZER_WARNING (CWE-401): [#def21] openscap-1.4.4/src/OVAL/oval_component.c:963:38: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 2)’ # 961| struct oval_definition_model *model = context->definition_model; # 962| char *objref = (char *)xmlTextReaderGetAttribute(reader, BAD_CAST "object_ref"); # 963|-> struct oval_object *object = oval_definition_model_get_new_object(model, objref); # 964| char *field; # 965| Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] openscap-1.4.4/src/OVAL/oval_component.c:974:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 972| if (field) # 973| free(field); # 974|-> field = (char *)xmlTextReaderGetAttribute(reader, BAD_CAST "record_field"); # 975| oval_component_set_record_field(component, field); # 976| if (field) Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘_oval_component_parse_VARREF_tag’ openscap-1.4.4/src/OVAL/oval_component.c:987:32: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 3)’ # 985| # 986| struct oval_definition_model *model = context->definition_model; # 987|-> char *varref = (char *)xmlTextReaderGetAttribute(reader, BAD_CAST "var_ref"); # 988| struct oval_variable *variable = oval_definition_model_get_new_variable(model, varref, OVAL_VARIABLE_UNKNOWN); # 989| if (varref != NULL) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] openscap-1.4.4/src/OVAL/oval_component.c:988:42: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 3)’ # 986| struct oval_definition_model *model = context->definition_model; # 987| char *varref = (char *)xmlTextReaderGetAttribute(reader, BAD_CAST "var_ref"); # 988|-> struct oval_variable *variable = oval_definition_model_get_new_variable(model, varref, OVAL_VARIABLE_UNKNOWN); # 989| if (varref != NULL) { # 990| free(varref); Error: GCC_ANALYZER_WARNING (CWE-401): [#def25] openscap-1.4.4/src/OVAL/oval_component.c:1017:16: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_component_new(model, 6)’ openscap-1.4.4/src/OVAL/oval_component.c: scope_hint: In function ‘oval_component_parse_tag’ # 1015| { # 1016| oval_component_FUNCTION_t *function = (oval_component_FUNCTION_t *) component; # 1017|-> return oval_parser_parse_tag(reader, context, &oval_subcomp_tag_consume, function); # 1018| } # 1019| Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] openscap-1.4.4/src/OVAL/oval_recordField.c:393:26: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/OVAL/oval_recordField.c: scope_hint: In function ‘oval_record_field_parse_tag’ # 391| oval_syschar_status_t status; # 392| # 393|-> status = oval_syschar_status_parse(reader, "status", SYSCHAR_STATUS_EXISTS); # 394| oval_record_field_set_status(rf, status); # 395| ret = oscap_parser_text_value(reader, &_oval_record_field_value_consumer, rf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] openscap-1.4.4/src/OVAL/oval_recordField.c:395:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/OVAL/oval_recordField.c: scope_hint: In function ‘oval_record_field_parse_tag’ # 393| status = oval_syschar_status_parse(reader, "status", SYSCHAR_STATUS_EXISTS); # 394| oval_record_field_set_status(rf, status); # 395|-> ret = oscap_parser_text_value(reader, &_oval_record_field_value_consumer, rf); # 396| break; # 397| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def28] openscap-1.4.4/src/OVAL/oval_recordField.c:402:10: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/OVAL/oval_recordField.c: scope_hint: In function ‘oval_record_field_parse_tag’ # 400| } # 401| # 402|-> (*consumer) (rf, user); # 403| # 404| return ret; Error: GCC_ANALYZER_WARNING (CWE-401): [#def29] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:194:31: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 192| SEXP_t *msg; # 193| # 194|-> msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno)); # 195| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg); # 196| SEXP_free(msg); Error: GCC_ANALYZER_WARNING (CWE-401): [#def30] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:194:31: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 192| SEXP_t *msg; # 193| # 194|-> msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno)); # 195| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg); # 196| SEXP_free(msg); Error: GCC_ANALYZER_WARNING (CWE-401): [#def31] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:195:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 193| # 194| msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno)); # 195|-> probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg); # 196| SEXP_free(msg); # 197| probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR); Error: GCC_ANALYZER_WARNING (CWE-401): [#def32] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:196:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 194| msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno)); # 195| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg); # 196|-> SEXP_free(msg); # 197| probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR); # 198| ret = -2; Error: GCC_ANALYZER_WARNING (CWE-401): [#def33] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:197:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 195| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg); # 196| SEXP_free(msg); # 197|-> probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR); # 198| ret = -2; # 199| goto cleanup; Error: GCC_ANALYZER_WARNING (CWE-401): [#def34] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:216:30: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 214| # 215| do { # 216|-> substr_cnt = oscap_pcre_get_substrings(buf, &ofs, pfd->compiled_regex, want_instance, &substrs); # 217| # 218| if (substr_cnt < 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def35] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:216:30: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 214| # 215| do { # 216|-> substr_cnt = oscap_pcre_get_substrings(buf, &ofs, pfd->compiled_regex, want_instance, &substrs); # 217| # 218| if (substr_cnt < 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def36] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:220:31: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 218| if (substr_cnt < 0) { # 219| SEXP_t *msg; # 220|-> msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, # 221| "Regular expression pattern match failed in file %s with error %d.", # 222| whole_path, substr_cnt); Error: GCC_ANALYZER_WARNING (CWE-401): [#def37] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:243:9: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 241| } while (substr_cnt > 0 && ofs < buf_used); # 242| # 243|-> probe_ent_getvals(pfd->instance_ent, &instance_value_list); # 244| instance_value = SEXP_list_first(instance_value_list); # 245| negative_instance_value = SEXP_number_geti_64(instance_value) < 0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def38] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:244:26: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 242| # 243| probe_ent_getvals(pfd->instance_ent, &instance_value_list); # 244|-> instance_value = SEXP_list_first(instance_value_list); # 245| negative_instance_value = SEXP_number_geti_64(instance_value) < 0; # 246| SEXP_free(instance_value_list); Error: GCC_ANALYZER_WARNING (CWE-401): [#def39] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:245:35: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 243| probe_ent_getvals(pfd->instance_ent, &instance_value_list); # 244| instance_value = SEXP_list_first(instance_value_list); # 245|-> negative_instance_value = SEXP_number_geti_64(instance_value) < 0; # 246| SEXP_free(instance_value_list); # 247| SEXP_free(instance_value); Error: GCC_ANALYZER_WARNING (CWE-401): [#def40] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:246:9: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 244| instance_value = SEXP_list_first(instance_value_list); # 245| negative_instance_value = SEXP_number_geti_64(instance_value) < 0; # 246|-> SEXP_free(instance_value_list); # 247| SEXP_free(instance_value); # 248| Error: GCC_ANALYZER_WARNING (CWE-401): [#def41] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:247:9: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ # 245| negative_instance_value = SEXP_number_geti_64(instance_value) < 0; # 246| SEXP_free(instance_value_list); # 247|-> SEXP_free(instance_value); # 248| # 249| for(cur_inst = 0; cur_inst < instance_count; cur_inst++){ Error: GCC_ANALYZER_WARNING (CWE-401): [#def42] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:276:17: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ # 274| cleanup: # 275| if (fd != -1) # 276|-> close(fd); # 277| free(buf); # 278| if (whole_path != NULL) Error: GCC_ANALYZER_WARNING (CWE-401): [#def43] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:276:17: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ # 274| cleanup: # 275| if (fd != -1) # 276|-> close(fd); # 277| free(buf); # 278| if (whole_path != NULL) Error: GCC_ANALYZER_WARNING (CWE-401): [#def44] openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:276:17: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ # 274| cleanup: # 275| if (fd != -1) # 276|-> close(fd); # 277| free(buf); # 278| if (whole_path != NULL) Error: GCC_ANALYZER_WARNING (CWE-476): [#def45] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_new’ openscap-1.4.4/src/SCE/sce_engine.c:81:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’ # 79| { # 80| struct sce_check_result* ret = malloc(sizeof(struct sce_check_result)); # 81|-> ret->href = NULL; # 82| ret->basename = NULL; # 83| ret->std_out = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def46] openscap-1.4.4/src/SCE/sce_engine.c:85:38: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 83| ret->std_out = NULL; # 84| ret->std_err = NULL; # 85|-> ret->environment_variables = oscap_stringlist_new(); # 86| ret->xccdf_result = XCCDF_RESULT_UNKNOWN; # 87| Error: GCC_ANALYZER_WARNING (CWE-401): [#def47] openscap-1.4.4/src/SCE/sce_engine.c:85:38: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’ # 83| ret->std_out = NULL; # 84| ret->std_err = NULL; # 85|-> ret->environment_variables = oscap_stringlist_new(); # 86| ret->xccdf_result = XCCDF_RESULT_UNKNOWN; # 87| Error: GCC_ANALYZER_WARNING (CWE-401): [#def48] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_engine_eval_rule’ openscap-1.4.4/src/SCE/sce_engine.c:108:15: warning[-Wanalyzer-malloc-leak]: leak of ‘sce_check_result_new()’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_engine_eval_rule’ # 106| void sce_check_result_set_href(struct sce_check_result* v, const char* href) # 107| { # 108|-> free(v->href); # 109| v->href = oscap_strdup(href); # 110| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def49] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_export’ openscap-1.4.4/src/SCE/sce_engine.c:125:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(target_file, "w")’ # 123| const char* sce_check_result_get_basename(struct sce_check_result* v) # 124| { # 125|-> return v->basename; # 126| } # 127| Error: GCC_ANALYZER_WARNING (CWE-401): [#def50] openscap-1.4.4/src/SCE/sce_engine.c:125:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(target_file, "w")’ # 123| const char* sce_check_result_get_basename(struct sce_check_result* v) # 124| { # 125|-> return v->basename; # 126| } # 127| Error: GCC_ANALYZER_WARNING (CWE-401): [#def51] openscap-1.4.4/src/SCE/sce_engine.c:168:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ # 166| void sce_check_result_add_environment_variable(struct sce_check_result* v, const char* var) # 167| { # 168|-> oscap_stringlist_add_string(v->environment_variables, var); # 169| } # 170| Error: GCC_ANALYZER_WARNING (CWE-401): [#def52] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c:168:9: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_check_result_add_environment_variable’ # 166| void sce_check_result_add_environment_variable(struct sce_check_result* v, const char* var) # 167| { # 168|-> oscap_stringlist_add_string(v->environment_variables, var); # 169| } # 170| Error: GCC_ANALYZER_WARNING (CWE-476): [#def53] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_session_new’ openscap-1.4.4/src/SCE/sce_engine.c:225:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’ # 223| { # 224| struct sce_session* ret = malloc(sizeof(struct sce_session)); # 225|-> ret->results = oscap_list_new(); # 226| # 227| return ret; Error: GCC_ANALYZER_WARNING (CWE-401): [#def54] openscap-1.4.4/src/SCE/sce_engine.c:225:24: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’ # 223| { # 224| struct sce_session* ret = malloc(sizeof(struct sce_session)); # 225|-> ret->results = oscap_list_new(); # 226| # 227| return ret; Error: GCC_ANALYZER_WARNING (CWE-476): [#def55] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_parameters_new’ openscap-1.4.4/src/SCE/sce_engine.c:281:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’ # 279| { # 280| struct sce_parameters *ret = malloc(sizeof(struct sce_parameters)); # 281|-> ret->xccdf_directory = NULL; # 282| ret->session = NULL; # 283| Error: GCC_ANALYZER_WARNING (CWE-401): [#def56] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_parameters_set_session’ openscap-1.4.4/src/SCE/sce_engine.c:313:9: warning[-Wanalyzer-malloc-leak]: leak of ‘sce_session_new()’ # 311| void sce_parameters_set_session(struct sce_parameters* v, struct sce_session* value) # 312| { # 313|-> sce_session_free(v->session); # 314| v->session = value; # 315| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def57] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘_pipe_try_read_into_string’ openscap-1.4.4/src/SCE/sce_engine.c:337:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 335| // & is a special case, we have to "escape" it manually # 336| // (all else will eventually get handled by libxml) # 337|-> oscap_string_append_string(string, "&"); # 338| } else { # 339| oscap_string_append_char(string, readbuf); Error: GCC_ANALYZER_WARNING (CWE-401): [#def58] openscap-1.4.4/src/SCE/sce_engine.c:339:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 337| oscap_string_append_string(string, "&"); # 338| } else { # 339|-> oscap_string_append_char(string, readbuf); # 340| } # 341| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def59] openscap-1.4.4/src/SCE/sce_engine.c: scope_hint: In function ‘sce_engine_eval_rule’ openscap-1.4.4/src/SCE/sce_engine.c:415:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘env_values’ # 413| const size_t index_of_first_env_value_not_compiled_in = 10; # 414| # 415|-> env_values[0] = "PATH=/bin:/sbin:/usr/bin:/usr/local/bin:/usr/sbin"; # 416| # 417| env_values[1] = "XCCDF_RESULT_PASS=101"; Error: GCC_ANALYZER_WARNING (CWE-401): [#def60] openscap-1.4.4/src/SCE/sce_engine.c:427:16: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 425| env_values[9] = "XCCDF_RESULT_FIXED=109"; # 426| # 427|-> while (xccdf_value_binding_iterator_has_more(value_binding_it)) # 428| { # 429| struct xccdf_value_binding* binding = xccdf_value_binding_iterator_next(value_binding_it); Error: GCC_ANALYZER_WARNING (CWE-401): [#def61] openscap-1.4.4/src/SCE/sce_engine.c:427:16: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 425| env_values[9] = "XCCDF_RESULT_FIXED=109"; # 426| # 427|-> while (xccdf_value_binding_iterator_has_more(value_binding_it)) # 428| { # 429| struct xccdf_value_binding* binding = xccdf_value_binding_iterator_next(value_binding_it); Error: GCC_ANALYZER_WARNING (CWE-401): [#def62] openscap-1.4.4/src/SCE/sce_engine.c:429:55: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 427| while (xccdf_value_binding_iterator_has_more(value_binding_it)) # 428| { # 429|-> struct xccdf_value_binding* binding = xccdf_value_binding_iterator_next(value_binding_it); # 430| # 431| void *new_env_values = realloc(env_values, (env_value_count + 3) * sizeof(char *)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def63] openscap-1.4.4/src/SCE/sce_engine.c:429:55: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 427| while (xccdf_value_binding_iterator_has_more(value_binding_it)) # 428| { # 429|-> struct xccdf_value_binding* binding = xccdf_value_binding_iterator_next(value_binding_it); # 430| # 431| void *new_env_values = realloc(env_values, (env_value_count + 3) * sizeof(char *)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def64] openscap-1.4.4/src/SCE/sce_engine.c:439:30: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 437| env_values = new_env_values; # 438| # 439|-> char* name = xccdf_value_binding_get_name(binding); # 440| xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441| char* value = xccdf_value_binding_get_setvalue(binding); Error: GCC_ANALYZER_WARNING (CWE-401): [#def65] openscap-1.4.4/src/SCE/sce_engine.c:439:30: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 437| env_values = new_env_values; # 438| # 439|-> char* name = xccdf_value_binding_get_name(binding); # 440| xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441| char* value = xccdf_value_binding_get_setvalue(binding); Error: GCC_ANALYZER_WARNING (CWE-401): [#def66] openscap-1.4.4/src/SCE/sce_engine.c:440:43: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 438| # 439| char* name = xccdf_value_binding_get_name(binding); # 440|-> xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441| char* value = xccdf_value_binding_get_setvalue(binding); # 442| if (value == NULL) Error: GCC_ANALYZER_WARNING (CWE-401): [#def67] openscap-1.4.4/src/SCE/sce_engine.c:440:43: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 438| # 439| char* name = xccdf_value_binding_get_name(binding); # 440|-> xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441| char* value = xccdf_value_binding_get_setvalue(binding); # 442| if (value == NULL) Error: GCC_ANALYZER_WARNING (CWE-401): [#def68] openscap-1.4.4/src/SCE/sce_engine.c:441:31: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 439| char* name = xccdf_value_binding_get_name(binding); # 440| xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441|-> char* value = xccdf_value_binding_get_setvalue(binding); # 442| if (value == NULL) # 443| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def69] openscap-1.4.4/src/SCE/sce_engine.c:441:31: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 439| char* name = xccdf_value_binding_get_name(binding); # 440| xccdf_value_type_t type = xccdf_value_binding_get_type(binding); # 441|-> char* value = xccdf_value_binding_get_setvalue(binding); # 442| if (value == NULL) # 443| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def70] openscap-1.4.4/src/SCE/sce_engine.c:444:33: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 442| if (value == NULL) # 443| { # 444|-> value = xccdf_value_binding_get_value(binding); # 445| if (value == NULL) { # 446| value = ""; Error: GCC_ANALYZER_WARNING (CWE-401): [#def71] openscap-1.4.4/src/SCE/sce_engine.c:444:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 442| if (value == NULL) # 443| { # 444|-> value = xccdf_value_binding_get_value(binding); # 445| if (value == NULL) { # 446| value = ""; Error: GCC_ANALYZER_WARNING (CWE-401): [#def72] openscap-1.4.4/src/SCE/sce_engine.c:449:45: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 447| } # 448| } # 449|-> xccdf_operator_t operator = xccdf_value_binding_get_operator(binding); # 450| # 451| char* type_str; Error: GCC_ANALYZER_WARNING (CWE-401): [#def73] openscap-1.4.4/src/SCE/sce_engine.c:449:45: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 447| } # 448| } # 449|-> xccdf_operator_t operator = xccdf_value_binding_get_operator(binding); # 450| # 451| char* type_str; Error: GCC_ANALYZER_WARNING (CWE-401): [#def74] openscap-1.4.4/src/SCE/sce_engine.c:469:40: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 467| } # 468| # 469|-> char* env_type_entry = oscap_sprintf("XCCDF_TYPE_%s=%s", name, type_str); # 470| char* env_value_entry = oscap_sprintf("XCCDF_VALUE_%s=%s", name, value); # 471| Error: GCC_ANALYZER_WARNING (CWE-401): [#def75] openscap-1.4.4/src/SCE/sce_engine.c:469:40: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 467| } # 468| # 469|-> char* env_type_entry = oscap_sprintf("XCCDF_TYPE_%s=%s", name, type_str); # 470| char* env_value_entry = oscap_sprintf("XCCDF_VALUE_%s=%s", name, value); # 471| Error: GCC_ANALYZER_WARNING (CWE-401): [#def76] openscap-1.4.4/src/SCE/sce_engine.c:470:41: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 468| # 469| char* env_type_entry = oscap_sprintf("XCCDF_TYPE_%s=%s", name, type_str); # 470|-> char* env_value_entry = oscap_sprintf("XCCDF_VALUE_%s=%s", name, value); # 471| # 472| char* operator_str; Error: GCC_ANALYZER_WARNING (CWE-401): [#def77] openscap-1.4.4/src/SCE/sce_engine.c:470:41: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 468| # 469| char* env_type_entry = oscap_sprintf("XCCDF_TYPE_%s=%s", name, type_str); # 470|-> char* env_value_entry = oscap_sprintf("XCCDF_VALUE_%s=%s", name, value); # 471| # 472| char* operator_str; Error: GCC_ANALYZER_WARNING (CWE-401): [#def78] openscap-1.4.4/src/SCE/sce_engine.c:502:44: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ # 500| } # 501| # 502|-> char* env_operator_entry = oscap_sprintf("XCCDF_OPERATOR_%s=%s", name, operator_str); # 503| # 504| env_values[env_value_count] = env_type_entry; Error: GCC_ANALYZER_WARNING (CWE-401): [#def79] openscap-1.4.4/src/SCE/sce_engine.c:502:44: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 500| } # 501| # 502|-> char* env_operator_entry = oscap_sprintf("XCCDF_OPERATOR_%s=%s", name, operator_str); # 503| # 504| env_values[env_value_count] = env_type_entry; Error: GCC_ANALYZER_WARNING (CWE-775): [#def80] openscap-1.4.4/src/SCE/sce_engine.c:542:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stderr_pipefd[0]’ # 540| { # 541| // we won't read from the pipes, so close the reading fd # 542|-> close(stdout_pipefd[0]); # 543| close(stderr_pipefd[0]); # 544| Error: GCC_ANALYZER_WARNING (CWE-775): [#def81] openscap-1.4.4/src/SCE/sce_engine.c:542:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stderr_pipefd[1]’ # 540| { # 541| // we won't read from the pipes, so close the reading fd # 542|-> close(stdout_pipefd[0]); # 543| close(stderr_pipefd[0]); # 544| Error: GCC_ANALYZER_WARNING (CWE-775): [#def82] openscap-1.4.4/src/SCE/sce_engine.c:542:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[0]’ # 540| { # 541| // we won't read from the pipes, so close the reading fd # 542|-> close(stdout_pipefd[0]); # 543| close(stderr_pipefd[0]); # 544| Error: GCC_ANALYZER_WARNING (CWE-775): [#def83] openscap-1.4.4/src/SCE/sce_engine.c:542:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[1]’ # 540| { # 541| // we won't read from the pipes, so close the reading fd # 542|-> close(stdout_pipefd[0]); # 543| close(stderr_pipefd[0]); # 544| Error: GCC_ANALYZER_WARNING (CWE-401): [#def84] openscap-1.4.4/src/SCE/sce_engine.c:542:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 540| { # 541| // we won't read from the pipes, so close the reading fd # 542|-> close(stdout_pipefd[0]); # 543| close(stderr_pipefd[0]); # 544| Error: GCC_ANALYZER_WARNING (CWE-775): [#def85] openscap-1.4.4/src/SCE/sce_engine.c:543:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stderr_pipefd[0]’ # 541| // we won't read from the pipes, so close the reading fd # 542| close(stdout_pipefd[0]); # 543|-> close(stderr_pipefd[0]); # 544| # 545| // forward stdout and stderr to our custom opened pipes Error: GCC_ANALYZER_WARNING (CWE-775): [#def86] openscap-1.4.4/src/SCE/sce_engine.c:543:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stderr_pipefd[1]’ # 541| // we won't read from the pipes, so close the reading fd # 542| close(stdout_pipefd[0]); # 543|-> close(stderr_pipefd[0]); # 544| # 545| // forward stdout and stderr to our custom opened pipes Error: GCC_ANALYZER_WARNING (CWE-775): [#def87] openscap-1.4.4/src/SCE/sce_engine.c:543:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[1]’ # 541| // we won't read from the pipes, so close the reading fd # 542| close(stdout_pipefd[0]); # 543|-> close(stderr_pipefd[0]); # 544| # 545| // forward stdout and stderr to our custom opened pipes Error: GCC_ANALYZER_WARNING (CWE-401): [#def88] openscap-1.4.4/src/SCE/sce_engine.c:543:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 541| // we won't read from the pipes, so close the reading fd # 542| close(stdout_pipefd[0]); # 543|-> close(stderr_pipefd[0]); # 544| # 545| // forward stdout and stderr to our custom opened pipes Error: GCC_ANALYZER_WARNING (CWE-775): [#def89] openscap-1.4.4/src/SCE/sce_engine.c:552:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stderr_pipefd[1]’ # 550| // ones now, stdout and stderr will be closed properly after the execved # 551| // script/executable finishes # 552|-> close(stdout_pipefd[1]); # 553| close(stderr_pipefd[1]); # 554| Error: GCC_ANALYZER_WARNING (CWE-775): [#def90] openscap-1.4.4/src/SCE/sce_engine.c:552:25: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[1]’ # 550| // ones now, stdout and stderr will be closed properly after the execved # 551| // script/executable finishes # 552|-> close(stdout_pipefd[1]); # 553| close(stderr_pipefd[1]); # 554| Error: GCC_ANALYZER_WARNING (CWE-401): [#def91] openscap-1.4.4/src/SCE/sce_engine.c:552:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ # 550| // ones now, stdout and stderr will be closed properly after the execved # 551| // script/executable finishes # 552|-> close(stdout_pipefd[1]); # 553| close(stderr_pipefd[1]); # 554| Error: GCC_ANALYZER_WARNING (CWE-401): [#def92] openscap-1.4.4/src/XCCDF/profile.c:261:37: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_rule_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 259| rr->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR); # 260| rr->weight = xccdf_attribute_get_float(reader, XCCDFA_WEIGHT); # 261|-> if (xccdf_attribute_has(reader, XCCDFA_ROLE)) # 262| rr->role = # 263| oscap_string_to_enum(XCCDF_ROLE_MAP, Error: GCC_ANALYZER_WARNING (CWE-401): [#def93] openscap-1.4.4/src/XCCDF/profile.c:263:45: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 261| if (xccdf_attribute_has(reader, XCCDFA_ROLE)) # 262| rr->role = # 263|-> oscap_string_to_enum(XCCDF_ROLE_MAP, # 264| xccdf_attribute_get(reader, XCCDFA_ROLE)); # 265| if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) Error: GCC_ANALYZER_WARNING (CWE-401): [#def94] openscap-1.4.4/src/XCCDF/profile.c:263:45: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_rule_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 261| if (xccdf_attribute_has(reader, XCCDFA_ROLE)) # 262| rr->role = # 263|-> oscap_string_to_enum(XCCDF_ROLE_MAP, # 264| xccdf_attribute_get(reader, XCCDFA_ROLE)); # 265| if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) Error: GCC_ANALYZER_WARNING (CWE-401): [#def95] openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ openscap-1.4.4/src/XCCDF/profile.c:265:37: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 263| oscap_string_to_enum(XCCDF_ROLE_MAP, # 264| xccdf_attribute_get(reader, XCCDFA_ROLE)); # 265|-> if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) # 266| rr->severity = # 267| oscap_string_to_enum(XCCDF_LEVEL_MAP, Error: GCC_ANALYZER_WARNING (CWE-401): [#def96] openscap-1.4.4/src/XCCDF/profile.c:265:37: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_rule_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 263| oscap_string_to_enum(XCCDF_ROLE_MAP, # 264| xccdf_attribute_get(reader, XCCDFA_ROLE)); # 265|-> if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) # 266| rr->severity = # 267| oscap_string_to_enum(XCCDF_LEVEL_MAP, Error: GCC_ANALYZER_WARNING (CWE-401): [#def97] openscap-1.4.4/src/XCCDF/profile.c:267:45: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 265| if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) # 266| rr->severity = # 267|-> oscap_string_to_enum(XCCDF_LEVEL_MAP, # 268| xccdf_attribute_get(reader, XCCDFA_SEVERITY)); # 269| xccdf_parse_remarks(reader, rr->remarks, depth + 1); Error: GCC_ANALYZER_WARNING (CWE-401): [#def98] openscap-1.4.4/src/XCCDF/profile.c:267:45: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_rule_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 265| if (xccdf_attribute_has(reader, XCCDFA_SEVERITY)) # 266| rr->severity = # 267|-> oscap_string_to_enum(XCCDF_LEVEL_MAP, # 268| xccdf_attribute_get(reader, XCCDFA_SEVERITY)); # 269| xccdf_parse_remarks(reader, rr->remarks, depth + 1); Error: GCC_ANALYZER_WARNING (CWE-401): [#def99] openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_parse_remarks’ openscap-1.4.4/src/XCCDF/profile.c:269:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_rule_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 267| oscap_string_to_enum(XCCDF_LEVEL_MAP, # 268| xccdf_attribute_get(reader, XCCDFA_SEVERITY)); # 269|-> xccdf_parse_remarks(reader, rr->remarks, depth + 1); # 270| oscap_list_add(prof->sub.profile.refine_rules, rr); # 271| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def100] openscap-1.4.4/src/XCCDF/profile.c:270:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 268| xccdf_attribute_get(reader, XCCDFA_SEVERITY)); # 269| xccdf_parse_remarks(reader, rr->remarks, depth + 1); # 270|-> oscap_list_add(prof->sub.profile.refine_rules, rr); # 271| break; # 272| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def101] openscap-1.4.4/src/XCCDF/profile.c:279:48: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 277| struct xccdf_refine_value *rv = xccdf_refine_value_new(); # 278| rv->item = oscap_strdup(id); # 279|-> rv->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR); # 280| if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = Error: GCC_ANALYZER_WARNING (CWE-401): [#def102] openscap-1.4.4/src/XCCDF/profile.c:279:48: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_value_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 277| struct xccdf_refine_value *rv = xccdf_refine_value_new(); # 278| rv->item = oscap_strdup(id); # 279|-> rv->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR); # 280| if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = Error: GCC_ANALYZER_WARNING (CWE-401): [#def103] openscap-1.4.4/src/XCCDF/profile.c:280:37: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 278| rv->item = oscap_strdup(id); # 279| rv->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR); # 280|-> if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = # 282| oscap_string_to_enum(XCCDF_OPERATOR_MAP, Error: GCC_ANALYZER_WARNING (CWE-401): [#def104] openscap-1.4.4/src/XCCDF/profile.c:280:37: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_value_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 278| rv->item = oscap_strdup(id); # 279| rv->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR); # 280|-> if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = # 282| oscap_string_to_enum(XCCDF_OPERATOR_MAP, Error: GCC_ANALYZER_WARNING (CWE-401): [#def105] openscap-1.4.4/src/XCCDF/profile.c:282:45: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 280| if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = # 282|-> oscap_string_to_enum(XCCDF_OPERATOR_MAP, # 283| xccdf_attribute_get(reader, XCCDFA_OPERATOR)); # 284| xccdf_parse_remarks(reader, rv->remarks, depth + 1); Error: GCC_ANALYZER_WARNING (CWE-401): [#def106] openscap-1.4.4/src/XCCDF/profile.c:282:45: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_value_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 280| if (xccdf_attribute_has(reader, XCCDFA_OPERATOR)) # 281| rv->oper = # 282|-> oscap_string_to_enum(XCCDF_OPERATOR_MAP, # 283| xccdf_attribute_get(reader, XCCDFA_OPERATOR)); # 284| xccdf_parse_remarks(reader, rv->remarks, depth + 1); Error: GCC_ANALYZER_WARNING (CWE-401): [#def107] openscap-1.4.4/src/XCCDF/profile.c:284:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_refine_value_new()’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 282| oscap_string_to_enum(XCCDF_OPERATOR_MAP, # 283| xccdf_attribute_get(reader, XCCDFA_OPERATOR)); # 284|-> xccdf_parse_remarks(reader, rv->remarks, depth + 1); # 285| oscap_list_add(prof->sub.profile.refine_values, rv); # 286| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def108] openscap-1.4.4/src/XCCDF/profile.c:285:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 283| xccdf_attribute_get(reader, XCCDFA_OPERATOR)); # 284| xccdf_parse_remarks(reader, rv->remarks, depth + 1); # 285|-> oscap_list_add(prof->sub.profile.refine_values, rv); # 286| break; # 287| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def109] openscap-1.4.4/src/XCCDF/profile.c:289:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/profile.c: scope_hint: In function ‘xccdf_profile_parse’ # 287| } # 288| case XCCDFE_SET_VALUE:{ # 289|-> oscap_list_add(prof->sub.profile.setvalues, xccdf_setvalue_new_parse(reader)); # 290| xmlTextReaderRead(reader); # 291| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def110] openscap-1.4.4/src/XCCDF/profile.c:289:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_setvalue_new_parse(reader)’ openscap-1.4.4/src/XCCDF/profile.c:233:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ # 287| } # 288| case XCCDFE_SET_VALUE:{ # 289|-> oscap_list_add(prof->sub.profile.setvalues, xccdf_setvalue_new_parse(reader)); # 290| xmlTextReaderRead(reader); # 291| break; Error: GCC_ANALYZER_WARNING (CWE-476): [#def111] openscap-1.4.4/src/XCCDF/result_scoring.c:108:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 106| /* Init */ # 107| score = malloc(sizeof(struct xccdf_default_score)); # 108|-> score->count = 0; # 109| score->score = 0.0; # 110| score->accumulator = 0.0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def112] openscap-1.4.4/src/XCCDF/result_scoring.c:115:36: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 113| struct xccdf_item_iterator * child_it; # 114| if (itype == XCCDF_GROUP) # 115|-> child_it = xccdf_group_get_content((const struct xccdf_group *)item); # 116| else # 117| child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); Error: GCC_ANALYZER_WARNING (CWE-401): [#def113] openscap-1.4.4/src/XCCDF/result_scoring.c:117:36: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 115| child_it = xccdf_group_get_content((const struct xccdf_group *)item); # 116| else # 117|-> child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); # 118| # 119| while (xccdf_item_iterator_has_more(child_it)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def114] openscap-1.4.4/src/XCCDF/result_scoring.c:119:24: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 117| child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); # 118| # 119|-> while (xccdf_item_iterator_has_more(child_it)) { # 120| child = xccdf_item_iterator_next(child_it); # 121| ch_score = xccdf_item_get_default_score(child, test_result); Error: GCC_ANALYZER_WARNING (CWE-401): [#def115] openscap-1.4.4/src/XCCDF/result_scoring.c:120:33: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 118| # 119| while (xccdf_item_iterator_has_more(child_it)) { # 120|-> child = xccdf_item_iterator_next(child_it); # 121| ch_score = xccdf_item_get_default_score(child, test_result); # 122| Error: GCC_ANALYZER_WARNING (CWE-401): [#def116] openscap-1.4.4/src/XCCDF/result_scoring.c:143:54: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 141| score->score = score->score / score->accumulator; # 142| /* Default weight */ # 143|-> score->weight_score = score->score * xccdf_item_get_weight(item); # 144| # 145| xccdf_item_iterator_free(child_it); Error: GCC_ANALYZER_WARNING (CWE-401): [#def117] openscap-1.4.4/src/XCCDF/result_scoring.c:145:17: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_default_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_default_score’ # 143| score->weight_score = score->score * xccdf_item_get_weight(item); # 144| # 145|-> xccdf_item_iterator_free(child_it); # 146| } break; # 147| Error: GCC_ANALYZER_WARNING (CWE-401): [#def118] openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c:166:30: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 164| struct xccdf_item *child; # 165| # 166|-> xccdf_type_t itype = xccdf_item_get_type(item); # 167| # 168| switch (itype) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def119] openscap-1.4.4/src/XCCDF/result_scoring.c:171:39: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 169| case XCCDF_RULE:{ # 170| /* Rule */ # 171|-> const char *rule_id = xccdf_rule_get_id((const struct xccdf_rule *) item); # 172| rule_result = xccdf_result_get_rule_result_by_id(test_result, rule_id); # 173| if (rule_result == NULL) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def120] openscap-1.4.4/src/XCCDF/result_scoring.c:172:31: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 170| /* Rule */ # 171| const char *rule_id = xccdf_rule_get_id((const struct xccdf_rule *) item); # 172|-> rule_result = xccdf_result_get_rule_result_by_id(test_result, rule_id); # 173| if (rule_result == NULL) { # 174| dE("Rule result ID(%s) not fount", rule_id); Error: GCC_ANALYZER_WARNING (CWE-401): [#def121] openscap-1.4.4/src/XCCDF/result_scoring.c:177:21: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 175| return NULL; # 176| } # 177|-> if (xccdf_rule_result_get_role(rule_result) == XCCDF_ROLE_UNSCORED) { # 178| return NULL; # 179| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def122] openscap-1.4.4/src/XCCDF/result_scoring.c:182:22: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 180| # 181| /* Ignore these rules */ # 182|-> if ((xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_SELECTED) || # 183| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_APPLICABLE) || # 184| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_INFORMATIONAL) || Error: GCC_ANALYZER_WARNING (CWE-401): [#def123] openscap-1.4.4/src/XCCDF/result_scoring.c:183:34: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 181| /* Ignore these rules */ # 182| if ((xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_SELECTED) || # 183|-> (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_APPLICABLE) || # 184| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_INFORMATIONAL) || # 185| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_CHECKED)) Error: GCC_ANALYZER_WARNING (CWE-401): [#def124] openscap-1.4.4/src/XCCDF/result_scoring.c:184:34: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 182| if ((xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_SELECTED) || # 183| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_APPLICABLE) || # 184|-> (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_INFORMATIONAL) || # 185| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_NOT_CHECKED)) # 186| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def125] openscap-1.4.4/src/XCCDF/result_scoring.c:194:25: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 192| score->weight = 1.0; # 193| else score->weight = # 194|-> xccdf_item_get_weight(item); # 195| # 196| /* score = sum of weights of rules that pass */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def126] openscap-1.4.4/src/XCCDF/result_scoring.c:197:22: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 195| # 196| /* score = sum of weights of rules that pass */ # 197|-> if ((xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_PASS) || # 198| (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_FIXED)) { # 199| if (unweighted) Error: GCC_ANALYZER_WARNING (CWE-401): [#def127] openscap-1.4.4/src/XCCDF/result_scoring.c:198:34: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 196| /* score = sum of weights of rules that pass */ # 197| if ((xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_PASS) || # 198|-> (xccdf_rule_result_get_result(rule_result) == XCCDF_RESULT_FIXED)) { # 199| if (unweighted) # 200| score->score = 1.0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def128] openscap-1.4.4/src/XCCDF/result_scoring.c:202:48: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 200| score->score = 1.0; # 201| else # 202|-> score->score = xccdf_item_get_weight(item); # 203| } else # 204| score->score = 0.0; /* fail */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def129] openscap-1.4.4/src/XCCDF/result_scoring.c:210:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 208| /* Init */ # 209| score = malloc(sizeof(struct xccdf_flat_score)); # 210|-> score->score = 0; # 211| score->weight = 0.0; # 212| Error: GCC_ANALYZER_WARNING (CWE-401): [#def130] openscap-1.4.4/src/XCCDF/result_scoring.c:216:36: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 214| struct xccdf_item_iterator * child_it; # 215| if (itype == XCCDF_GROUP) # 216|-> child_it = xccdf_group_get_content((const struct xccdf_group *)item); # 217| else # 218| child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); Error: GCC_ANALYZER_WARNING (CWE-401): [#def131] openscap-1.4.4/src/XCCDF/result_scoring.c:218:36: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 216| child_it = xccdf_group_get_content((const struct xccdf_group *)item); # 217| else # 218|-> child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); # 219| # 220| while (xccdf_item_iterator_has_more(child_it)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def132] openscap-1.4.4/src/XCCDF/result_scoring.c:220:24: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 218| child_it = xccdf_benchmark_get_content((const struct xccdf_benchmark *)item); # 219| # 220|-> while (xccdf_item_iterator_has_more(child_it)) { # 221| child = xccdf_item_iterator_next(child_it); # 222| ch_score = xccdf_item_get_flat_score(child, test_result, unweighted); Error: GCC_ANALYZER_WARNING (CWE-401): [#def133] openscap-1.4.4/src/XCCDF/result_scoring.c:221:33: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 219| # 220| while (xccdf_item_iterator_has_more(child_it)) { # 221|-> child = xccdf_item_iterator_next(child_it); # 222| ch_score = xccdf_item_get_flat_score(child, test_result, unweighted); # 223| Error: GCC_ANALYZER_WARNING (CWE-401): [#def134] openscap-1.4.4/src/XCCDF/result_scoring.c:239:17: warning[-Wanalyzer-malloc-leak]: leak of ‘score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/common/util.h: scope_hint: In function ‘xccdf_item_get_flat_score’ openscap-1.4.4/src/XCCDF/result_scoring.c: scope_hint: In function ‘xccdf_item_get_flat_score’ # 237| } # 238| # 239|-> xccdf_item_iterator_free(child_it); # 240| } break; # 241| Error: GCC_ANALYZER_WARNING (CWE-401): [#def135] openscap-1.4.4/src/XCCDF/tailoring.c:191:51: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/tailoring.c:126:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/tailoring.c: scope_hint: In function ‘xccdf_tailoring_parse’ # 189| dI("Parsing Tailoring Profiles without reference to Benchmark"); # 190| } # 191|-> struct xccdf_item *item = xccdf_profile_parse(reader, benchmark); # 192| if (!xccdf_tailoring_add_profile(tailoring, XPROFILE(item))) { # 193| dW("Failed to add profile to tailoring while parsing!"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def136] openscap-1.4.4/src/XCCDF/tailoring.c:201:17: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/tailoring.c:126:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/tailoring.c: scope_hint: In function ‘xccdf_tailoring_parse’ # 199| xmlTextReaderConstLocalName(reader)); # 200| } # 201|-> xmlTextReaderRead(reader); # 202| } # 203| Error: GCC_ANALYZER_WARNING (CWE-401): [#def137] openscap-1.4.4/src/XCCDF/tailoring.c:399:22: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_tailoring_new()’ openscap-1.4.4/src/XCCDF/tailoring.c:126:9: note: in expansion of macro ‘XCCDF_ASSERT_ELEMENT’ openscap-1.4.4/src/XCCDF/tailoring.c: scope_hint: In function ‘xccdf_tailoring_parse’ # 397| bool xccdf_tailoring_set_id(struct xccdf_tailoring *tailoring, const char* newval) # 398| { # 399|-> if (tailoring->id) # 400| free(tailoring->id); # 401| Error: GCC_ANALYZER_WARNING (CWE-401): [#def138] openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_get_oval_from_model’ openscap-1.4.4/src/XCCDF/xccdf_session.c:1056:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_path_cpy’ # 1054| # 1055| xccdf_path_cpy = strdup(oscap_source_readable_origin(session->xccdf.source)); # 1056|-> dir_path = oscap_dirname(xccdf_path_cpy); # 1057| # 1058| resources = malloc(sizeof(struct oval_content_resource *)); Error: GCC_ANALYZER_WARNING (CWE-476): [#def139] openscap-1.4.4/src/XCCDF/xccdf_session.c:1059:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘resources’ # 1057| # 1058| resources = malloc(sizeof(struct oval_content_resource *)); # 1059|-> resources[idx] = NULL; # 1060| # 1061| files = xccdf_policy_model_get_systems_and_files(session->xccdf.policy_model); Error: GCC_ANALYZER_WARNING (CWE-401): [#def140] openscap-1.4.4/src/XCCDF/xccdf_session.c:1061:17: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1059| resources[idx] = NULL; # 1060| # 1061|-> files = xccdf_policy_model_get_systems_and_files(session->xccdf.policy_model); # 1062| files_it = oscap_file_entry_list_get_files(files); # 1063| while (oscap_file_entry_iterator_has_more(files_it)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def141] openscap-1.4.4/src/XCCDF/xccdf_session.c:1062:20: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1060| # 1061| files = xccdf_policy_model_get_systems_and_files(session->xccdf.policy_model); # 1062|-> files_it = oscap_file_entry_list_get_files(files); # 1063| while (oscap_file_entry_iterator_has_more(files_it)) { # 1064| struct oscap_file_entry *file_entry; Error: GCC_ANALYZER_WARNING (CWE-401): [#def142] openscap-1.4.4/src/XCCDF/xccdf_session.c:1063:16: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1061| files = xccdf_policy_model_get_systems_and_files(session->xccdf.policy_model); # 1062| files_it = oscap_file_entry_list_get_files(files); # 1063|-> while (oscap_file_entry_iterator_has_more(files_it)) { # 1064| struct oscap_file_entry *file_entry; # 1065| struct stat sb; Error: GCC_ANALYZER_WARNING (CWE-401): [#def143] openscap-1.4.4/src/XCCDF/xccdf_session.c:1068:58: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1066| bool source_owned = false; # 1067| # 1068|-> file_entry = (struct oscap_file_entry *) oscap_file_entry_iterator_next(files_it); # 1069| # 1070| // we only care about OVAL referenced files Error: GCC_ANALYZER_WARNING (CWE-401): [#def144] openscap-1.4.4/src/XCCDF/xccdf_session.c:1071:21: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1069| # 1070| // we only care about OVAL referenced files # 1071|-> if (strcmp(oscap_file_entry_get_system(file_entry), oval_sysname)) # 1072| continue; # 1073| Error: GCC_ANALYZER_WARNING (CWE-401): [#def145] openscap-1.4.4/src/XCCDF/xccdf_session.c:1074:41: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1072| continue; # 1073| # 1074|-> const char *file_path = oscap_file_entry_get_file(file_entry); # 1075| struct oscap_source *source = NULL; # 1076| Error: GCC_ANALYZER_WARNING (CWE-401): [#def146] openscap-1.4.4/src/XCCDF/xccdf_session.c:1089:34: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1087| # 1088| if (xccdf_session_get_ds_sds_session(session) != NULL) { # 1089|-> source = ds_sds_session_get_component_by_href(xccdf_session_get_ds_sds_session(session), file_path); # 1090| source_owned = false; # 1091| } else { Error: GCC_ANALYZER_WARNING (CWE-401): [#def147] openscap-1.4.4/src/XCCDF/xccdf_session.c:1093:42: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1091| } else { # 1092| if (stat(tmp_path, &sb) == 0) { # 1093|-> source = oscap_source_new_from_file(tmp_path); # 1094| source_owned = true; # 1095| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def148] openscap-1.4.4/src/XCCDF/xccdf_session.c:1100:46: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_get_oval_from_model’ # 1098| if (source != NULL) { # 1099| resources[idx] = malloc(sizeof(struct oval_content_resource)); # 1100|-> resources[idx]->href = oscap_strdup(oscap_file_entry_get_file(file_entry)); # 1101| resources[idx]->source_owned = source_owned; # 1102| resources[idx]->source = source; Error: GCC_ANALYZER_WARNING (CWE-476): [#def149] openscap-1.4.4/src/XCCDF/xccdf_session.c:1100:46: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*<unknown>’ openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_get_oval_from_model’ # 1098| if (source != NULL) { # 1099| resources[idx] = malloc(sizeof(struct oval_content_resource)); # 1100|-> resources[idx]->href = oscap_strdup(oscap_file_entry_get_file(file_entry)); # 1101| resources[idx]->source_owned = source_owned; # 1102| resources[idx]->source = source; Error: GCC_ANALYZER_WARNING (CWE-401): [#def150] openscap-1.4.4/src/XCCDF/xccdf_session.c:1100:48: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 1098| if (source != NULL) { # 1099| resources[idx] = malloc(sizeof(struct oval_content_resource)); # 1100|-> resources[idx]->href = oscap_strdup(oscap_file_entry_get_file(file_entry)); # 1101| resources[idx]->source_owned = source_owned; # 1102| resources[idx]->source = source; Error: GCC_ANALYZER_WARNING (CWE-401): [#def151] openscap-1.4.4/src/XCCDF/xccdf_session.c:1100:48: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1098| if (source != NULL) { # 1099| resources[idx] = malloc(sizeof(struct oval_content_resource)); # 1100|-> resources[idx]->href = oscap_strdup(oscap_file_entry_get_file(file_entry)); # 1101| resources[idx]->source_owned = source_owned; # 1102| resources[idx]->source = source; Error: GCC_ANALYZER_WARNING (CWE-401): [#def152] openscap-1.4.4/src/XCCDF/xccdf_session.c:1115:29: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’ # 1113| } # 1114| else { # 1115|-> if (oscap_acquire_url_is_supported(oscap_file_entry_get_file(file_entry))) { # 1116| // Strip out the 'path' for printing the url. # 1117| printable_path = (char *) oscap_file_entry_get_file(file_entry); Error: GCC_ANALYZER_WARNING (CWE-476): [#def153] openscap-1.4.4/src/XCCDF/xccdf_session.c:1130:70: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(24)’ openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_get_oval_from_model’ # 1128| # 1129| resources[idx] = malloc(sizeof(struct oval_content_resource)); # 1130|-> resources[idx]->href = oscap_strdup(printable_path); # 1131| resources[idx]->source = oscap_source_new_take_memory(data, data_size, printable_path); # 1132| resources[idx]->source_owned = true; Error: GCC_ANALYZER_WARNING (CWE-401): [#def154] openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘xccdf_session_load_check_engine_plugin2’ openscap-1.4.4/src/XCCDF/xccdf_session.c:1279:39: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘xccdf_session_load_check_engine_plugin2’ # 1277| } else { # 1278| char* xccdf_filename = oscap_strdup(oscap_source_readable_origin(session->xccdf.source)); # 1279|-> char *xccdf_dirname = oscap_dirname(xccdf_filename); # 1280| int res = check_engine_plugin_register(plugin, session->xccdf.policy_model, xccdf_dirname); # 1281| free(xccdf_dirname); Error: GCC_ANALYZER_WARNING (CWE-401): [#def155] openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_export_oval_result_file’ openscap-1.4.4/src/XCCDF/xccdf_session.c:1698:14: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(_xccdf_session_get_unique_oval_result_filename(session, oval_session, oval_results_directory))’ openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_xccdf_session_export_oval_result_file’ # 1696| const char *original_name = oval_agent_get_filename(oval_session); # 1697| char *results_file_name = oscap_strdup(name); # 1698|-> if (!oscap_htable_add(session->oval.results_mapping, original_name, results_file_name)){ # 1699| free(results_file_name); # 1700| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def156] openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[0]’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /** Error: GCC_ANALYZER_WARNING (CWE-775): [#def157] openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘stdout_pipefd[1]’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:526:17: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /** Error: GCC_ANALYZER_WARNING (CWE-401): [#def158] openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:185:25: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /** Error: GCC_ANALYZER_WARNING (CWE-401): [#def159] openscap-1.4.4/src/SCE/sce_engine.c:37: included_from: Included from here. openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘env_values’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:433:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:433:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:433:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:433:25: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /** Error: GCC_ANALYZER_WARNING (CWE-401): [#def160] openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:207:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:207:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:207:25: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:207:25: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /** Error: GCC_ANALYZER_WARNING (CWE-401): [#def161] openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘new_env_values’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:514:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:514:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:514:17: note: in expansion of macro ‘dE’ openscap-1.4.4/src/common/debug_priv.h:54:33: note: in expansion of macro ‘__dlprintf_wrapper’ openscap-1.4.4/src/common/debug_priv.h:63:17: note: in expansion of macro ‘oscap_dlprintf’ openscap-1.4.4/src/SCE/sce_engine.c:514:17: note: in expansion of macro ‘dE’ # 45| # 46| # 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__) # 48| # 49| /**
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.1 |
| analyzer-version-gcc-analyzer | 16.0.1 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| diffbase-analyzer-version-clippy | 1.92.0 |
| diffbase-analyzer-version-cppcheck | 2.19.1 |
| diffbase-analyzer-version-gcc | 16.0.1 |
| diffbase-analyzer-version-gcc-analyzer | 16.0.1 |
| diffbase-analyzer-version-shellcheck | 0.11.0 |
| diffbase-analyzer-version-unicontrol | 0.0.2 |
| diffbase-enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| diffbase-exit-code | 0 |
| diffbase-host | ip-172-16-1-89.us-west-2.compute.internal |
| diffbase-known-false-positives | /usr/share/csmock/known-false-positives.js |
| diffbase-known-false-positives-rpm | known-false-positives-0.0.0.20260119.105402.g7a5be1b.main-1.el9.noarch |
| diffbase-mock-config | fedora-rawhide-x86_64 |
| diffbase-project-name | openscap-1.4.4-0.20260122145405486063.pr2302.22.ge76f06107 |
| diffbase-store-results-to | /tmp/tmp70ktr7yn/openscap-1.4.4-0.20260122145405486063.pr2302.22.ge76f06107.tar.xz |
| diffbase-time-created | 2026-01-22 15:20:46 |
| diffbase-time-finished | 2026-01-22 15:33:28 |
| diffbase-tool | csmock |
| diffbase-tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp70ktr7yn/openscap-1.4.4-0.20260122145405486063.pr2302.22.ge76f06107.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp70ktr7yn/openscap-1.4.4-0.20260122145405486063.pr2302.22.ge76f06107.src.rpm' |
| diffbase-tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-89.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20260119.105402.g7a5be1b.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | openscap-1.4.4-0.20260112115410058871.main.21.g7a61a088a |
| store-results-to | /tmp/tmp4cm1i4uk/openscap-1.4.4-0.20260112115410058871.main.21.g7a61a088a.tar.xz |
| time-created | 2026-01-22 15:03:56 |
| time-finished | 2026-01-22 15:20:15 |
| title | Fixed findings |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp4cm1i4uk/openscap-1.4.4-0.20260112115410058871.main.21.g7a61a088a.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmp4cm1i4uk/openscap-1.4.4-0.20260112115410058871.main.21.g7a61a088a.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |