Task #92721 - added.err
back to task #92721download
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/system_info_probe.c:555:60: warning[-Wanalyzer-malloc-leak]: leak of ‘_get_os_release(oscap_probe_root)’
# 553| /* ovec[0] and ovec[1] - are the start and the end of the whole pattern match (=".....")
# 554| * ovec[2] and ovec[3] - are start and end char positions of the capture group (.*?) */
# 555|-> ptr = strndup(os_release_data+ovec[2], ovec[3]-ovec[2]);
# 556| ret = ptr;
# 557| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/system_info_probe.c:558:9: warning[-Wanalyzer-malloc-leak]: leak of ‘_get_os_release(oscap_probe_root)’
# 556| ret = ptr;
# 557| }
# 558|-> oscap_pcre_free(re);
# 559|
# 560| finish:
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:195:31: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
# 193| SEXP_t *msg;
# 194|
# 195|-> msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno));
# 196| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg);
# 197| SEXP_free(msg);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:195:31: warning[-Wanalyzer-malloc-leak]: leak of ‘whole_path’
# 193| SEXP_t *msg;
# 194|
# 195|-> msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno));
# 196| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg);
# 197| SEXP_free(msg);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:196:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
# 194|
# 195| msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno));
# 196|-> probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg);
# 197| SEXP_free(msg);
# 198| probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:197:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
# 195| msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, "read(): '%s' %s.", whole_path, strerror(errno));
# 196| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg);
# 197|-> SEXP_free(msg);
# 198| probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR);
# 199| ret = -2;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/independent/textfilecontent54_probe.c:198:25: warning[-Wanalyzer-malloc-leak]: leak of ‘new_buf’
# 196| probe_cobj_add_msg(probe_ctx_getresult(pfd->ctx), msg);
# 197| SEXP_free(msg);
# 198|-> probe_cobj_set_flag(probe_ctx_getresult(pfd->ctx), SYSCHAR_FLAG_ERROR);
# 199| ret = -2;
# 200| goto cleanup;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:940:20: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:925:26: note: in expansion of macro ‘tmpbuf_get’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:925:26: note: in expansion of macro ‘tmpbuf_get’
# 938| */
# 939| key = strdup(buffer + bufidx);
# 940|-> if (key == NULL)
# 941| exit(ENOMEM);
# 942|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1254:20: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
# 1252|
# 1253| xiconf_strans_t *res = malloc(sizeof(xiconf_strans_t));
# 1254|-> res->cnt = rbt_str_size(xiconf->stree);
# 1255| res->srv = malloc(sizeof(xiconf_service_t *) * res->cnt);
# 1256|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1257:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 1255| res->srv = malloc(sizeof(xiconf_service_t *) * res->cnt);
# 1256|
# 1257|-> rbt_str_walk_inorder2(xiconf->stree, xiconf_dump_cb, (void *)res, 0);
# 1258|
# 1259| res->cnt = rbt_str_size(xiconf->stree);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1257:9: warning[-Wanalyzer-malloc-leak]: leak of ‘res’
# 1255| res->srv = malloc(sizeof(xiconf_service_t *) * res->cnt);
# 1256|
# 1257|-> rbt_str_walk_inorder2(xiconf->stree, xiconf_dump_cb, (void *)res, 0);
# 1258|
# 1259| res->cnt = rbt_str_size(xiconf->stree);
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
openscap-1.4.4/src/XCCDF/rule.c:586:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_new()’
# 584| struct xccdf_check *check = xccdf_check_new();
# 585|
# 586|-> check->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 587| check->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 588| check->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:587:25: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_new()’
# 585|
# 586| check->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 587|-> check->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 588| check->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR);
# 589| check->oper = oscap_string_to_enum(XCCDF_BOOLOP_MAP, xccdf_attribute_get(reader, XCCDFA_OPERATOR));
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:588:27: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_new()’
# 586| check->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 587| check->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 588|-> check->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR);
# 589| check->oper = oscap_string_to_enum(XCCDF_BOOLOP_MAP, xccdf_attribute_get(reader, XCCDFA_OPERATOR));
# 590| if (xccdf_attribute_has(reader, XCCDFA_MULTICHECK) && el != XCCDFE_COMPLEX_CHECK) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:589:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_new()’
# 587| check->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 588| check->selector = xccdf_attribute_copy(reader, XCCDFA_SELECTOR);
# 589|-> check->oper = oscap_string_to_enum(XCCDF_BOOLOP_MAP, xccdf_attribute_get(reader, XCCDFA_OPERATOR));
# 590| if (xccdf_attribute_has(reader, XCCDFA_MULTICHECK) && el != XCCDFE_COMPLEX_CHECK) {
# 591| check->flags.def_multicheck = true;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c:612:43: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_check_content_ref_new()’
# 610| break;
# 611| struct xccdf_check_content_ref *ref = xccdf_check_content_ref_new();
# 612|-> ref->name = xccdf_attribute_copy(reader, XCCDFA_NAME);
# 613| ref->href = oscap_strdup(href);
# 614| oscap_list_add(check->content_refs, ref);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:612:45: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_content_ref_new()’
# 610| break;
# 611| struct xccdf_check_content_ref *ref = xccdf_check_content_ref_new();
# 612|-> ref->name = xccdf_attribute_copy(reader, XCCDFA_NAME);
# 613| ref->href = oscap_strdup(href);
# 614| oscap_list_add(check->content_refs, ref);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:614:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
# 612| ref->name = xccdf_attribute_copy(reader, XCCDFA_NAME);
# 613| ref->href = oscap_strdup(href);
# 614|-> oscap_list_add(check->content_refs, ref);
# 615| break;
# 616| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:614:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_content_ref_new()’
# 612| ref->name = xccdf_attribute_copy(reader, XCCDFA_NAME);
# 613| ref->href = oscap_strdup(href);
# 614|-> oscap_list_add(check->content_refs, ref);
# 615| break;
# 616| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c:627:43: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_check_import_new()’
# 625| break;
# 626| struct xccdf_check_import *imp = xccdf_check_import_new();
# 627|-> imp->name = oscap_strdup(name);
# 628| if (xpath) // @import-xpath is just optional
# 629| imp->xpath = oscap_strdup(xpath);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:630:48: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
# 628| if (xpath) // @import-xpath is just optional
# 629| imp->xpath = oscap_strdup(xpath);
# 630|-> imp->content = oscap_element_string_copy(reader);
# 631| oscap_list_add(check->imports, imp);
# 632| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:630:48: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_import_new()’
# 628| if (xpath) // @import-xpath is just optional
# 629| imp->xpath = oscap_strdup(xpath);
# 630|-> imp->content = oscap_element_string_copy(reader);
# 631| oscap_list_add(check->imports, imp);
# 632| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:631:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
# 629| imp->xpath = oscap_strdup(xpath);
# 630| imp->content = oscap_element_string_copy(reader);
# 631|-> oscap_list_add(check->imports, imp);
# 632| break;
# 633| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:631:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_import_new()’
# 629| imp->xpath = oscap_strdup(xpath);
# 630| imp->content = oscap_element_string_copy(reader);
# 631|-> oscap_list_add(check->imports, imp);
# 632| break;
# 633| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c:639:43: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_check_export_new()’
# 637| break;
# 638| struct xccdf_check_export *exp = xccdf_check_export_new();
# 639|-> exp->name = oscap_strdup(name);
# 640| exp->value = xccdf_attribute_copy(reader, XCCDFA_VALUE_ID);
# 641| oscap_list_add(check->exports, exp);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:640:46: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
# 638| struct xccdf_check_export *exp = xccdf_check_export_new();
# 639| exp->name = oscap_strdup(name);
# 640|-> exp->value = xccdf_attribute_copy(reader, XCCDFA_VALUE_ID);
# 641| oscap_list_add(check->exports, exp);
# 642| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:640:46: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_export_new()’
# 638| struct xccdf_check_export *exp = xccdf_check_export_new();
# 639| exp->name = oscap_strdup(name);
# 640|-> exp->value = xccdf_attribute_copy(reader, XCCDFA_VALUE_ID);
# 641| oscap_list_add(check->exports, exp);
# 642| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:641:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_parse’
# 639| exp->name = oscap_strdup(name);
# 640| exp->value = xccdf_attribute_copy(reader, XCCDFA_VALUE_ID);
# 641|-> oscap_list_add(check->exports, exp);
# 642| break;
# 643| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:641:33: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_check_export_new()’
# 639| exp->name = oscap_strdup(name);
# 640| exp->value = xccdf_attribute_copy(reader, XCCDFA_VALUE_ID);
# 641|-> oscap_list_add(check->exports, exp);
# 642| break;
# 643| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
openscap-1.4.4/src/XCCDF/rule.c:687:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
# 685| if (name != NULL)
# 686| xccdf_check_content_ref_set_name(content_clone, name);
# 687|-> oscap_list_free(check->content_refs, (oscap_destruct_func) xccdf_check_content_ref_free);
# 688| check->content_refs = oscap_list_new();
# 689| return oscap_list_add(check->content_refs, content_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:688:31: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
# 686| xccdf_check_content_ref_set_name(content_clone, name);
# 687| oscap_list_free(check->content_refs, (oscap_destruct_func) xccdf_check_content_ref_free);
# 688|-> check->content_refs = oscap_list_new();
# 689| return oscap_list_add(check->content_refs, content_clone);
# 690| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:689:16: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_check_inject_content_ref’
# 687| oscap_list_free(check->content_refs, (oscap_destruct_func) xccdf_check_content_ref_free);
# 688| check->content_refs = oscap_list_new();
# 689|-> return oscap_list_add(check->content_refs, content_clone);
# 690| }
# 691|
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fix_clone’
openscap-1.4.4/src/XCCDF/rule.c:783:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_fix’
# 781| struct xccdf_fix *new_fix = calloc(1, sizeof(struct xccdf_fix));
# 782|
# 783|-> new_fix->reboot = old_fix->reboot;
# 784| new_fix->strategy = old_fix->strategy;
# 785| new_fix->disruption = old_fix->disruption;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fix_parse’
openscap-1.4.4/src/XCCDF/rule.c:801:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_fix_new()’
# 799| {
# 800| struct xccdf_fix *fix = xccdf_fix_new();
# 801|-> fix->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 802| fix->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 803| fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:801:19: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fix_new()’
# 799| {
# 800| struct xccdf_fix *fix = xccdf_fix_new();
# 801|-> fix->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 802| fix->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 803| fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:802:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fix_new()’
# 800| struct xccdf_fix *fix = xccdf_fix_new();
# 801| fix->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 802|-> fix->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 803| fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
# 804| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:803:25: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fix_new()’
# 801| fix->id = xccdf_attribute_copy(reader, XCCDFA_ID);
# 802| fix->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 803|-> fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
# 804| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
# 805| fix->strategy = oscap_string_to_enum(XCCDF_STRATEGY_MAP, xccdf_attribute_get(reader, XCCDFA_STRATEGY));
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:804:27: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fix_new()’
# 802| fix->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 803| fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
# 804|-> fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
# 805| fix->strategy = oscap_string_to_enum(XCCDF_STRATEGY_MAP, xccdf_attribute_get(reader, XCCDFA_STRATEGY));
# 806| fix->disruption = oscap_string_to_enum(XCCDF_LEVEL_MAP, xccdf_attribute_get(reader, XCCDFA_DISRUPTION));
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:805:27: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fix_new()’
# 803| fix->platform = xccdf_attribute_copy(reader, XCCDFA_PLATFORM);
# 804| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
# 805|-> fix->strategy = oscap_string_to_enum(XCCDF_STRATEGY_MAP, xccdf_attribute_get(reader, XCCDFA_STRATEGY));
# 806| fix->disruption = oscap_string_to_enum(XCCDF_LEVEL_MAP, xccdf_attribute_get(reader, XCCDFA_DISRUPTION));
# 807| fix->complexity = oscap_string_to_enum(XCCDF_LEVEL_MAP, xccdf_attribute_get(reader, XCCDFA_COMPLEXITY));
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fixtext_clone’
openscap-1.4.4/src/XCCDF/rule.c:820:23: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_fixtext_new()’
# 818| {
# 819| struct xccdf_fixtext * clone = xccdf_fixtext_new();
# 820|-> clone->reboot = fixtext->reboot;
# 821| clone->strategy = fixtext->strategy;
# 822| clone->disruption = fixtext->disruption;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:820:32: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fixtext_new()’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fixtext_clone’
# 818| {
# 819| struct xccdf_fixtext * clone = xccdf_fixtext_new();
# 820|-> clone->reboot = fixtext->reboot;
# 821| clone->strategy = fixtext->strategy;
# 822| clone->disruption = fixtext->disruption;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:825:23: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fixtext_clone’
# 823| clone->complexity = fixtext->complexity;
# 824| clone->fixref = oscap_strdup(fixtext->fixref);
# 825|-> clone->text = oscap_text_clone(fixtext->text);
# 826| return clone;
# 827| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/rule.c: scope_hint: In function ‘xccdf_fixtext_parse’
openscap-1.4.4/src/XCCDF/rule.c:832:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xccdf_fixtext_new()’
# 830| {
# 831| struct xccdf_fixtext *fix = xccdf_fixtext_new();
# 832|-> fix->fixref = xccdf_attribute_copy(reader, XCCDFA_FIXREF);
# 833| fix->text = oscap_text_new_parse(XCCDF_TEXT_HTMLSUB, reader);
# 834| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:832:23: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fixtext_new()’
# 830| {
# 831| struct xccdf_fixtext *fix = xccdf_fixtext_new();
# 832|-> fix->fixref = xccdf_attribute_copy(reader, XCCDFA_FIXREF);
# 833| fix->text = oscap_text_new_parse(XCCDF_TEXT_HTMLSUB, reader);
# 834| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/rule.c:833:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fixtext_new()’
# 831| struct xccdf_fixtext *fix = xccdf_fixtext_new();
# 832| fix->fixref = xccdf_attribute_copy(reader, XCCDFA_FIXREF);
# 833|-> fix->text = oscap_text_new_parse(XCCDF_TEXT_HTMLSUB, reader);
# 834| fix->reboot = xccdf_attribute_get_bool(reader, XCCDFA_REBOOT);
# 835| fix->strategy = oscap_string_to_enum(XCCDF_STRATEGY_MAP, xccdf_attribute_get(reader, XCCDFA_STRATEGY));
Error: GCC_ANALYZER_WARNING (CWE-401):
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:186: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:186: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:186: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:186: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):
openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘new_valstr_array’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1502:25: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1502:25: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1502:25: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1502:25: note: in expansion of macro ‘dD’
# 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):
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c: scope_hint: In function ‘op_remove_strl’
openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘newstr_array’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1479:17: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1479:17: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1479:17: note: in expansion of macro ‘dD’
# 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):
openscap-1.4.4/src/common/debug_priv.h:47:37: warning[-Wanalyzer-malloc-leak]: leak of ‘srv’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1553:25: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1553:25: note: in expansion of macro ‘dD’
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:64:17: note: in expansion of macro ‘oscap_dlprintf’
openscap-1.4.4/src/OVAL/probes/unix/xinetd_probe.c:1553:25: note: in expansion of macro ‘dD’
# 45|
# 46|
# 47|-> # define __dlprintf_wrapper(l, ...) __oscap_dlprintf (l, __FILE__, __PRETTY_FUNCTION__, __LINE__, 0, __VA_ARGS__)
# 48|
# 49| /**
Error: COMPILER_WARNING (CWE-195):
openscap-1.4.4/src/common/oscap_pcre.c: scope_hint: In function ‘oscap_pcre_get_substrings’
openscap-1.4.4/src/common/oscap_pcre.c:201:22: warning[-Wsign-compare]: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’
# 201 | *ofs = (*ofs == ovector[1]) ? ovector[1] + 1 : ovector[1];
# | ^~
# 199| }
# 200|
# 201|-> *ofs = (*ofs == ovector[1]) ? ovector[1] + 1 : ovector[1];
# 202|
# 203| if (!want_substrs) {