Task #97254 - added.err
back to task #97254download
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:292:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 290|
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292|-> xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293| oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:292:21: warning[-Wanalyzer-malloc-leak]: leak of ‘cpe_platform_new()’
# 290|
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292|-> xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293| oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:293:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293|-> oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:293:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cpe_platform_new()’
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293|-> oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:293:53: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293|-> oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:293:53: warning[-Wanalyzer-malloc-leak]: leak of ‘cpe_platform_new()’
# 291| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), ATTR_TITLE_STR) &&
# 292| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 293|-> oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:295:26: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 293| oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295|-> if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
# 296| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 297| ret->remark = parse_text_element(reader, (char *)TAG_REMARK_STR); // TODO: 0-n remarks !
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:295:26: warning[-Wanalyzer-malloc-leak]: leak of ‘cpe_platform_new()’
# 293| oscap_list_add(ret->titles, oscap_text_new_parse(OSCAP_TEXT_TRAITS_PLAIN, reader));
# 294| } else
# 295|-> if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
# 296| xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 297| ret->remark = parse_text_element(reader, (char *)TAG_REMARK_STR); // TODO: 0-n remarks !
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:296:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
# 296|-> xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 297| ret->remark = parse_text_element(reader, (char *)TAG_REMARK_STR); // TODO: 0-n remarks !
# 298| } else
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/CPE/cpelang_priv.c:296:25: warning[-Wanalyzer-malloc-leak]: leak of ‘cpe_platform_new()’
# 294| } else
# 295| if (!xmlStrcmp(xmlTextReaderConstLocalName(reader), TAG_REMARK_STR) &&
# 296|-> xmlTextReaderNodeType(reader) == XML_READER_TYPE_ELEMENT) {
# 297| ret->remark = parse_text_element(reader, (char *)TAG_REMARK_STR); // TODO: 0-n remarks !
# 298| } else
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/DS/sds_index.c:270:33: warning[-Wanalyzer-malloc-leak]: leak of ‘ds_sds_index_new()’
# 268| // sanity check
# 269| if (xmlTextReaderNodeType(reader) != XML_READER_TYPE_ELEMENT ||
# 270|-> strcmp((const char*)xmlTextReaderConstLocalName(reader), "component") != 0)
# 271| {
# 272| oscap_seterr(OSCAP_EFAMILY_XML,
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_get_subsets.part.0’
openscap-1.4.4/src/OVAL/oval_set.c:100:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 98| struct oval_set_AGGREGATE *aggregate = (struct oval_set_AGGREGATE *)set->extension;
# 99| subsets = (struct oval_setobject_iterator *)
# 100|-> oval_collection_iterator(aggregate->subsets);
# 101| }
# 102| return subsets;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_get_objects.part.0’
openscap-1.4.4/src/OVAL/oval_set.c:114:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 112| struct oval_set_COLLECTIVE *collective = (struct oval_set_COLLECTIVE *)set->extension;
# 113| objects = (struct oval_object_iterator *)
# 114|-> oval_collection_iterator(collective->objects);
# 115| }
# 116| return objects;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_get_filters.part.0’
openscap-1.4.4/src/OVAL/oval_set.c:128:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 126| struct oval_set_COLLECTIVE *collective = (struct oval_set_COLLECTIVE *)set->extension;
# 127| filters = (struct oval_filter_iterator *)
# 128|-> oval_collection_iterator(collective->filters);
# 129| }
# 130| return filters;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_clone’
openscap-1.4.4/src/OVAL/oval_set.c:156:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 154| case OVAL_SET_COLLECTIVE:{
# 155| struct oval_filter_iterator *filters = oval_setobject_get_filters(old_setobject);
# 156|-> while (oval_filter_iterator_has_more(filters)) {
# 157| struct oval_filter *filter = oval_filter_iterator_next(filters);
# 158| oval_setobject_add_filter(new_setobject, oval_filter_clone(new_model, filter));
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:157:62: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 155| struct oval_filter_iterator *filters = oval_setobject_get_filters(old_setobject);
# 156| while (oval_filter_iterator_has_more(filters)) {
# 157|-> struct oval_filter *filter = oval_filter_iterator_next(filters);
# 158| oval_setobject_add_filter(new_setobject, oval_filter_clone(new_model, filter));
# 159| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:158:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 156| while (oval_filter_iterator_has_more(filters)) {
# 157| struct oval_filter *filter = oval_filter_iterator_next(filters);
# 158|-> oval_setobject_add_filter(new_setobject, oval_filter_clone(new_model, filter));
# 159| }
# 160| oval_filter_iterator_free(filters);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:160:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 158| oval_setobject_add_filter(new_setobject, oval_filter_clone(new_model, filter));
# 159| }
# 160|-> oval_filter_iterator_free(filters);
# 161| struct oval_object_iterator *objects = oval_setobject_get_objects(old_setobject);
# 162| while (oval_object_iterator_has_more(objects)) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:162:32: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 160| oval_filter_iterator_free(filters);
# 161| struct oval_object_iterator *objects = oval_setobject_get_objects(old_setobject);
# 162|-> while (oval_object_iterator_has_more(objects)) {
# 163| struct oval_object *object = oval_object_iterator_next(objects);
# 164| oval_setobject_add_object(new_setobject, oval_object_clone(new_model, object));
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:163:62: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 161| struct oval_object_iterator *objects = oval_setobject_get_objects(old_setobject);
# 162| while (oval_object_iterator_has_more(objects)) {
# 163|-> struct oval_object *object = oval_object_iterator_next(objects);
# 164| oval_setobject_add_object(new_setobject, oval_object_clone(new_model, object));
# 165| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:164:33: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 162| while (oval_object_iterator_has_more(objects)) {
# 163| struct oval_object *object = oval_object_iterator_next(objects);
# 164|-> oval_setobject_add_object(new_setobject, oval_object_clone(new_model, object));
# 165| }
# 166| oval_object_iterator_free(objects);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:166:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 164| oval_setobject_add_object(new_setobject, oval_object_clone(new_model, object));
# 165| }
# 166|-> oval_object_iterator_free(objects);
# 167|
# 168| } break;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_set_type’
openscap-1.4.4/src/OVAL/oval_set.c:217:19: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘set’
# 215| __attribute__nonnull__(set);
# 216|
# 217|-> set->type = type;
# 218| switch (type) {
# 219| case OVAL_SET_AGGREGATE:{
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/OVAL/oval_set.c:223:44: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(8)’
# 221| (oval_set_AGGREGATE_t *) (set->extension =
# 222| malloc(sizeof(oval_set_AGGREGATE_t)));
# 223|-> aggregate->subsets = oval_collection_new();
# 224| }
# 225| break;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:223:46: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 221| (oval_set_AGGREGATE_t *) (set->extension =
# 222| malloc(sizeof(oval_set_AGGREGATE_t)));
# 223|-> aggregate->subsets = oval_collection_new();
# 224| }
# 225| break;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_set_type.part.0’
openscap-1.4.4/src/OVAL/oval_set.c:230:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(16)’
# 228| (oval_set_COLLECTIVE_t *) (set->extension =
# 229| malloc(sizeof(oval_set_COLLECTIVE_t)));
# 230|-> collective->filters = oval_collection_new();
# 231| collective->objects = oval_collection_new();
# 232| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:230:47: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 228| (oval_set_COLLECTIVE_t *) (set->extension =
# 229| malloc(sizeof(oval_set_COLLECTIVE_t)));
# 230|-> collective->filters = oval_collection_new();
# 231| collective->objects = oval_collection_new();
# 232| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:231:47: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 229| malloc(sizeof(oval_set_COLLECTIVE_t)));
# 230| collective->filters = oval_collection_new();
# 231|-> collective->objects = oval_collection_new();
# 232| }
# 233| break;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_set_operation’
openscap-1.4.4/src/OVAL/oval_set.c:242:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘set’
# 240| {
# 241| __attribute__nonnull__(set);
# 242|-> set->operation = operation;
# 243| }
# 244|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_add_subset’
openscap-1.4.4/src/OVAL/oval_set.c:250:9: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_setobject_new(*context.definition_model)’
# 248| oval_set_AGGREGATE_t *aggregate = (oval_set_AGGREGATE_t *) set->extension;
# 249| assert(aggregate != NULL);
# 250|-> oval_collection_add(aggregate->subsets, (void *)subset);
# 251| }
# 252|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_add_object’
openscap-1.4.4/src/OVAL/oval_set.c:258:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 256| oval_set_COLLECTIVE_t *collective = (oval_set_COLLECTIVE_t *) set->extension;
# 257| assert(collective != NULL);
# 258|-> oval_collection_add(collective->objects, (void *)object);
# 259| }
# 260|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_setobject_add_filter’
openscap-1.4.4/src/OVAL/oval_set.c:266:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
# 264| oval_set_COLLECTIVE_t *collective = (oval_set_COLLECTIVE_t *) set->extension;
# 265| assert(collective != NULL);
# 266|-> oval_collection_add(collective->filters, (void *)filter);
# 267| }
# 268|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c: scope_hint: In function ‘oval_set_parse_tag’
openscap-1.4.4/src/OVAL/oval_set.c:345:48: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_setobject_new(*context.definition_model)’
# 343| struct oval_setobject *set = oval_setobject_new(context->definition_model);
# 344|
# 345|-> oval_setobject_operation_t operation = oval_set_operation_parse(reader, "set_operator",
# 346| OVAL_SET_OPERATION_UNION);
# 347| oval_setobject_set_operation(set, operation);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/oval_set.c:349:10: warning[-Wanalyzer-malloc-leak]: leak of ‘oval_setobject_new(*context.definition_model)’
# 347| oval_setobject_set_operation(set, operation);
# 348|
# 349|-> (*consumer) (set, user);
# 350|
# 351| int return_code = oval_parser_parse_tag(reader, context, &_oval_set_parse_tag, set);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/SEAP/public/sexp.h:28: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/public/sexp-datatype.h:29: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/_sexp-datatype.h:27: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/_sexp-types.h:31: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/seap-descriptor.h:33: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/sch_queue.h:28: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/_seap.h:28: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/probe/probe.h:37: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:63: included_from: Included from here.
openscap-1.4.4/src/OVAL/probes/SEAP/public/sexp-manip.h:115:26: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
# 113| * The size of the integer may be architecture dependent.
# 114| */
# 115|-> #define SEXP_number_geti SEXP_number_geti_32
# 116|
# 117| /**
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/SEAP/sexp-manip.c: scope_hint: In function ‘SEXP_list_join’
openscap-1.4.4/src/OVAL/probes/SEAP/sexp-manip.c:1255:55: warning[-Wanalyzer-malloc-leak]: leak of ‘SEXP_new()’
# 1253|
# 1254| list_j = SEXP_new ();
# 1255|-> list_j->s_valp = SEXP_rawval_list_copy (list_a->s_valp);
# 1256|
# 1257| SEXP_list_foreach (memb, list_b)
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:324:21: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 322| }
# 323|
# 324|-> mnt_opval = probe_ent_getattrval(mnt_entity, "operation");
# 325|
# 326| if (mnt_opval != NULL) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:328:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
# 326| if (mnt_opval != NULL) {
# 327| mnt_op = (oval_operation_t)SEXP_number_geti(mnt_opval);
# 328|-> SEXP_free(mnt_opval);
# 329| } else
# 330| mnt_op = OVAL_OPERATION_EQUALS;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:332:22: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 330| mnt_op = OVAL_OPERATION_EQUALS;
# 331|
# 332|-> mnt_entval = probe_ent_getval(mnt_entity);
# 333|
# 334| if (!SEXP_stringp(mnt_entval)) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:334:14: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 332| mnt_entval = probe_ent_getval(mnt_entity);
# 333|
# 334|-> if (!SEXP_stringp(mnt_entval)) {
# 335| SEXP_free(mnt_entval);
# 336| SEXP_free(mnt_entity);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:335:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 333|
# 334| if (!SEXP_stringp(mnt_entval)) {
# 335|-> SEXP_free(mnt_entval);
# 336| SEXP_free(mnt_entity);
# 337| fclose(mnt_fp);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:336:17: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 334| if (!SEXP_stringp(mnt_entval)) {
# 335| SEXP_free(mnt_entval);
# 336|-> SEXP_free(mnt_entity);
# 337| fclose(mnt_fp);
# 338| return (PROBE_EINVAL);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:341:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 339| }
# 340|
# 341|-> SEXP_string_cstr_r(mnt_entval, mnt_path, sizeof mnt_path);
# 342| SEXP_free(mnt_entval);
# 343| SEXP_free(mnt_entity);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:342:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 340|
# 341| SEXP_string_cstr_r(mnt_entval, mnt_path, sizeof mnt_path);
# 342|-> SEXP_free(mnt_entval);
# 343| SEXP_free(mnt_entity);
# 344|
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:343:9: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 341| SEXP_string_cstr_r(mnt_entval, mnt_path, sizeof mnt_path);
# 342| SEXP_free(mnt_entval);
# 343|-> SEXP_free(mnt_entity);
# 344|
# 345| if (mnt_fp != NULL) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:355:21: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
# 353| blkid_cache blkcache;
# 354|
# 355|-> if (blkid_get_cache(&blkcache, NULL) != 0) {
# 356| endmntent(mnt_fp);
# 357| return (PROBE_EUNKNOWN);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:361:30: warning[-Wanalyzer-malloc-leak]: leak of ‘mnt_fp’
openscap-1.4.4/src/OVAL/probes/unix/linux/partition_probe.c:327:44: note: in expansion of macro ‘SEXP_number_geti’
# 359| #endif
# 360| if (mnt_op == OVAL_OPERATION_PATTERN_MATCH) {
# 361|-> re = oscap_pcre_compile(mnt_path, OSCAP_PCRE_OPTS_UTF8, &estr, &eoff);
# 362|
# 363| if (re == NULL) {
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_status_new_fill’
openscap-1.4.4/src/XCCDF/item.c:1007:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ret’
# 1005| return NULL;
# 1006| ret = calloc(1, sizeof(struct xccdf_status));
# 1007|-> if ((ret->status = oscap_string_to_enum(XCCDF_STATUS_MAP, status)) == XCCDF_STATUS_NOT_SPECIFIED) {
# 1008| free(ret);
# 1009| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1007:28: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
# 1005| return NULL;
# 1006| ret = calloc(1, sizeof(struct xccdf_status));
# 1007|-> if ((ret->status = oscap_string_to_enum(XCCDF_STATUS_MAP, status)) == XCCDF_STATUS_NOT_SPECIFIED) {
# 1008| free(ret);
# 1009| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_item_process_element’
openscap-1.4.4/src/XCCDF/item.c:1007:28: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_status_new_fill(oscap_element_string_copy(reader), xccdf_attribute_get(reader, 8))’
# 1005| return NULL;
# 1006| ret = calloc(1, sizeof(struct xccdf_status));
# 1007|-> if ((ret->status = oscap_string_to_enum(XCCDF_STATUS_MAP, status)) == XCCDF_STATUS_NOT_SPECIFIED) {
# 1008| free(ret);
# 1009| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_status_new_fill’
openscap-1.4.4/src/XCCDF/item.c:1011:21: warning[-Wanalyzer-malloc-leak]: leak of ‘ret’
# 1009| return NULL;
# 1010| }
# 1011|-> ret->date = oscap_get_date(date);
# 1012| return ret;
# 1013| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_clone’
openscap-1.4.4/src/XCCDF/item.c:1061:27: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘new_model’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_clone’
# 1059| {
# 1060| struct xccdf_model *new_model = calloc(1, sizeof(struct xccdf_model));
# 1061|-> new_model->system = oscap_strdup(old_model->system);
# 1062|
# 1063| //params maps char * to char * so we will need to oscap_strdup the items.
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1064:29: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_clone’
# 1062|
# 1063| //params maps char * to char * so we will need to oscap_strdup the items.
# 1064|-> new_model->params = oscap_htable_clone(old_model->params, (oscap_clone_func) oscap_strdup);
# 1065| //new_model->params = NULL;
# 1066| return new_model;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1064:29: warning[-Wanalyzer-malloc-leak]: leak of ‘new_model’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_clone’
# 1062|
# 1063| //params maps char * to char * so we will need to oscap_strdup the items.
# 1064|-> new_model->params = oscap_htable_clone(old_model->params, (oscap_clone_func) oscap_strdup);
# 1065| //new_model->params = NULL;
# 1066| return new_model;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_new’
openscap-1.4.4/src/XCCDF/item.c:1072:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘model’
# 1070| {
# 1071| struct xccdf_model *model = calloc(1, sizeof(struct xccdf_model));
# 1072|-> model->params = oscap_htable_new();
# 1073| return model;
# 1074| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1072:21: warning[-Wanalyzer-malloc-leak]: leak of ‘model’
# 1070| {
# 1071| struct xccdf_model *model = calloc(1, sizeof(struct xccdf_model));
# 1072|-> model->params = oscap_htable_new();
# 1073| return model;
# 1074| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_model_new_xml’
openscap-1.4.4/src/XCCDF/item.c:1086:25: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1084|
# 1085| model = xccdf_model_new();
# 1086|-> model->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 1087|
# 1088| while (oscap_to_start_element(reader, depth)) {
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1088:16: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1086| model->system = xccdf_attribute_copy(reader, XCCDFA_SYSTEM);
# 1087|
# 1088|-> while (oscap_to_start_element(reader, depth)) {
# 1089| if (xccdf_element_get(reader) == XCCDFE_PARAM) {
# 1090| const char *name = xccdf_attribute_get(reader, XCCDFA_NAME);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1089:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1087|
# 1088| while (oscap_to_start_element(reader, depth)) {
# 1089|-> if (xccdf_element_get(reader) == XCCDFE_PARAM) {
# 1090| const char *name = xccdf_attribute_get(reader, XCCDFA_NAME);
# 1091| char *value = oscap_element_string_copy(reader);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1090:44: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1088| while (oscap_to_start_element(reader, depth)) {
# 1089| if (xccdf_element_get(reader) == XCCDFE_PARAM) {
# 1090|-> const char *name = xccdf_attribute_get(reader, XCCDFA_NAME);
# 1091| char *value = oscap_element_string_copy(reader);
# 1092| if (!name || !value || !oscap_htable_add(model->params, name, value))
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1091:39: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1089| if (xccdf_element_get(reader) == XCCDFE_PARAM) {
# 1090| const char *name = xccdf_attribute_get(reader, XCCDFA_NAME);
# 1091|-> char *value = oscap_element_string_copy(reader);
# 1092| if (!name || !value || !oscap_htable_add(model->params, name, value))
# 1093| free(value);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1092:29: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_model_new()’
# 1090| const char *name = xccdf_attribute_get(reader, XCCDFA_NAME);
# 1091| char *value = oscap_element_string_copy(reader);
# 1092|-> if (!name || !value || !oscap_htable_add(model->params, name, value))
# 1093| free(value);
# 1094| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_warning_new’
openscap-1.4.4/src/XCCDF/item.c:1120:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘w’
# 1118| {
# 1119| struct xccdf_warning *w = calloc(1, sizeof(struct xccdf_warning));
# 1120|-> w->category = XCCDF_WARNING_GENERAL;
# 1121| return w;
# 1122| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_warning_new_parse’
openscap-1.4.4/src/XCCDF/item.c:1127:19: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_warning_new()’
# 1125| {
# 1126| struct xccdf_warning *w = xccdf_warning_new();
# 1127|-> w->category = oscap_string_to_enum(XCCDF_WARNING_MAP, xccdf_attribute_get(reader, XCCDFA_CATEGORY));
# 1128| w->text = oscap_text_new_parse(XCCDF_TEXT_HTMLSUB, reader);
# 1129| return w;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_item_process_element’
openscap-1.4.4/src/XCCDF/item.c:1127:19: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_warning_new_parse(reader)’
# 1125| {
# 1126| struct xccdf_warning *w = xccdf_warning_new();
# 1127|-> w->category = oscap_string_to_enum(XCCDF_WARNING_MAP, xccdf_attribute_get(reader, XCCDFA_CATEGORY));
# 1128| w->text = oscap_text_new_parse(XCCDF_TEXT_HTMLSUB, reader);
# 1129| return w;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c:1218:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
# 1216| {
# 1217| struct xccdf_value_instance * clone = calloc(1, sizeof(struct xccdf_value_instance));
# 1218|-> clone->type = val->type;
# 1219|
# 1220| clone->value = oscap_strdup(val->value);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1222:22: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
# 1220| clone->value = oscap_strdup(val->value);
# 1221| clone->defval = oscap_strdup(val->defval);
# 1222|-> clone->choices = oscap_list_clone(val->choices, (oscap_clone_func) oscap_strdup);
# 1223| clone->match = oscap_strdup(val->match);
# 1224| clone->lower_bound = val->lower_bound;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1222:22: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
# 1220| clone->value = oscap_strdup(val->value);
# 1221| clone->defval = oscap_strdup(val->defval);
# 1222|-> clone->choices = oscap_list_clone(val->choices, (oscap_clone_func) oscap_strdup);
# 1223| clone->match = oscap_strdup(val->match);
# 1224| clone->lower_bound = val->lower_bound;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
# 1226|
# 1227| clone->flags = val->flags;
# 1228|-> xccdf_value_instance_set_selector(clone, xccdf_value_instance_get_selector(val));
# 1229| return clone;
# 1230| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1228:9: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_value_instance_clone’
# 1226|
# 1227| clone->flags = val->flags;
# 1228|-> xccdf_value_instance_set_selector(clone, xccdf_value_instance_get_selector(val));
# 1229| return clone;
# 1230| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_identity_clone’
openscap-1.4.4/src/XCCDF/item.c:1249:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_identity_clone’
# 1247| clone->sub.authenticated = identity->sub.authenticated;
# 1248| clone->sub.privileged = identity->sub.privileged;
# 1249|-> clone->name = oscap_strdup(identity->name);
# 1250| return clone;
# 1251| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_target_fact_clone’
openscap-1.4.4/src/XCCDF/item.c:1256:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
# 1254| {
# 1255| struct xccdf_target_fact * clone = calloc(1, sizeof(struct xccdf_target_fact));
# 1256|-> clone->type = tf->type;
# 1257| clone->name = oscap_strdup(tf->name);
# 1258| clone->value = oscap_strdup(tf->value);
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_override_clone’
openscap-1.4.4/src/XCCDF/item.c:1265:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
# 1263| {
# 1264| struct xccdf_override * clone = calloc(1, sizeof(struct xccdf_override));
# 1265|-> clone->time = override->time;
# 1266| clone->authority = oscap_strdup(clone->authority);
# 1267| clone->old_result = override->old_result;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1269:25: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_override_clone’
# 1267| clone->old_result = override->old_result;
# 1268| clone->new_result = override->new_result;
# 1269|-> clone->remark = oscap_text_clone(override->remark);
# 1270| return clone;
# 1271| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_message_clone’
openscap-1.4.4/src/XCCDF/item.c:1276:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_message_clone’
# 1274| {
# 1275| struct xccdf_message * clone = calloc(1, sizeof(struct xccdf_message));
# 1276|-> clone->content = oscap_strdup(message->content);
# 1277| clone->severity = message->severity;
# 1278| return clone;
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_instance_clone’
openscap-1.4.4/src/XCCDF/item.c:1284:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_instance_clone’
# 1282| {
# 1283| struct xccdf_instance * clone = calloc(1, sizeof(struct xccdf_instance));
# 1284|-> clone->context = oscap_strdup(instance->context);
# 1285| clone->parent_context = oscap_strdup(instance->parent_context);
# 1286| clone->content = oscap_strdup(instance->content);
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c:1293:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1291| {
# 1292| struct xccdf_rule_result * clone = calloc(1, sizeof(struct xccdf_rule_result));
# 1293|-> clone->idref = oscap_strdup(result->idref);
# 1294| clone->role = result->role;
# 1295| clone->time = oscap_strdup(result->time);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1300:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1298| clone->result = result->result;
# 1299| clone->version = oscap_strdup(result->version);
# 1300|-> clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1300:28: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1298| clone->result = result->result;
# 1299| clone->version = oscap_strdup(result->version);
# 1300|-> clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1301:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1299| clone->version = oscap_strdup(result->version);
# 1300| clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301|-> clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1301:25: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1299| clone->version = oscap_strdup(result->version);
# 1300| clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301|-> clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1302:27: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1300| clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302|-> clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1302:27: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1300| clone->overrides = oscap_list_clone(result->overrides, (oscap_clone_func) xccdf_override_clone);
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302|-> clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1303:28: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303|-> clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305| clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1303:28: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1301| clone->idents = oscap_list_clone(result->idents, (oscap_clone_func) xccdf_ident_clone);
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303|-> clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305| clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1304:24: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304|-> clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305| clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
# 1306| return clone;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1304:24: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1302| clone->messages = oscap_list_clone(result->messages, (oscap_clone_func) xccdf_message_clone);
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304|-> clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305| clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
# 1306| return clone;
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1305:25: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305|-> clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
# 1306| return clone;
# 1307| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/item.c:1305:25: warning[-Wanalyzer-malloc-leak]: leak of ‘clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_rule_result_clone’
# 1303| clone->instances = oscap_list_clone(result->instances, (oscap_clone_func) xccdf_instance_clone);
# 1304| clone->fixes = oscap_list_clone(result->fixes, (oscap_clone_func) xccdf_fix_clone);
# 1305|-> clone->checks = oscap_list_clone(result->checks, (oscap_clone_func) xccdf_check_clone);
# 1306| return clone;
# 1307| }
Error: GCC_ANALYZER_WARNING (CWE-476):
openscap-1.4.4/src/XCCDF/item.c: scope_hint: In function ‘xccdf_score_clone’
openscap-1.4.4/src/XCCDF/item.c:1312:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘clone’
# 1310| {
# 1311| struct xccdf_score * clone = calloc(1, sizeof(struct xccdf_score));
# 1312|-> clone->maximum = score->maximum;
# 1313| clone->score = score->score;
# 1314| clone->system = oscap_strdup(score->system);
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/XCCDF/rule.c:834:27: warning[-Wanalyzer-malloc-leak]: leak of ‘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));
# 836| 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:835:27: warning[-Wanalyzer-malloc-leak]: leak of ‘xccdf_fixtext_new()’
# 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));
# 836| fix->disruption = oscap_string_to_enum(XCCDF_LEVEL_MAP, xccdf_attribute_get(reader, XCCDFA_DISRUPTION));
# 837| fix->complexity = oscap_string_to_enum(XCCDF_LEVEL_MAP, xccdf_attribute_get(reader, XCCDFA_COMPLEXITY));
Error: GCC_ANALYZER_WARNING (CWE-126):
openscap-1.4.4/src/XCCDF/xccdf_session.c:1006:38: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
openscap-1.4.4/src/XCCDF/xccdf_session.c:1006:38: note: read of 8 bytes from after the end of the region
# 1004| for (int i=0; resources[i]; i++) {
# 1005| free(resources[i]->href);
# 1006|-> if (resources[i]->source_owned) {
# 1007| oscap_source_free(resources[i]->source);
# 1008| }
Error: GCC_ANALYZER_WARNING (CWE-401):
openscap-1.4.4/src/XCCDF/xccdf_session.c:1007:33: warning[-Wanalyzer-malloc-leak]: leak of ‘resources’
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
# 1005| free(resources[i]->href);
# 1006| if (resources[i]->source_owned) {
# 1007|-> oscap_source_free(resources[i]->source);
# 1008| }
# 1009| free(resources[i]);
Error: GCC_ANALYZER_WARNING (CWE-126):
openscap-1.4.4/src/XCCDF/xccdf_session.c:1009:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
openscap-1.4.4/src/XCCDF/xccdf_session.c: scope_hint: In function ‘_oval_content_resources_free.part.0’
openscap-1.4.4/src/XCCDF/xccdf_session.c:1009:25: note: read of 8 bytes from after the end of the region
# 1007| oscap_source_free(resources[i]->source);
# 1008| }
# 1009|-> free(resources[i]);
# 1010| }
# 1011| free(resources);
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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):
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| }