From bf7ca623a65f25cc4ac7a3ca0d6635331ec07c25 Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Thu, 19 Apr 2018 13:04:41 +0200 Subject: Fix Coverity reports of uninitialized scalar variable Fixes most current reports on Coverity Scan of uninitialized scalar variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html These happen most of the time (in our code) when instanciating structs without a constructor (or with an incomplete one), and later returning the instance. This is sometimes intended though, as some parameters are only used in some situations and should not be double-initialized for performance reasons (e.g. `constant` in ShaderLanguage::Token). --- core/class_db.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'core/class_db.cpp') diff --git a/core/class_db.cpp b/core/class_db.cpp index 92aa131e2..08c1ade67 100644 --- a/core/class_db.cpp +++ b/core/class_db.cpp @@ -254,11 +254,13 @@ HashMap ClassDB::compat_classes; ClassDB::ClassInfo::ClassInfo() { + api = API_NONE; creation_func = NULL; inherits_ptr = NULL; disabled = false; exposed = false; } + ClassDB::ClassInfo::~ClassInfo() { } -- cgit v1.2.3-70-g09d2