From c8b615b3eeb2a9dbd536c961b3e965881e7db303 Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Mon, 30 Jul 2018 14:50:03 -0700 Subject: [PATCH] Field initialize m_hash valgrind complain (rightly) about use of uninitialized if Structure ctor throws (eg. duplicate field). ~Field will then try to use m_hash before it has been initialized. This don't hurt and the subsequent equality tests prevent any bad behavior. --- src/factory/FieldCreateFactory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/factory/FieldCreateFactory.cpp b/src/factory/FieldCreateFactory.cpp index f6fb158..e0866e7 100644 --- a/src/factory/FieldCreateFactory.cpp +++ b/src/factory/FieldCreateFactory.cpp @@ -79,6 +79,7 @@ struct FieldCreate::Helper { Field::Field(Type type) : m_fieldType(type) + , m_hash(0) { REFTRACE_INCREMENT(num_instances); }