diff --git a/src/core/ddsi/src/ddsi_typebuilder.c b/src/core/ddsi/src/ddsi_typebuilder.c index 69cc8fd56c..00812c47df 100644 --- a/src/core/ddsi/src/ddsi_typebuilder.c +++ b/src/core/ddsi/src/ddsi_typebuilder.c @@ -1786,7 +1786,7 @@ static dds_return_t get_topic_descriptor (dds_topic_descriptor_t *desc, struct t goto err; } - struct dds_key_descriptor *key_desc; + struct dds_key_descriptor *key_desc = NULL; if ((ret = typebuilder_get_keys (tbd, &ops, &key_desc))) { typebuilder_ops_fini (&ops); diff --git a/src/core/ddsi/src/ddsi_typewrap.c b/src/core/ddsi/src/ddsi_typewrap.c index 8de0f6cdf6..c6495a1a19 100644 --- a/src/core/ddsi/src/ddsi_typewrap.c +++ b/src/core/ddsi/src/ddsi_typewrap.c @@ -2563,7 +2563,7 @@ bool ddsi_xt_is_assignable_from (struct ddsi_domaingv *gv, const struct xt_type static ddsi_typeid_kind_t ddsi_typeid_kind_impl (const struct DDS_XTypes_TypeIdentifier *type_id) { - ddsi_typeid_kind_t kind; + ddsi_typeid_kind_t kind = DDSI_TYPEID_KIND_MINIMAL; // initialize to avoid gcc-12 warning if (ddsi_typeid_is_hash_impl (type_id)) kind = ddsi_typeid_is_minimal_impl (type_id) ? DDSI_TYPEID_KIND_MINIMAL : DDSI_TYPEID_KIND_COMPLETE; else