From: Francis Deslauriers Date: Tue, 28 Aug 2018 20:54:31 +0000 (-0400) Subject: Fix: use of uninitialized variable in C++ userspace-probe testapp X-Git-Tag: v2.11.0-rc1~40 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d027de5b303edccbad880d7b9494c3f562f1b323;p=lttng-tools.git Fix: use of uninitialized variable in C++ userspace-probe testapp Reported-by: Coverity (1395206) Uninitialized scalar variable Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau --- diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp index 8c25f5145..e673854fe 100644 --- a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.cpp @@ -17,6 +17,9 @@ */ #include "test_class.h" +test_class::test_class() { + test_member = 1; +} void test_class::test_method() { test_member += 1; diff --git a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h index 889792dc5..790a00dcd 100644 --- a/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h +++ b/tests/utils/testapp/userspace-probe-elf-cxx-binary/test_class.h @@ -19,6 +19,7 @@ class test_class { public: + test_class(); void test_method(); volatile int test_member; };