fix elusive uninitialized data bug reported by valgrind
(cherry picked from commit b44492ee05abc9a52180c73614d8876772bc4b41)